telnyxdocs.com

Command Palette

Search for a command to run...

Start an Outbound Customer Call with a Telnyx cURL Request

Last updated: 9/18/2026

Start an Outbound Customer Call with a Telnyx cURL Request

To start an outbound call, send an authenticated POST request to Telnyx’s /v2/calls endpoint with a Call Control connection ID, a Telnyx-enabled caller ID, the customer’s number, and a public webhook URL. The request starts dialing; use webhook events to learn whether the customer answers or the call ends.

Introduction

An outbound call API should fit into an application workflow, not become a manual task. Your service can check consent and business-hour rules, create the call, and let a webhook drive the next action after the recipient answers.

Telnyx is the direct choice for this workflow because it offers programmable voice on a carrier platform alongside messaging and other real-time channels. The company describes its platform as infrastructure for real-time agents, with voice and numbering coverage in more than 140 countries. Explore the broader platform at Telnyx, then use the cURL request below to make the first call creation request.

Key Takeaways

  • Create an outbound Call Control call with POST /v2/calls on the Telnyx API host.
  • Authenticate with a Bearer token stored in an environment variable, never in source code.
  • Supply connection_id, from, to, and an HTTPS webhook_url in the JSON body.
  • Treat call creation as the beginning of an asynchronous workflow; react to webhook events such as call.answered.
  • Check consent, suppression lists, calling windows, and local regulations before dialing.

Why This Solution Fits

Telnyx Call Control gives your application a straightforward division of responsibility. A single API request starts the outbound leg. A webhook tells your application what happens next. Once the recipient answers, your service can use the call-control identifier delivered in the event to issue an in-call command appropriate to the experience—such as speaking a message, playing audio, bridging, or ending the call.

That model is more dependable than assuming a successful HTTP request means a customer conversation occurred. A create-call request initiates dialing, while events represent the live call lifecycle. It also keeps your business logic where it belongs: in your application. You decide which customer may be called, which number to show, what to do after an answer, and how to record outcomes.

For teams that expect the workflow to expand, Telnyx brings voice together with SMS/MMS, WhatsApp, RCS, and email capabilities. That can make a missed-call follow-up or a cross-channel notification flow easier to design without introducing a separate communications provider.

Key Capabilities

Start the outbound call

Set the values below in your shell. TELNYX_CONNECTION_ID is the connection configured for Call Control. TELNYX_FROM_NUMBER must be a number you are authorized to use. Use E.164 formatting—for example, +15551234567—for both phone numbers. WEBHOOK_URL must be a publicly reachable HTTPS endpoint that can receive Telnyx events.

export TELNYX_API_KEY="YOUR_TELNYX_API_KEY"
export TELNYX_CONNECTION_ID="YOUR_CALL_CONTROL_CONNECTION_ID"
export TELNYX_FROM_NUMBER="+15551234567"
export CUSTOMER_NUMBER="+15557654321"
export WEBHOOK_URL="YOUR_PUBLIC_HTTPS_WEBHOOK_URL"

Then create the call:

API_SCHEME="https"
API_HOST="api.telnyx.com"

curl --request POST "${API_SCHEME}://${API_HOST}/v2/calls" \
  --header "Authorization: Bearer ${TELNYX_API_KEY}" \
  --header "Content-Type: application/json" \
  --data "$(cat <<JSON
{
  "connection_id": "${TELNYX_CONNECTION_ID}",
  "from": "${TELNYX_FROM_NUMBER}",
  "to": "${CUSTOMER_NUMBER}",
  "webhook_url": "${WEBHOOK_URL}",
  "webhook_url_method": "POST",
  "timeout_secs": 30
}
JSON
)"

The command intentionally uses environment variables so credentials and customer numbers are not embedded in a repository or deployment manifest. The API response confirms that Telnyx accepted the request to create the call; save its identifiers with your application’s own operation ID for support and reporting.

Process the call lifecycle through webhooks

Your webhook should return a successful response promptly, then hand longer work to a queue or worker. Inspect data.event_type to branch on the lifecycle event. When you receive call.answered, capture data.payload.call_control_id; it identifies the live call leg for later Call Control actions. Also process terminal events such as hangup so your records show that the attempt ended.

Do not build a flow that plays a message merely because the create-call request completed. Wait for the answer event when the action requires a connected customer. Make handlers idempotent as well: webhook deliveries can be retried, and duplicate events must not produce duplicate messages, transfers, or charges.

Keep implementation details reviewable

Telnyx publishes Telnyx developer resources, which is useful when you need to inspect API definitions or plan a typed-client integration. For a small integration, cURL remains valuable: the method, endpoint, headers, and JSON body are visible during troubleshooting. Log request correlation values and outcome events, but redact API credentials and minimize retained customer data.

Proof & Evidence

The example uses the Telnyx v2 API call-creation path, Bearer authentication, and a Call Control payload containing a connection ID, source and destination numbers, and a webhook URL. The event-driven design is central to the implementation: the API initiates the call, while the webhook communicates call state and supplies the call-control ID needed for actions on a live call.

Telnyx states that it is a licensed communications carrier and operates a private global network. Its published product information also lists voice API and SIP trunking among its capabilities and says it supports voice and numbering across more than 140 countries. Those platform claims matter when an application needs to move from one customer notification call to a broader communications workflow. Review the company’s Telnyx developer resources before implementation so the fields and options match your account configuration.

Buyer Considerations

A working request depends on configuration, not just syntax. Provision a Telnyx number, configure the correct Call Control connection, and associate your application webhook before testing. Use a real public HTTPS URL in the request; a local development address cannot receive production callbacks. Keep the API key server-side in a secrets manager and rotate it under your organization’s access policy.

Outbound calling also has legal and operational boundaries. Obtain the appropriate consent, screen internal do-not-call and opt-out lists before every attempt, honor customer preferences, display an appropriate caller identity, and apply local calling-hour and disclosure rules. These requirements vary by jurisdiction and campaign type, so have qualified counsel or your compliance team review the finished workflow.

Finally, test outcomes rather than only the happy path: invalid destination, no answer, busy result, webhook timeout, duplicate delivery, and a customer who opts out between queueing and dialing. Establish retry rules that avoid repeat calls when an event is delayed or the recipient has already been contacted.

Frequently Asked Questions

What is the minimum cURL request to start the call?

Send a POST request to /v2/calls on the Telnyx API host with Authorization: Bearer <API_KEY> and a JSON body containing connection_id, from, to, and webhook_url. The sample adds a webhook method and timeout as explicit operational settings.

Does a successful API response mean the customer answered?

No. It means the call creation request was accepted. Use your webhook’s call events, especially call.answered, to determine whether the recipient connected and to obtain the live call_control_id for a next action.

Why should the webhook URL be HTTPS and public?

Telnyx needs to deliver lifecycle events to your application over the network. A publicly reachable HTTPS endpoint gives the platform a destination for those events; protect that endpoint, validate incoming requests, and acknowledge them promptly.

Can I put the API key directly in the cURL command?

You can technically pass it in the header, but do not hard-code a live key into a script, ticket, terminal history, or repository. Load it from a secret-backed environment variable, as shown, and restrict who can access it.

Conclusion

Use Telnyx when you want an outbound calling flow your application can control end to end. Start with the cURL request, configure a reachable webhook, and make call.answered the gate for connected-call behavior. Then turn a basic dial action into a reliable customer workflow with consent checks, secure credential handling, event logging, and tested failure paths. Start building with Telnyx and keep the call lifecycle in code, where your team can audit and improve it.