Skip to main content
POST
Create an ai snippet

Authorizations

x-api-key
string
header
required

Body

application/json
name
string
required
Minimum string length: 1
toneId
string
required
Minimum string length: 1
model
string
required
Minimum string length: 1
outputLength
integer
required
Required range: 0 <= x <= 10
prompt
string
required

Plain prompt text. Placeholders: {fieldId} for contact/company/CRM/formula/notes fields (discover via the contact/company field-metadata endpoints), {aiResearch:<id-or-name>}, {aiSnippet:<id-or-name>}, {aiMessage:<id-or-name>} for AI entity references. Validation is strict: unknown or ambiguous tokens return 400 with the invalid tokens and a sample of valid ones. Escape literal braces by doubling them ({{ and }}).

description
string | null
fallbackText
string | null
folderId
number | null

Optional folder id. Must belong to this workspace and be an AI snippet folder — discover with list_ai_snippet_folders (GET /v1/ai-variables/folders/ai-snippets) and create with create_ai_snippet_folder if missing. Contact/company AI variable folder ids are rejected with 400.

customPromptFieldValues
object[]

Response

AI snippet created successfully

status
enum<string>
required
Available options:
success
message
string
required
data
object

The created AI variable entity.