> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/telnyx.md).

# Telnyx

Send SMS and MMS, place and control calls, verify and look up phone numbers, and generate AI responses with Telnyx.

## Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication |
| --------- | -------------- |
| Telnyx    | API Key        |

### Telnyx

Connect to Telnyx to send messages, place calls, verify phone numbers, and use AI.

#### Set up in Telnyx

1. Prepare the Telnyx account or service that the workflow will access. Grant access to the required resources and operations.
2. **API Key:** Create an API key in the Telnyx Customer Portal under API Keys, then paste it here.

#### Set up in StackAI

1. Open **Settings → Connections**, add a connection, and select **Telnyx**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required | What to enter                                                                                                                                          |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| API Key       | Yes      | Create an API key in the Telnyx Customer Portal under API Keys, then paste it here. [Provider instructions](https://portal.telnyx.com/#/app/api-keys). |

### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

## Use an action

1. Add the required **Telnyx** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

## Actions

### Send SMS or MMS

Send an SMS or MMS message through Telnyx.

#### Inputs

| Field        | Type            | Required | Description                                                                                                         |
| ------------ | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Recipient    | string          | Yes      | Recipient phone number, including + and country code.                                                               |
| Message type | select (string) | No       | Whether to send text only or include media. Available values: SMS, MMS. Default: SMS.                               |
| Message      | textarea        | No       | Message text. Required for SMS; optional for MMS.                                                                   |
| Media links  | textarea        | No       | Public HTTPS links to media, one per line, up to 1 MB combined. Required for MMS.                                   |
| MMS subject  | string          | No       | Optional subject line for an MMS.                                                                                   |
| Sender       | select (string) | Yes      | Choose a messaging number, or enter an approved short code or sender ID. Options load from the selected connection. |
| Send at      | datetime        | No       | Leave blank to send now. Schedule messages 5 minutes to 5 days in the future.                                       |

#### Outputs

| Field          | Type     | Description                                 |
| -------------- | -------- | ------------------------------------------- |
| Message ID     | string   | Telnyx identifier for the message.          |
| Message type   | string   | Protocol used for the message.              |
| Initial status | string   | Initial delivery state returned by Telnyx.  |
| Message parts  | integer  | Number of message parts reported by Telnyx. |
| Sent at        | datetime | Time Telnyx sent the message.               |

### Place call

Call a phone number from your Telnyx number.

#### Inputs

| Field                           | Type            | Required | Description                                                                                                                                                                 |
| ------------------------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Voice API application           | select (string) | Yes      | Select an application or enter its exact name or ID. Options load from the selected connection.                                                                             |
| Recipient                       | string          | Yes      | Phone number to call, including + and country code.                                                                                                                         |
| Caller                          | string          | Yes      | Your Telnyx phone number shown to the recipient, including + and country code.                                                                                              |
| Caller name                     | string          | No       | Optional caller name shown when supported.                                                                                                                                  |
| Audio to play on answer         | string          | No       | Public HTTPS link to a WAV or MP3 played once the recipient answers.                                                                                                        |
| Ring timeout (seconds)          | integer         | No       | Seconds to wait for the call to be answered. Minimum: 5. Maximum: 600. Default: 30.                                                                                         |
| Maximum call duration (seconds) | integer         | No       | Maximum connected-call duration in seconds. Minimum: 30. Maximum: 14400. Default: 14400.                                                                                    |
| Detect voicemail                | boolean         | No       | Ask Telnyx to detect whether a person or voicemail answers. Telnyx sends the result to the Voice API application's webhook; it is not available in StackAI. Default: false. |
| Record call                     | boolean         | No       | Start recording after the call is answered. Default: false.                                                                                                                 |

#### Outputs

| Field           | Type    | Description                                                                          |
| --------------- | ------- | ------------------------------------------------------------------------------------ |
| Call control ID | string  | Identifier used for later call commands.                                             |
| Call leg ID     | string  | The Telnyx ID for this connection within the call.                                   |
| Call session ID | string  | The Telnyx ID shared by all connections in the same call.                            |
| Call active     | boolean | Whether Telnyx currently reports an active call. A new call may still be connecting. |
| Recording ID    | string  | Recording identifier when Telnyx starts recording with the call.                     |

### Look up phone number

Validate and enrich a phone number with carrier or caller-name data.

#### Inputs

| Field              | Type                      | Required | Description                                                                                                   |
| ------------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| Phone number       | string                    | Yes      | Phone number to look up, including + and country code.                                                        |
| Details to include | multiple\_select (string) | No       | Carrier and caller-name details are only returned when selected here. Available values: Carrier, Caller name. |

#### Outputs

| Field                   | Type   | Description                                                            |
| ----------------------- | ------ | ---------------------------------------------------------------------- |
| Normalized phone number | string | The phone number in international format, with + and the country code. |
| National format         | string | Phone number formatted for its country.                                |
| Country code            | string | Two-letter country code.                                               |
| Carrier                 | string | Current carrier name.                                                  |
| Carrier type            | string | Line or carrier category.                                              |
| Caller name             | string | Caller-name value when available.                                      |
| Ported status           | string | Y if the number moved from its original carrier to another, N if not.  |

### Send verification code

Send a one-time verification code by SMS.

#### Inputs

| Field                     | Type            | Required | Description                                                                                       |
| ------------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------- |
| Phone number              | string          | Yes      | Phone number receiving the code, including + and country code.                                    |
| Verify profile            | select (string) | Yes      | Select a Verify profile or enter its exact name or ID. Options load from the selected connection. |
| Code expiration (seconds) | integer         | No       | How long the code remains valid. Leave blank to use the profile's setting. Minimum: 1.            |

#### Outputs

| Field                     | Type    | Description                                  |
| ------------------------- | ------- | -------------------------------------------- |
| Verification ID           | string  | Identifier for the verification attempt.     |
| Status                    | string  | Current verification state.                  |
| Phone number              | string  | Destination normalized by Telnyx.            |
| Code expiration (seconds) | integer | How long the code remains valid, in seconds. |

### Verify phone number

Check a one-time code and confirm the phone number.

#### Inputs

| Field             | Type            | Required | Description                                                                                       |
| ----------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------- |
| Phone number      | string          | Yes      | Use the same phone number entered in Send verification code, including + and country code.        |
| Verify profile    | select (string) | Yes      | Select a Verify profile or enter its exact name or ID. Options load from the selected connection. |
| Verification code | secret          | Yes      | One-time code received by the user.                                                               |

#### Outputs

| Field               | Type    | Description                             |
| ------------------- | ------- | --------------------------------------- |
| Phone number        | string  | Phone number checked by Telnyx.         |
| Verification result | string  | Whether the code was accepted.          |
| Verified            | boolean | True only when Telnyx accepts the code. |

### Generate AI response

Generate an AI response to a question or instruction.

#### Inputs

| Field                 | Type            | Required | Description                                                                                                                                              |
| --------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Prompt                | textarea        | Yes      | Instruction or question for the model.                                                                                                                   |
| System instructions   | textarea        | No       | Optional behavior and context for the model.                                                                                                             |
| Model                 | select (string) | No       | Select an available Telnyx model or enter its exact model ID. Options load from the selected connection. Default: meta-llama/Meta-Llama-3.1-8B-Instruct. |
| Temperature           | number          | No       | Higher values make the response more varied; keep it low for consistent output. Default: 0.1.                                                            |
| Maximum output tokens | integer         | No       | Maximum number of tokens in the generated response. Default: 512.                                                                                        |
| Request JSON response | boolean         | No       | Ask for a JSON object and describe its fields in the prompt. The reply is still returned as text, and some models ignore this setting. Default: false.   |

#### Outputs

| Field         | Type     | Description                                                     |
| ------------- | -------- | --------------------------------------------------------------- |
| Response      | textarea | Generated response as text, including JSON text when requested. |
| Model         | string   | Model reported by Telnyx.                                       |
| Finish reason | string   | Why generation stopped.                                         |
| Input tokens  | integer  | Tokens used by the input.                                       |
| Output tokens | integer  | Tokens used by the output.                                      |
| Total tokens  | integer  | Total tokens used by the request.                               |

### Get message

Get the status and details of a Telnyx message.

#### Inputs

| Field      | Type   | Required | Description                                                                                                 |
| ---------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- |
| Message ID | string | Yes      | The Message ID from Send SMS or MMS or On message event. Only messages from the last 10 days are available. |

#### Outputs

| Field        | Type     | Description                        |
| ------------ | -------- | ---------------------------------- |
| Message ID   | string   | Telnyx message identifier.         |
| Status       | string   | Current delivery state.            |
| Sender       | string   | Address that sent the message.     |
| Recipient    | string   | Primary recipient address.         |
| Message      | string   | Message text.                      |
| Sent at      | datetime | Time Telnyx sent the message.      |
| Completed at | datetime | Time delivery processing finished. |

### Get call

Check whether a Telnyx call is still active.

#### Inputs

| Field           | Type   | Required | Description                                               |
| --------------- | ------ | -------- | --------------------------------------------------------- |
| Call control ID | string | Yes      | Use the Call control ID from Place call or On call event. |

#### Outputs

| Field           | Type    | Description                                               |
| --------------- | ------- | --------------------------------------------------------- |
| Call control ID | string  | Identifier for the call.                                  |
| Call leg ID     | string  | The Telnyx ID for this connection within the call.        |
| Call session ID | string  | The Telnyx ID shared by all connections in the same call. |
| Call active     | boolean | Whether the call is currently active.                     |

### Hang up call

End an active Telnyx call.

#### Inputs

| Field           | Type   | Required | Description                                               |
| --------------- | ------ | -------- | --------------------------------------------------------- |
| Call control ID | string | Yes      | Use the Call control ID from Place call or On call event. |

#### Outputs

| Field            | Type    | Description                                                             |
| ---------------- | ------- | ----------------------------------------------------------------------- |
| Call control ID  | string  | Call that received the hangup command.                                  |
| Command accepted | boolean | Whether Telnyx accepted the hang-up. The call can take a moment to end. |

### Speak on call

Read text aloud on an active Telnyx call.

#### Inputs

| Field           | Type            | Required | Description                                                                                                                                                                                          |
| --------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Call control ID | string          | Yes      | Use the Call control ID from Place call or On call event.                                                                                                                                            |
| Text to speak   | textarea        | Yes      | Text or SSML to read aloud, up to 3,000 characters.                                                                                                                                                  |
| Speech format   | select (string) | No       | Whether the speech is plain text or SSML. Available values: Plain text, SSML. Default: text.                                                                                                         |
| Speech quality  | select (string) | No       | Basic supports plain text in US English with a male or female voice. Premium adds more voices, languages, and SSML. Leave blank for Basic. Available values: Basic, Premium.                         |
| Language        | select (string) | No       | Language whose voices are offered below. Basic supports only en-US. Options load from the selected connection.                                                                                       |
| Voice           | select (string) | No       | The voice that speaks the text. Basic offers a male or female voice; for Premium, select a language to see its voices. Leave blank for the default voice. Options load from the selected connection. |

#### Outputs

| Field            | Type    | Description                                                       |
| ---------------- | ------- | ----------------------------------------------------------------- |
| Call control ID  | string  | Call that received the speak command.                             |
| Command accepted | boolean | Telnyx accepted the speech command; playback may still be queued. |

## Triggers

A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.

### On message event

Start a workflow when Telnyx receives a message or updates outbound delivery state.

In the Telnyx Customer Portal, go to Messaging Suite > Messaging > Programmable Messaging, open the profile that sends your messages, and set its outbound webhook URL to {{webhook\_url}}. Then copy the key from Account settings > API KEYS > Public Key into 'Telnyx public key' below; every delivery is rejected without it.

#### Configuration

| Field                              | Type    | Required | Description                                                                                                          |
| ---------------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| Telnyx public key                  | string  | Yes      | Copy the public key from Telnyx Customer Portal > Account settings > API KEYS > Public Key. Do not use your API key. |
| Reject events older than (seconds) | integer | No       | How stale a Telnyx event can be and still be accepted, allowing for clock drift. Default: 300.                       |

#### Event inputs

| Field       | Type     | Required | Description                                      |
| ----------- | -------- | -------- | ------------------------------------------------ |
| Event ID    | string   | Yes      | Unique Telnyx event identifier.                  |
| Event type  | string   | Yes      | The Telnyx event type, such as message.received. |
| Occurred at | string   | Yes      | Time the event occurred.                         |
| Message ID  | string   | No       | Message associated with the event.               |
| Sender      | string   | No       | Message sender.                                  |
| Recipient   | string   | No       | Primary message recipient.                       |
| Message     | textarea | No       | Message text when present.                       |
| Status      | string   | No       | Delivery state when present.                     |

#### Outputs

| Field       | Type     | Description                                      |
| ----------- | -------- | ------------------------------------------------ |
| Event ID    | string   | Unique Telnyx event identifier.                  |
| Event type  | string   | The Telnyx event type, such as message.received. |
| Occurred at | datetime | Time the event occurred.                         |
| Message ID  | string   | Message associated with the event.               |
| Sender      | string   | Message sender.                                  |
| Recipient   | string   | Primary message recipient.                       |
| Message     | textarea | Message text when present.                       |
| Status      | string   | Delivery state when present.                     |

### On call event

Start a workflow when a Telnyx call starts, is answered, or ends.

In the Telnyx Customer Portal, go to Voice Suite > Voice > Programmable Voice, open the Voice API application used for this call, and set its webhook URL to {{webhook\_url}}. Then copy the key from Account settings > API KEYS > Public Key into 'Telnyx public key' below; every delivery is rejected without it.

#### Configuration

| Field                              | Type    | Required | Description                                                                                                          |
| ---------------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| Telnyx public key                  | string  | Yes      | Copy the public key from Telnyx Customer Portal > Account settings > API KEYS > Public Key. Do not use your API key. |
| Reject events older than (seconds) | integer | No       | How stale a Telnyx event can be and still be accepted, allowing for clock drift. Default: 300.                       |

#### Event inputs

| Field           | Type   | Required | Description                                                              |
| --------------- | ------ | -------- | ------------------------------------------------------------------------ |
| Event ID        | string | Yes      | Unique Telnyx event identifier.                                          |
| Event type      | string | Yes      | The Telnyx event type, such as call.answered.                            |
| Occurred at     | string | Yes      | Time the event occurred.                                                 |
| Call control ID | string | No       | Identifier for later call commands.                                      |
| Call leg ID     | string | No       | The Telnyx ID for this connection within the call.                       |
| Caller          | string | No       | The phone number that placed the call.                                   |
| Recipient       | string | No       | The phone number that was called.                                        |
| End reason      | string | No       | Why the call ended, such as normal\_clearing. Empty until the call ends. |

#### Outputs

| Field           | Type     | Description                                                              |
| --------------- | -------- | ------------------------------------------------------------------------ |
| Event ID        | string   | Unique Telnyx event identifier.                                          |
| Event type      | string   | The Telnyx event type, such as call.answered.                            |
| Occurred at     | datetime | Time the event occurred.                                                 |
| Call control ID | string   | Identifier for later call commands.                                      |
| Call leg ID     | string   | The Telnyx ID for this connection within the call.                       |
| Caller          | string   | The phone number that placed the call.                                   |
| Recipient       | string   | The phone number that was called.                                        |
| End reason      | string   | Why the call ended, such as normal\_clearing. Empty until the call ends. |

### On verification event

Start a workflow when Telnyx reports verification delivery progress or failure.

In the Telnyx Customer Portal, go to Other Products > Identity > Verify, open the profile used for verification, and set its webhook URL to {{webhook\_url}}. Then copy the key from Account settings > API KEYS > Public Key into 'Telnyx public key' below; every delivery is rejected without it.

#### Configuration

| Field                              | Type    | Required | Description                                                                                                          |
| ---------------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| Telnyx public key                  | string  | Yes      | Copy the public key from Telnyx Customer Portal > Account settings > API KEYS > Public Key. Do not use your API key. |
| Reject events older than (seconds) | integer | No       | How stale a Telnyx event can be and still be accepted, allowing for clock drift. Default: 300.                       |

#### Event inputs

| Field           | Type   | Required | Description                                      |
| --------------- | ------ | -------- | ------------------------------------------------ |
| Event ID        | string | Yes      | Unique Telnyx event identifier.                  |
| Event type      | string | Yes      | The Telnyx event type, such as verify.delivered. |
| Occurred at     | string | Yes      | Time the event occurred.                         |
| Verification ID | string | No       | Verification associated with the event.          |
| Phone number    | string | No       | Destination being verified.                      |
| Status          | string | No       | Verification delivery state.                     |

#### Outputs

| Field           | Type     | Description                                      |
| --------------- | -------- | ------------------------------------------------ |
| Event ID        | string   | Unique Telnyx event identifier.                  |
| Event type      | string   | The Telnyx event type, such as verify.delivered. |
| Occurred at     | datetime | Time the event occurred.                         |
| Verification ID | string   | Verification associated with the event.          |
| Phone number    | string   | Destination being verified.                      |
| Status          | string   | Verification delivery state.                     |

## Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/telnyx.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
