Skip to main content
GET
/
call_reasons
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const callReasonListResponse of client.callReasons.list()) {
  console.log(callReasonListResponse.id);
}
{
  "data": [
    {
      "id": "d29914a4-3c93-440c-af72-03778f442522",
      "reason": "Account Alert",
      "description": "Alert about account status or changes"
    },
    {
      "id": "4cabcae2-6c61-415b-ac5b-753469458a56",
      "reason": "Account Notification",
      "description": "General account notifications"
    }
  ],
  "meta": {
    "page_number": 1,
    "page_size": 2,
    "total_results": 45,
    "total_pages": 23
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

page[number]
integer
default:1

1-based page number. Out-of-range values return an empty page with correct meta.

Required range: x >= 1
Example:

1

page[size]
integer
default:100

Items per page. Default 100 for this endpoint (the call-reason library is small and most callers want the whole list in one call). Maximum 250; values above are clamped to 250.

Required range: 1 <= x <= 250
Example:

100

Response

Paginated list of standard call reasons.

data
object[]
required
meta
object
required

JSON:API pagination metadata returned with every paginated list response. Page numbering is 1-based. page_size reports the number of items actually returned in data for this page; the requested size is taken from the page[size] query parameter.