openapi: 3.2.0 info: version: 2.0.0 x-latency-category: responsive x-endpoint-cost: light title: Telnyx Phone Numbers API description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services. contact: email: support@telnyx.com servers: - url: https://api.telnyx.com/v2 description: Version 2.0.0 of the Telnyx API security: - bearerAuth: [] tags: - name: Phone Numbers description: Associate phone numbers with a verified DIR so calls from those numbers carry the DIR's display identity. paths: /dir/{dir_id}/phone_numbers: delete: summary: Remove phone numbers from a DIR description: Deregister phone numbers from a DIR. The enterprise is resolved server-side from the DIR id. Returns a partial-success envelope. operationId: deleteDirPhoneNumbersSimplified tags: - Phone Numbers parameters: - $ref: '#/components/parameters/DirId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkDeletePhoneNumbersRequest' example: phone_numbers: - '+19493253498' responses: '200': description: Bulk-delete response. Inspect both `deleted` and `errors`. content: application/json: schema: $ref: '#/components/schemas/PhoneNumberBulkDeleteResponse' default: $ref: '#/components/responses/branded-calling_GenericErrorResponse' 4XX: $ref: '#/components/responses/branded-calling_GenericErrorResponse' get: summary: List phone numbers attached to a DIR description: List the phone numbers registered under a DIR. The enterprise is resolved server-side from the DIR id. operationId: listDirPhoneNumbersSimplified tags: - Phone Numbers parameters: - $ref: '#/components/parameters/DirId' - $ref: '#/components/parameters/BcPageNumber' - $ref: '#/components/parameters/BcPageSize' - name: status in: query required: false description: Filter by phone-number status. schema: $ref: '#/components/schemas/PhoneNumberStatus' responses: '200': description: Paginated list of phone numbers. content: application/json: schema: $ref: '#/components/schemas/PhoneNumberList' default: $ref: '#/components/responses/branded-calling_GenericErrorResponse' 4XX: $ref: '#/components/responses/branded-calling_GenericErrorResponse' post: summary: Add phone numbers to a DIR description: 'Register phone numbers under a DIR. The enterprise is resolved server-side from the DIR id. **Pricing:** Adding phone numbers is free. Branded Calling fees are charged per DIR and per branded call. See https://telnyx.com/pricing/branded-calling for current pricing.' operationId: addDirPhoneNumbersSimplified tags: - Phone Numbers parameters: - $ref: '#/components/parameters/DirId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkAddPhoneNumbersRequest' example: phone_numbers: - '+19493253498' - '+12134445566' documents: - document_id: 2a7e8337-e803-4057-a4ae-26c40eb0bc6c document_type: letter_of_authorization description: LOA authorising Telnyx to register these numbers under the DIR. responses: '201': description: Bulk-add response. Inspect both `added` and `errors`. content: application/json: schema: $ref: '#/components/schemas/PhoneNumberBulkResponse' default: $ref: '#/components/responses/branded-calling_GenericErrorResponse' 4XX: $ref: '#/components/responses/branded-calling_GenericErrorResponse' components: parameters: DirId: name: dir_id in: path description: The DIR id. Lowercase UUID. required: true schema: type: string format: uuid example: 16635d38-75a6-4481-82e8-69af60e05011 BcPageNumber: name: page[number] in: query description: 1-based page number. Out-of-range values return an empty page with correct meta. required: false schema: type: integer minimum: 1 default: 1 example: 1 BcPageSize: name: page[size] in: query description: Items per page. Maximum 250; values above are clamped to 250. required: false schema: type: integer minimum: 1 maximum: 250 default: 20 example: 20 schemas: DirPhoneNumber: type: object properties: id: type: string format: uuid example: 1f56eb76-4078-4af7-ad4d-564b027256ee readOnly: true dir_id: type: string format: uuid example: 16635d38-75a6-4481-82e8-69af60e05011 enterprise_id: type: string format: uuid example: 4a6192a4-573d-446d-b3ce-aff9117272a6 phone_number: type: string description: E.164 with leading `+`. example: '+19493253498' batch_id: type: string format: uuid nullable: true description: Id of the batch this number was vetted as part of. example: 0a4b1f5e-2f12-4c0c-9a98-9b3a7d8b8e62 loa_document_id: type: string format: uuid nullable: true description: Id of the Letter of Authorization document attached to this number's batch. example: null status: $ref: '#/components/schemas/PhoneNumberStatus' rejection_reason: $ref: '#/components/schemas/RejectionReason' nullable: true description: Populated when `status` is `unsuccessful` or `permanently_rejected`. created_at: type: string format: date-time example: '2026-04-26T18:11:42.850928Z' readOnly: true updated_at: type: string format: date-time example: '2026-04-26T18:12:11.123456Z' readOnly: true verified_at: type: string format: date-time nullable: true example: '2026-04-26T18:12:11.123456Z' readOnly: true RejectionReason: type: object properties: code: type: string example: documentation_incomplete title: type: string example: Documentation incomplete detail: type: string example: Provided documents do not establish business identity. message: type: string nullable: true description: Customer-visible free-text comment from the Telnyx vetting team. Only the first entry of `rejection_reasons` carries this; the rest are `null`. example: Please re-upload a clearer scan of the certificate. PhoneNumberBulkDeleteResponse: type: object description: Bulk-delete partial-success response. `data` is the list of phone numbers that were soft-deleted. `meta.errors` holds per-number failures (e.g. number not associated with this DIR). When EVERY number in the request fails, the endpoint instead returns 400 with the canonical Telnyx error envelope and `data`/`meta` are absent. required: - data - meta properties: data: type: array items: type: string example: '+19493253498' description: Phone numbers that were successfully soft-deleted. Bare E.164 strings. meta: type: object required: - errors properties: errors: type: array items: $ref: '#/components/schemas/PhoneNumberItemError' description: Per-number failures that did not block the call. Each entry has `phone_number`, `code`, `title`, `detail`. branded-calling_PaginationMeta: type: object required: - total_pages - total_results - page_number - page_size properties: total_pages: type: integer example: 3 description: Total number of pages available given the current `page_size`. total_results: type: integer example: 42 description: Total number of items across all pages (excludes soft-deleted rows). page_number: type: integer example: 1 description: 1-based index of this page. Echoes the `page[number]` query parameter (default `1`). page_size: type: integer example: 20 description: Number of items returned in this page's `data` array. Capped at 250. description: 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. PhoneNumberItemError: type: object description: Per-number error returned by the bulk-delete endpoint. Bulk-add does not use this shape - it returns a 400 with the canonical envelope grouping numbers by failure category. required: - phone_number - code - title - detail properties: phone_number: type: string example: '+19493253498' code: type: string enum: - not_associated description: Stable per-number error code. Currently only `not_associated` is emitted, when the number is not attached to this DIR. example: not_associated title: type: string example: Phone number not associated detail: type: string example: Phone number not associated with this DIR. PhoneNumberBulkResponse: type: object description: Bulk-add success response (HTTP 201). All numbers in the request were accepted into a single new batch. Every entry in `data` shares the same `batch_id` - read it from any element to obtain the batch id for subsequent `GET .../phone_number_batches/{batch_id}` calls. If any number in the request fails (schema-invalid, not in inventory, already attached to another DIR, etc.) the entire request is rejected with HTTP 400 and the canonical Telnyx error envelope; the success body described here is therefore an all-or-nothing payload. required: - data properties: data: type: array description: Phone numbers accepted into the new batch. List order mirrors the request order. Each element shares the same `batch_id`. items: $ref: '#/components/schemas/DirPhoneNumber' BulkAddPhoneNumbersRequest: type: object required: - phone_numbers - documents additionalProperties: false properties: phone_numbers: type: array items: type: string example: '+19493253498' minItems: 1 maxItems: 15 description: 1–15 phone numbers in E.164 format. 10-digit US numbers are auto-prefixed with `1`. documents: type: array items: $ref: '#/components/schemas/Document' minItems: 1 maxItems: 20 description: 'Supporting documents covering this batch. At least one entry with `document_type: letter_of_authorization` is required - the LOA authorises Telnyx to register these numbers under the DIR. Each `document_id` must come from the Telnyx Documents API. Additional document types (e.g. business registration) may be included alongside the LOA.' PhoneNumberList: type: object required: - data - meta properties: data: type: array items: $ref: '#/components/schemas/DirPhoneNumber' meta: $ref: '#/components/schemas/branded-calling_PaginationMeta' BulkDeletePhoneNumbersRequest: type: object required: - phone_numbers additionalProperties: false properties: phone_numbers: type: array items: type: string example: '+19493253498' minItems: 1 maxItems: 100 description: The phone numbers to remove from this brand, in E.164 format, up to 100 per request. They must currently be attached to this brand. Document: type: object required: - document_id - document_type properties: document_id: type: string format: uuid description: Id returned by the Telnyx Documents API after you upload the file (upload via `POST /v2/documents`; see https://developers.telnyx.com/api/documents). example: 2a7e8337-e803-4057-a4ae-26c40eb0bc6c document_type: type: string enum: - letter_of_authorization - business_registration - articles_of_incorporation - tax_document - ein_letter - trademark_registration - website_ownership - business_license - professional_license - government_id - utility_bill - bank_statement - other example: business_registration description: Type of supporting document. Pick the closest match to what the file actually contains; `other` triggers manual vetting and may slow approval. The matching short_name reference list is at `GET /v2/dir/document_types`. description: type: string maxLength: 255 description: An optional note describing this document, for example what it proves. example: Certificate of incorporation. PhoneNumberStatus: type: string enum: - submitted - in_review - verified - unsuccessful - suspended - expired - permanently_rejected description: 'Phone-number lifecycle status. - `submitted` / `in_review` - Telnyx is reviewing the batch this number belongs to. - `verified` - approved; the DIR''s display identity will be shown on outbound calls from this number. - `unsuccessful` - Telnyx rejected this submission; the customer may re-add to retry. - `suspended` - temporarily disabled (e.g. by an active infringement claim on the DIR). - `expired` - verification expired; re-add to renew. - `permanently_rejected` - terminal; cannot be re-added on this or any other DIR you own.' branded-calling_Errors: type: object required: - errors properties: errors: type: array items: $ref: '#/components/schemas/branded-calling_Error' description: List of one or more error entries. Order is not significant. description: Canonical Telnyx error envelope. Returned on every 4xx and 5xx response from this service. `errors` is non-empty; multiple entries indicate multiple distinct problems with the same request (e.g. one entry per invalid phone number on a bulk operation). branded-calling_Error: type: object required: - code - title - detail - meta properties: code: type: string example: '10005' description: Stable numeric Telnyx error catalog id. See `meta.url` for the full catalog entry. title: type: string example: Invalid parameters description: Short human-readable category, e.g. `Bad Request`, `Duplicate resource`, `Not Found`, `Forbidden`. Treat as advisory only - the stable identifier is `code`. detail: type: string example: field required description: Context-specific message describing what went wrong on this particular request. May embed offending values; do not rely on it for programmatic matching - branch on `code`. meta: type: object required: - url properties: url: type: string format: uri example: https://developers.telnyx.com/docs/overview/errors/10005 pending_check_ids: type: array items: type: string format: uuid description: Set on `422 vetting_checks_incomplete` responses from `/admin/dir/{id}/approve` and `/admin/phone-number-batches/approve`. Lists the still-pending vetting check ids. pending_check_codes: type: array items: type: string description: Codes of the pending vetting checks (e.g. `loa_signature_valid`). pending_check_labels: type: array items: type: string description: Human-readable labels of the pending vetting checks. description: Carries `url` linking to the Telnyx error catalog entry for this `code`. Useful for forwarding the user to documentation. source: type: object description: Optional pointer at the offending field of the request. properties: pointer: type: string example: /body/legal_name parameter: type: string example: page[size] description: A single entry in the canonical Telnyx error envelope. `code` is the stable Telnyx error catalog id; the human-readable explanation lives at `meta.url`. `detail` is a context-specific message; `source.pointer` (when present) names the offending field of the request. responses: branded-calling_GenericErrorResponse: description: An error occurred. The response carries the standard Telnyx error envelope. content: application/json: schema: $ref: '#/components/schemas/branded-calling_Errors' examples: validation_error: summary: 422 - request body failed validation value: errors: - code: '10005' title: Invalid parameters detail: field required meta: url: https://developers.telnyx.com/docs/overview/errors/10005 source: pointer: /body/legal_name bad_request: summary: 400 - request rejected by a state guard description: Returned when the request itself is well-formed but the resource is in a state that disallows this action (e.g. updating a DIR while it is being vetted, or deleting an enterprise that still has DIRs in vetting). value: errors: - code: '10015' title: Bad Request detail: Cannot update DIR in 'verified' status meta: url: https://developers.telnyx.com/docs/overview/errors/10015 not_found: summary: 404 - resource does not exist or is not yours value: errors: - code: '10009' title: Resource not found detail: Enterprise not found. meta: url: https://developers.telnyx.com/docs/overview/errors/10009 conflict: summary: 409 - request conflicts with current resource state value: errors: - code: '10021' title: Resource in use detail: DIR has 1 active infringement claim(s). Resolve the claim before making this change. meta: url: https://developers.telnyx.com/docs/overview/errors/10021 securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: API key description: 'Telnyx API key supplied as `Authorization: Bearer `. In production, auth may be validated by the API gateway and forwarded via Telnyx auth headers.' Payment: type: apiKey in: header name: Authorization description: 'Machine Payment Protocol credential used on paid retries, sent as `Authorization: Payment ...`. Obtained by paying a challenge returned in the `WWW-Authenticate` header of a 402 response. This is not a Telnyx API key; initial challenge requests use standard bearer authentication instead.' agent-memory_bearerAuth: type: http scheme: bearer description: Telnyx API key bearerAuth: type: http scheme: bearer branded-calling_bearerAuth: type: http scheme: bearer description: Telnyx API key. Generate one at https://portal.telnyx.com/#/app/api-keys. collections_bearerAuth: type: http scheme: bearer description: Telnyx API key. Collections and results are automatically scoped to the authenticated user's organization. number-reputation_bearerAuth: type: http scheme: bearer description: Telnyx API key. Generate one at https://portal.telnyx.com/#/app/api-keys. oauthClientAuth: type: oauth2 flows: clientCredentials: tokenUrl: https://api.telnyx.com/v2/oauth/token scopes: admin: Administrative access to Telnyx resources authorizationCode: authorizationUrl: https://api.telnyx.com/v2/oauth/authorize tokenUrl: https://api.telnyx.com/v2/oauth/token refreshUrl: https://api.telnyx.com/v2/oauth/token scopes: admin: Administrative access to Telnyx resources description: OAuth 2.0 authentication for Telnyx API and MCP integrations outbound-voice-profiles_bearerAuth: type: http scheme: bearer bearerFormat: JWT pronunciation-dicts_bearerAuth: type: http scheme: bearer description: Telnyx API v2 key. Obtain from https://portal.telnyx.com rcs-registration_bearerAuth: type: http scheme: bearer bearerFormat: API key stored-payment-transactions_bearerAuth: type: http scheme: bearer bearerFormat: JWT transcriptions-search_bearerAuth: type: http scheme: bearer description: Telnyx API key. Results are automatically scoped to the authenticated user's organization. web-search_bearerAuth: type: http scheme: bearer description: Telnyx API key x-service-info: categories: - communication - developer-tools docs: apiReference: https://developers.telnyx.com homepage: https://telnyx.com llms: https://telnyx.com/llms.txt