> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Telnyx

> Telnyx communications: messages, phone numbers, number lookup, available-number search, usage detail records and balance.

![](https://mintcdn.com/webrouter/T_A5Quwg50s_JK2y/logo/data-apis/telnyx.webp?fit=max\&auto=format\&n=T_A5Quwg50s_JK2y\&q=85\&s=def8095d4b63fb15461179bbc6c83504)

[Web Catalog · Messaging](https://docs.webrouter.net/data-apis.md?category=messaging)

Needs&#x20;

`TELNYX_API_KEY`

Endpoints

6

Auth

Key in header

[Vendor docs](https://developers.telnyx.com/api-reference)

&#x20;·&#x20;

[Pricing](https://telnyx.com/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `TELNYX_API_KEY` | required | A Telnyx API key (KEY...) from the Mission Control portal, sent as a Bearer token. |
| `TELNYX_API_HOST` | optional | Regional endpoint: api.telnyx.com (North America, default), .eu, .com.au, .ca or .me. The same key works on every region. Default `api.telnyx.com`. One of `api.telnyx.com`, `api.telnyx.eu`, `api.telnyx.com.au`, `api.telnyx.ca`, `api.telnyx.me`. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Lists page with page\[number] and page\[size]; filters use bracketed names (filter\[status]).
* Phone numbers are +E.164 everywhere.
* Rate limits vary by endpoint and are counted per region; a 429 means slow down, and x-ratelimit-remaining is sent when available.

## Endpoints

GET

Get account balance

Balance, available credit and credit limit.

[Open](#telnyx-balance-get)

GET

List your phone numbers

Numbers on the account, with status, connection and tags.

[Open](#telnyx-phone-numbers-list)

GET

Get a message

One sent or received message with its delivery status.

[Open](#telnyx-messages-get)

GET

Look up a phone number

Carrier, line type and, on request, caller name for a number.

[Open](#telnyx-number-lookup)

GET

Search numbers to buy

Numbers in Telnyx inventory matching location, type and features.

[Open](#telnyx-available-numbers-search)

GET

Search usage detail records

Billing-grade records of messages, calls and other usage, by type and date range.

[Open](#telnyx-detail-records-search)

### Get account balance

GET

`/balance`

`telnyx.balance.get`

Balance, available credit and credit limit.

Input

No inputs.

[Vendor docs](https://developers.telnyx.com/api-reference/billing/get-user-balance-details)

```python Python theme={null}
router.call_data_api("telnyx.balance.get")
```

```text MCP theme={null}
call_data_api(endpoint="telnyx.balance.get")
```

### List your phone numbers

GET

`/phone_numbers`

`telnyx.phone_numbers.list`

Numbers on the account, with status, connection and tags.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `page_number`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page to load.
      </td>
    </tr>

    <tr>
      <td>
        `page_size`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to 250, default 20.
      </td>
    </tr>

    <tr>
      <td>
        `filter_phone_number`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Number digits, at least three.
      </td>
    </tr>

    <tr><td>`filter_status`</td><td>string</td><td>query</td><td>Number status. One of `purchase-pending`, `purchase-failed`, `port-pending`, `active`, `deleted`, `port-failed`, `emergency-only`, `ported-out`, `port-out-pending`</td></tr>

    <tr>
      <td>
        `filter_tag`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only numbers with this tag.
      </td>
    </tr>

    <tr>
      <td>
        `filter_country_iso_alpha2`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Country code, ISO alpha-2.
      </td>
    </tr>

    <tr><td>`sort`</td><td>string</td><td>query</td><td>Sort field; created\_at descending by default. One of `purchased_at`, `phone_number`, `connection_name`, `usage_payment_method`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.telnyx.com/api-reference/phone-number-configurations/list-phone-numbers)

```python Python theme={null}
router.call_data_api("telnyx.phone_numbers.list")
```

```text MCP theme={null}
call_data_api(endpoint="telnyx.phone_numbers.list")
```

### Get a message

GET

`/messages/{id}`

`telnyx.messages.get`

One sent or received message with its delivery status.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Message id (UUID).
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.telnyx.com/api-reference/messages/retrieve-a-message)

> [!NOTE]
>
> * Only messages up to 10 days old; older ones need an MDR report.

### Look up a phone number

GET

`/number_lookup/{phone_number}`

`telnyx.number_lookup`

Carrier, line type and, on request, caller name for a number.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`phone_number` required</td><td>string</td><td>path</td><td>Number to look up, +E.164. Example `+18665552368`</td></tr>
    <tr><td>`type`</td><td>string</td><td>query</td><td>Data source; repeat for several. One of `carrier`, `caller-name`, `caller-identity`, `enhanced-caller-name`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.telnyx.com/api-reference/number-lookup/lookup-phone-number-data) · Same job: [HLR Lookup](https://docs.webrouter.net/data-apis/hlrlookup.md#hlrlookup-hlr-lookup), [Trestle](https://docs.webrouter.net/data-apis/trestleiq.md#trestleiq-phone-validate), [Twilio](https://docs.webrouter.net/data-apis/twilio.md#twilio-lookup), [Whitepages Pro](https://docs.webrouter.net/data-apis/whitepages.md#whitepages-phone-get)

```python Python theme={null}
router.call_data_api("telnyx.number_lookup", {'phone_number': '+18665552368'})
```

```text MCP theme={null}
call_data_api(endpoint="telnyx.number_lookup", params={"phone_number": "+18665552368"})
```

### Search numbers to buy

GET

`/available_phone_numbers`

`telnyx.available_numbers.search`

Numbers in Telnyx inventory matching location, type and features.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`country_code`</td><td>string</td><td>query</td><td>Country, ISO alpha-2. Example `US`</td></tr>

    <tr>
      <td>
        `locality`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        City.
      </td>
    </tr>

    <tr>
      <td>
        `administrative_area`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        US state or CA province.
      </td>
    </tr>

    <tr>
      <td>
        `national_destination_code`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Area code.
      </td>
    </tr>

    <tr><td>`phone_number_type`</td><td>string</td><td>query</td><td>Number type. One of `local`, `toll_free`, `mobile`, `national`, `shared_cost`</td></tr>

    <tr>
      <td>
        `features`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Required features, e.g. sms, voice.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Maximum results.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.telnyx.com/api-reference/phone-number-search/list-available-phone-numbers)

```python Python theme={null}
router.call_data_api("telnyx.available_numbers.search", {'country_code': 'US'})
```

```text MCP theme={null}
call_data_api(endpoint="telnyx.available_numbers.search", params={"country_code": "US"})
```

### Search usage detail records

GET

`/detail_records`

`telnyx.detail_records.search`

Billing-grade records of messages, calls and other usage, by type and date range.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`record_type` required</td><td>string</td><td>query</td><td>Record type; required. One of `ai-voice-assistant`, `amd`, `call-control`, `conference`, `conference-participant`, `embedding`, `fax`, `inference`, `inference-speech-to-text`, `media_storage`, `media-streaming`, `messaging`, `noise-suppression`, `recording`, `sip-trunking`, `siprec-client`, `stt`, `tts`, `verify`, `webrtc`, `wireless`</td></tr>

    <tr>
      <td>
        `date_range`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        yesterday, today, last\_week, this\_month..., or last\_N\_days.
      </td>
    </tr>

    <tr>
      <td>
        `sort`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Sort fields, e.g. -created\_at; valid fields depend on record\_type.
      </td>
    </tr>

    <tr>
      <td>
        `page_number`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number.
      </td>
    </tr>

    <tr>
      <td>
        `page_size`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page size.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.telnyx.com/api-reference/detail-records/search-detail-records)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.