https://api.telnyx.com/v2. Use the API reference as the contract for each operation. It defines the supported method, path, authentication, query parameters, request media type, response schema, and status codes.
Construct a request
A typical JSON request contains:- Send
Authorization: Bearer <TELNYX_API_KEY>when the operation declares Bearer authentication. - Send
Accept: application/jsonfor JSON REST responses. - Send
Content-Type: application/jsononly when a body is present and the operation accepts JSON. - Do not set multipart or form media types unless the endpoint reference declares them.
Select the HTTP method
GETretrieves a resource or collection without requesting a state change.POSTcreates a resource or invokes an action.PATCHupdates fields on an existing resource.DELETEremoves a resource.
Read successful responses
Many REST operations return a top-leveldata member. A single-resource response commonly uses an object:
data array and can include pagination metadata:
data, meta, or JSON.
Common success statuses include 200 OK, 201 Created, 202 Accepted, and 204 No Content. Read the operation reference before deciding whether to parse a body or poll an asynchronous resource.
Read error responses
General REST failures commonly return anerrors array:
code: Stable Telnyx error identifier when supplied.title: Short error classification.detail: Request-specific explanation.source.pointer: JSON Pointer to the invalid request member.source.parameter: Invalid query parameter.meta: Additional product-specific context.
Handle status codes
400or422: Correct the request; do not retry unchanged input.401: Restore a valid credential and Bearer header.403: Check account access, resource ownership, verification, and product prerequisites.404: Verify the path and resource identifier.409: Reconcile current resource state before retrying.429: Respect rate-limit guidance and delay the next attempt.5xx: Treat as potentially transient, subject to operation safety and the retry guidance.