Skip to content

Guides

Capture forms

Define structured forms your assistant fills in during a conversation and delivers to email or SMS recipients.

A capture form is a structured set of questions attached to an assistant. Each form has a trigger describing when it applies, an introMessage the assistant uses to start the form, an ordered list of typed fields to collect, and one or more recipients (email and/or SMS) who receive the captured answers.

Typical use: a callback-request form ("caller wants a call back") that collects name, phone, and reason, then emails the details to your front desk.

MethodPathPurpose
GET/capture-formsList capture forms (optionally by assistant)
GET/capture-forms/{id}Get one capture form
POST/capture-formsCreate a capture form
PUT/capture-forms/{id}Replace a capture form
PATCH/capture-forms/{id}Partially update a capture form
DELETE/capture-forms/{id}Delete a capture form

Form structure#

FieldTypeRequiredDescription
assistantIdUUIDYesThe assistant this form belongs to (ownership is validated)
namestringYesForm name
triggerstringYesWhen the assistant should run this form
introMessagestringYesWhat the assistant says when starting the form
emailRecipientsstring[] (emails)See noteWho receives the results by email
smsRecipientsstring[] (phone numbers)See noteWho receives the results by SMS
fieldsfield[]Yes (min 1)The questions to collect — see below
propertiesobjectNoFree-form metadata, defaults to {}
isActivebooleanNoWhether the form is active

At least one recipient

On create (and full replace), emailRecipients and smsRecipients together must contain at least one entry. SMS recipients must be valid phone numbers. On PATCH the rule is enforced whenever you touch either recipients field.

Fields#

Each entry in fields:

FieldTypeRequiredDescription
keystringYesUnique per form, lowercase snake_case (e.g. contact_email)
questionstringYesWhat the assistant asks
typestring | numberYesExpected answer type
requiredbooleanNoWhether the answer is mandatory
optionsstring[]NoAllowed choices
actionstringNoExtra action hint for this field
wait_for_responsebooleanNoWhether to pause for the answer
promptstringNoGuidance injected into the system prompt to steer how the AI asks this field. Supports {question} (replaced with this field's question) and {{property}} client-parameter placeholders.

Duplicate key values across fields are rejected with a validation error.

Create a capture form#

POST /capture-forms

bash
curl -X POST https://core-api.heysadie.ai/capture-forms \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistantId": "ASSISTANT_ID",
    "name": "Callback request",
    "trigger": "The caller asks for a call back from a human.",
    "introMessage": "Sure — I just need a few details so the team can call you back.",
    "emailRecipients": ["[email protected]"],
    "fields": [
      {
        "key": "caller_name",
        "question": "What is your full name?",
        "type": "string",
        "required": true
      },
      {
        "key": "callback_number",
        "question": "What is the best number to reach you on?",
        "type": "string",
        "required": true
      },
      {
        "key": "reason",
        "question": "What is the call back regarding?",
        "type": "string"
      }
    ],
    "isActive": true
  }'

List capture forms#

GET /capture-forms

Query paramTypeRequiredDescription
limitnumberNoPage size, max 500 (default 50)
offsetnumberNoItems to skip
assistantIdUUIDNoOnly forms for this assistant
Terminal
curl "https://core-api.heysadie.ai/capture-forms?assistantId=ASSISTANT_ID" \
  -H "Authorization: ApiKey YOUR_API_KEY"

Update a capture form#

Two options:

  • PUT /capture-forms/{id}full replace; the body is the same as create (all required fields again, at least one recipient).
  • PATCH /capture-forms/{id}partial update; assistantId is still required in the body, everything else is optional. Sending fields replaces the whole field list (min 1 entry).
Terminal
curl -X PATCH https://core-api.heysadie.ai/capture-forms/CAPTURE_FORM_ID \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "assistantId": "ASSISTANT_ID", "isActive": false }'

Delete a capture form#

Terminal
curl -X DELETE https://core-api.heysadie.ai/capture-forms/CAPTURE_FORM_ID \
  -H "Authorization: ApiKey YOUR_API_KEY"

Next steps#