AI agent
Save a procedure simulation
Authorization
AuthorizationstringrequiredAn API token, sent as Bearer <token>.
Needs the ai:write ability
Path parameters
procedurestringrequiredId of the AI agent procedure, starting with prc_, such as prc_01jx2m8k4t. Find it with GET /procedures.
Body
application/jsonaction_mocksobjectWhat each action answers instead of really being called, as an object keyed by action id; each value has status (HTTP status, 100 to 599) and body (any JSON), such as {"aac_abc123": {"status": 200, "body": {"order": {"status": "shipped"}}}}. An action with no mock answers with the result of its last live test.
assertionsobject[] | nullChecks after the test, at most 30 objects with a type: procedure_matched, handed_off, action_called or action_not_called (action), action_order (action, before), branch_taken (step_id, branch then or else), reply_contains or reply_not_contains (text), llm_rubric (rubric). Such as [{"type": "action_called", "action": "aac_abc123"}].
Maximum items: 30
messagesobject[] | nullThe customer's scripted messages, oldest first, 1 to 12, each an object with text (1 to 4,000 characters) and optional confirm (true first confirms the writes waiting from the turn before; text may then be empty). Such as [{"text": "I want a refund for order 1042"}, {"text": "", "confirm": true}].
Maximum items: 12
Show child attributesHide child attributes
confirmbooleantrue to first confirm the writes left waiting by the turn before, as the customer pressing Confirm on the card would; with true the text may be empty. false or left out to only send the text.
textstringrequiredWhat the made-up customer writes in this turn, 1 to 4000 characters, such as I want a refund for order 1042. It may be empty only when confirm is true.
Maximum length: 4000
namestringWhat the team calls the simulation, up to 120 characters, such as Refund past the window.
Maximum length: 120
personaobjectShow child attributesHide child attributes
attributesobjectThe made-up customer's custom attributes, as an object of attribute key to value. They count as trusted. Such as {"plan": "pro"}.
channelstringThe channel the made-up customer writes from: widget, email, slack, whatsapp, instagram, facebook or api. Left out or empty, it is widget. Such as "email".
Available options:widgetemailslackwhatsappinstagramfacebookapi
companyobjectThe custom attributes of the made-up customer's company, as an object of attribute key to value, such as {"plan": "enterprise"}.
emailstringThe made-up customer's email address, at most 320 characters, such as ada@example.com.
Maximum length: 320
external_idstringYour own system's id of the made-up customer, at most 200 characters, such as user_8421. Giving one makes them a known user, not a lead.
Maximum length: 200
inbox_idstringId of the inbox the made-up conversation is placed in, starting with inbox_, such as inbox_01jx2m8k4t. Find it with GET /inboxes.
Maximum length: 64
namestringThe made-up customer's name, at most 200 characters, such as Ada Lovelace.
Maximum length: 200
verifiedbooleantrue when the made-up customer is signed in, so their identity and email count as verified; false or left out for an unverified visitor.
scenariostringWho the customer is and what they came for, up to 1000 characters; the simulated customer answers from it.
Maximum length: 1000
simulated_atstringThe date and time the simulation pretends it is when it runs, as an ISO 8601 time, such as "2026-12-24T18:00:00Z". Left out, it runs at the real current time.
Format: date-time
source_conversation_idstringThe real conversation (conv_...) the simulation was made from, when it was. Leave out otherwise.
Response 201
CreateddataobjectrequiredShow child attributesHide child attributes
action_mocksanyrequiredWhat each mocked action answers, as a JSON object keyed by action, each with an HTTP status and a body.
assertionsanyrequiredWhat must hold after the simulated conversation, as a JSON array of checks, such as a procedure match, an action call, a branch taken, a handover or reply text.
created_atstringrequiredWhen it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
Format: date-time
idstringrequiredThe id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
last_resultanyrequiredHow its last run went, as a JSON object with passed, ran_at, turns, assertion_results and, on a broken run, error. Null when it never ran.
messagesanyrequiredThe scripted customer messages of the test, in order, as a JSON array; each has text and an optional confirm.
namestringrequiredName of the test, up to 120 characters.
objectstringrequiredThe kind of record this is, the same for every record of its kind, such as article.
personaanyrequiredThe made-up customer of the test, as a JSON object with fields such as name, email, verified, channel, attributes and company.
procedure_idstringrequiredId of the procedure the test belongs to (starts with prc_).
scenariostringrequiredWho the customer is and what they came for. The simulated customer answers from it.
simulated_atstring | nullrequiredThe moment the test pretends it is, so date rules such as a refund window give the same result every run. Null to run at the real time.
Format: date-time
source_conversation_idstring | nullrequiredId of the real conversation the test was made from (starts with conv_). Null when it was written by hand.
updated_atstringrequiredWhen it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
Format: date-time
Response error
ErrorcodestringrequiredStable code for programs to tell errors apart, such as validation_failed or internal_error.
errorsobjectEach rejected field mapped to its messages. Only present when the input was invalid.
messagestringrequiredWhat went wrong, in words safe to show a person.