Create Agent
Header Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A saved agent: what a number answers with, and what POST /calls can
place calls with via agent_id.
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/agents" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "system_prompt": "string" }'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "name": "string", "system_prompt": "string", "first_message": "string", "recording_enabled": true, "ai_disclosure": true, "ai_disclosure_line": "string", "voice_config": {}, "tools": [ "string" ], "max_duration_seconds": 0, "handover_max_duration_seconds": 0, "voice_enabled": true, "sms_enabled": true, "email_enabled": true, "status": "live", "handover_contacts": [ { "contact_id": "string", "name": "string", "phone_e164": "string", "note": "string" } ], "http_tools": [ { "name": "string", "description": "string", "url": "string", "parameters": {}, "header_names": [ "string" ], "timeout_seconds": 0, "wait_message": "string" } ], "http_tool_secret": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Confirm Verification
Enter the code the carrier texted to confirm a person's US texting registration. Use it when the verification shows `confirmation: "code"`. On success the campaign is usually filed at once. It waits when your credit does not cover its fee (`waiting_for_credit` is true until you add credit; `credit_needed_cents` says how much). It also waits while another check of it is running or recently failed, or another process holds it; a later check files it. Poll GET /verifications/{id} until `approved`. A wrong or expired code is 422 on `code`; after five wrong codes, 429 until the carrier sends a new code (once a day). 409 when there is nothing to confirm.
Create Call
Place an outbound AI voice call. The call is placed asynchronously — this returns as soon as the call is queued, not when it completes. Poll GET /v1/calls/{call_id} for the final status and the transcript, or subscribe to webhooks: call.completed (and the other call.* events) for the status, call.summarized for the transcript and a short summary. Requires recipient_consent=true on the request body; Hail does not verify lawful basis to contact the recipient, the caller warrants it.