Skip to main content

Overview

AI Variables let you define reusable AI-powered fields for contacts and companies. The new OpenAPI section covers the full lifecycle:
  • List AI Variables: GET /v1/ai-variables
  • Get one AI Variable: GET /v1/ai-variables/{aiVariableId}
  • Create an AI Variable: POST /v1/ai-variables
  • Update an AI Variable: PATCH /v1/ai-variables/{aiVariableId}
  • Delete an AI Variable: DELETE /v1/ai-variables/{aiVariableId}
  • List contact AI Variable folders: GET /v1/ai-variables/folders/contacts
  • List company AI Variable folders: GET /v1/ai-variables/folders/companies
  • Create, update, get, and delete folder endpoints under those same folder paths
It also adds field-discovery endpoints so you can see exactly which placeholders are valid:
  • Contact fields: GET /v1/contacts/fields
  • Company fields: GET /v1/companies/fields

Mental Model

An AI Variable is defined by the prompt you write, the entity it belongs to, and the output format you expect back. Send prompt as plain text and Enginy handles the internal prompt representation automatically.

Prompt Format

Reference fields with curly braces:
Use the exact id returned by the field-discovery endpoints. If you send an unknown placeholder, the API returns a validation error starting with Invalid placeholders detected.

Request Format

Minimal create payload

Structured create payload

AI Variable Fields

outputSchema Format

outputSchema describes the expected AI output.

search Toggle

search is a boolean:
  • true: enable Deep Search
  • false: disable Deep Search

Folder Endpoints

AI Variables support folder CRUD for both entities:
  • Contact folders: GET|POST /v1/ai-variables/folders/contacts
  • Contact folder detail/update/delete: GET|PATCH|DELETE /v1/ai-variables/folders/contacts/{folderId}
  • Company folders: GET|POST /v1/ai-variables/folders/companies
  • Company folder detail/update/delete: GET|PATCH|DELETE /v1/ai-variables/folders/companies/{folderId}
Deleting an AI Variable folder does not delete the AI Variables inside it. Enginy moves those variables, and any child folders, up to the deleted folder’s parent.

Discovering Valid Field Names

Before writing prompts, fetch the available fields for the relevant entity:

Contact fields

GET /v1/contacts/fields

Company fields

GET /v1/companies/fields Each field object includes: For contact variables, GET /v1/contacts/fields includes both contact-backed placeholders and company-backed placeholders that are valid in contact prompts, such as {companyName}.

Typical Flow

  1. Call GET /v1/contacts/fields or GET /v1/companies/fields
  2. Build your prompt with the returned field id values
  3. Create the AI Variable with POST /v1/ai-variables
  4. Retrieve contacts or companies with the generated field through the normal entity endpoints

Notes

  • Archived AI Variables are excluded from GET /v1/ai-variables unless you pass includeArchived=true
  • Updating prompt causes Enginy to regenerate its internal prompt representation automatically
  • Deleting an AI Variable also removes its generated smart-field values from entity records