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 Config, 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 id and 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.
voices array with pagination fields. 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:
id. The {{customer_name}} placeholder is a dynamic variable; you supply its value per call after publishing.
Step 4: Publish version 1
New agents start as drafts. Publish version 1 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 moves from initiated to in-progress, then to a terminal state such as completed, failed, busy, or no-answer. 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:
Some catalog resources, such as voices and LLMs, return IDs without a prefix. 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.