curl and a DialNexa account.
Before you begin
- Create an API key in the dashboard under Settings > API Keys. The key has the form
key_id:secretand the full value is your Bearer token. See API fundamentals for details. - Every request in this guide uses the v1 base URL:
- To place a real call in step 5, the destination country must be enabled in Workspace Settings > Telephony, or you need a SIP/BYOC route.
Step 1: Verify your API key
Call Validate API Key. It is the purpose-built check: read-only, it creates nothing, and it tells you which workspace the key belongs to.200 response contains data.valid: true, the key’s data.key.id and data.key.name, and data.organization.id. Confirm that workspace ID is the one you meant to use, since a key from another workspace authenticates successfully and then acts on the wrong data.
A 401 Unauthorized means the key is missing, malformed, unknown, expired, or revoked. An invalid key returns an error rather than a success response with valid: false. Check that you sent the complete key_id:secret value and see API fundamentals for the standard error format.
Step 2: List languages and voices
An agent needs a language and a voice. List both catalogs and copy oneid from each.
limit (maximum 50) and page. Copy the id of a voice you like. You can filter by provider, gender, or language_id; see List Voices for all filters. Pick a voice that supports the language you chose.
Step 3: Create an agent
An agent combines a voice, a language, and a prompt into a deployable entity. Onlytitle, language_id, voice_id, and prompt_text are required:
data. Save data.id. The {{customer_name}} placeholder is a dynamic variable; you supply its value per call after publishing.
Step 4: Publish version 0
New agents start with a draft version 0. Publish version 0 before using it for a live call:Step 5: Trigger a call
Place a single outbound call with the agent.phone_number, agent_id, and metadata are required; metadata carries the dynamic variable values (send {} if the prompt uses none):
phone_number must be in E.164 format, + followed by the country code and number. The response includes the call id. See Create Call for destination validation rules.
Step 6: Read the result
Fetch the call to see its status, duration, and outcome:status is created, initiated, sent or received, and has ended once it is completed, did_not_pick, busy, no_answer, failed, cancelled or retry_expired. For production integrations, prefer webhooks over polling; see Get Call Details for polling guidance.
Resource ID prefixes
DialNexa IDs are prefixed strings that tell you what kind of resource you are holding:
Workspace (organization), organization folder and knowledge base document IDs have no prefix, for example
5VjulLGsmWVQlD: data.organization.id from the key check above looks like this.
Always treat IDs as opaque strings and copy them from API responses rather than constructing them.
Next steps
- Introduction: the full API overview and key concepts.
- Create Batch Call: call a whole list of contacts from one file upload.
- Create Webhook: get notified when calls end instead of polling.
- API fundamentals: authentication, pagination, errors, and production-safe retries.