Telnyx Number Portout API

Number portout operations

OpenAPI Specification

telnyx-number-portout-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: Telnyx provides global communications and connectivity APIs for developers — including SIP trunking, programmable voice, SMS, MMS, WhatsApp Business Messaging, Call Control, Fax, Wireless (IoT & eSIM), Phone Numbers (DID provisioning & porting), Emergency Services, and Network APIs for private interconnects and edge connectivity. Build, scale, and manage voice, messaging, and data networks with Telnyx's carrier-grade global infrastructure and API-first platform.
  title: Telnyx Access Tokens Number Portout API
  version: 2.0.0
  x-endpoint-cost: light
servers:
- description: Version 2.0.0 of the Telnyx API
  url: https://api.telnyx.com/v2
security:
- bearerAuth: []
tags:
- description: Number portout operations
  name: Number Portout
paths:
  /portouts:
    get:
      description: Returns the portout requests according to filters
      operationId: ListPortoutRequest
      parameters:
      - $ref: '#/components/parameters/PageConsolidated'
      - description: 'Consolidated filter parameter (deepObject style). Originally: filter[carrier_name], filter[country_code], filter[country_code_in], filter[foc_date], filter[inserted_at], filter[phone_number], filter[pon], filter[ported_out_at], filter[spid], filter[status], filter[status_in], filter[support_key]'
        explode: true
        in: query
        name: filter
        schema:
          properties:
            carrier_name:
              description: Filter by new carrier name.
              type: string
            country_code:
              description: Filter by 2-letter country code
              example: US
              type: string
            country_code_in:
              description: Filter by a list of 2-letter country codes
              example:
              - CA
              - US
              items:
                type: string
              type: array
            foc_date:
              description: Filter by foc_date. Matches all portouts with the same date
              example: '2024-09-04T00:00:00.000Z'
              format: date-time
              type: string
            inserted_at:
              description: Filter by inserted_at date range using nested operations
              properties:
                gte:
                  description: Filter by inserted_at date greater than or equal.
                  example: '2024-09-04T00:00:00.000Z'
                  format: date-time
                  type: string
                lte:
                  description: Filter by inserted_at date less than or equal.
                  example: '2024-09-04T00:00:00.000Z'
                  format: date-time
                  type: string
              type: object
            phone_number:
              description: Filter by a phone number on the portout. Matches all portouts with the phone number
              example: '+13035551212'
              type: string
            pon:
              description: Filter by Port Order Number (PON).
              type: string
            ported_out_at:
              description: Filter by ported_out_at date range using nested operations
              properties:
                gte:
                  description: Filter by ported_out_at date greater than or equal.
                  example: '2024-09-04T00:00:00.000Z'
                  format: date-time
                  type: string
                lte:
                  description: Filter by ported_out_at date less than or equal.
                  example: '2024-09-04T00:00:00.000Z'
                  format: date-time
                  type: string
              type: object
            spid:
              description: Filter by new carrier spid.
              type: string
            status:
              description: Filter by portout status.
              enum:
              - pending
              - authorized
              - ported
              - rejected
              - rejected-pending
              - canceled
              type: string
            status_in:
              description: Filter by a list of portout statuses
              items:
                enum:
                - pending
                - authorized
                - ported
                - rejected
                - rejected-pending
                - canceled
                type: string
              type: array
            support_key:
              description: Filter by the portout's support_key
              example: PO_abc123
              type: string
          type: object
        style: deepObject
      responses:
        '200':
          $ref: '#/components/responses/ListPortoutResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
      summary: List portout requests
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/events:
    get:
      description: Returns a list of all port-out events.
      operationId: listPortoutEvents
      parameters:
      - $ref: '#/components/parameters/PageConsolidated'
      - description: 'Consolidated filter parameter (deepObject style). Originally: filter[event_type], filter[portout_id], filter[created_at]'
        explode: true
        in: query
        name: filter
        schema:
          properties:
            created_at:
              description: Filter by created_at date range using nested operations
              properties:
                gte:
                  description: Filter by created at greater than or equal to.
                  example: '2021-01-01T00:00:00Z'
                  format: date-time
                  type: string
                lte:
                  description: Filter by created at less than or equal to.
                  example: '2021-01-01T00:00:00Z'
                  format: date-time
                  type: string
              type: object
            event_type:
              description: Filter by event type.
              enum:
              - portout.status_changed
              - portout.new_comment
              - portout.foc_date_changed
              example: portout.status_changed
              type: string
            portout_id:
              description: Filter by port-out order ID.
              example: 34dc46a9-53ed-4e01-9454-26227ea13326
              format: uuid
              type: string
          type: object
        style: deepObject
      responses:
        '200':
          $ref: '#/components/responses/ListPortoutEventsResponse'
        '422':
          description: Unprocessable entity. Check message field in response for details.
        '500':
          description: Internal server error
      summary: List all port-out events
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/events/{id}:
    get:
      description: Show a specific port-out event.
      operationId: showPortoutEvent
      parameters:
      - description: Identifies the port-out event.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          $ref: '#/components/responses/ShowPortoutEventResponse'
        '404':
          description: Not found
        '500':
          description: Internal server error
      summary: Show a port-out event
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/events/{id}/republish:
    post:
      description: Republish a specific port-out event.
      operationId: republishPortoutEvent
      parameters:
      - description: Identifies the port-out event.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          description: No content
        '404':
          description: Not found
        '500':
          description: Internal server error
      summary: Republish a port-out event
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/rejections/{portout_id}:
    get:
      description: Given a port-out ID, list rejection codes that are eligible for that port-out
      operationId: ListPortoutRejections
      parameters:
      - description: Identifies a port out order.
        in: path
        name: portout_id
        required: true
        schema:
          example: 329d6658-8f93-405d-862f-648776e8afd7
          type: string
      - description: 'Consolidated filter parameter (deepObject style). Originally: filter[code], filter[code][in]'
        explode: true
        in: query
        name: filter
        schema:
          properties:
            code:
              oneOf:
              - description: Filter rejections of a specific code
                example: 1002
                type: integer
              - description: Filter rejections in a list of codes
                example:
                - 1002
                - 1003
                items:
                  type: integer
                type: array
          type: object
        style: deepObject
      responses:
        '200':
          $ref: '#/components/responses/ListPortoutRejections'
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
        '500':
          description: Internal server error
      summary: List eligible port-out rejection codes for a specific order
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/reports:
    get:
      description: List the reports generated about port-out operations.
      operationId: ListPortoutReports
      parameters:
      - $ref: '#/components/parameters/PageConsolidated'
      - description: 'Consolidated filter parameter (deepObject style). Originally: filter[report_type], filter[status]'
        explode: true
        in: query
        name: filter
        schema:
          properties:
            report_type:
              description: Filter reports of a specific type
              enum:
              - export_portouts_csv
              example: export_portouts_csv
              type: string
            status:
              description: Filter reports of a specific status
              enum:
              - pending
              - completed
              example: completed
              type: string
          type: object
        style: deepObject
      responses:
        '200':
          $ref: '#/components/responses/ListPortoutReports'
        '422':
          description: Unprocessable entity. Check message field in response for details.
        '500':
          description: Internal server error
      summary: List port-out related reports
      tags:
      - Number Portout
      x-latency-category: responsive
    post:
      description: Generate reports about port-out operations.
      operationId: CreatePortoutReport
      requestBody:
        $ref: '#/components/requestBodies/CreatePortoutReport'
      responses:
        '201':
          $ref: '#/components/responses/CreatePortoutReport'
        '422':
          description: Unprocessable entity. Check message field in response for details.
        '500':
          description: Internal server error
      summary: Create a port-out related report
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/reports/{id}:
    get:
      description: Retrieve a specific report generated.
      operationId: GetPortoutReport
      parameters:
      - description: Identifies a report.
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          $ref: '#/components/responses/ShowPortoutReport'
        '404':
          description: Resource not found
        '500':
          description: Internal server error
      summary: Retrieve a report
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/{id}:
    get:
      description: Returns the portout request based on the ID provided
      operationId: FindPortoutRequest
      parameters:
      - description: Portout id
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          $ref: '#/components/responses/PortoutResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
      summary: Get a portout request
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/{id}/comments:
    get:
      description: Returns a list of comments for a portout request.
      operationId: FindPortoutComments
      parameters:
      - description: Portout id
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          $ref: '#/components/responses/ListPortoutComments'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
      summary: List all comments for a portout request
      tags:
      - Number Portout
      x-latency-category: responsive
    post:
      description: Creates a comment on a portout request.
      operationId: PostPortRequestComment
      parameters:
      - description: Portout id
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                body:
                  description: Comment to post on this portout request
                  type: string
              type: object
        required: true
      responses:
        '201':
          $ref: '#/components/responses/PortoutCommentResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
      summary: Create a comment on a portout request
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/{id}/supporting_documents:
    get:
      description: List every supporting documents for a portout request.
      operationId: GetPortRequestSupportingDocuments
      parameters:
      - description: Portout id
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '201':
          $ref: '#/components/responses/PortOutListSupportingDocumentsResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
      summary: List supporting documents on a portout request
      tags:
      - Number Portout
      x-latency-category: responsive
    post:
      description: Creates a list of supporting documents on a portout request.
      operationId: PostPortRequestSupportingDocuments
      parameters:
      - description: Portout id
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                documents:
                  description: List of supporting documents parameters
                  items:
                    properties:
                      document_id:
                        description: Identifies the associated document
                        example: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
                        format: uuid
                        type: string
                      type:
                        description: Identifies the type of the document
                        enum:
                        - loa
                        - invoice
                        example: loa
                        type: string
                    required:
                    - type
                    - document_id
                    type: object
                  maxItems: 10
                  minItems: 1
                  type: array
              type: object
        required: true
      responses:
        '201':
          $ref: '#/components/responses/CreatePortOutSupportingDocumentsResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
      summary: Create a list of supporting documents on a portout request
      tags:
      - Number Portout
      x-latency-category: responsive
  /portouts/{id}/{status}:
    patch:
      description: Authorize or reject portout request
      operationId: UpdatePortoutStatus
      parameters:
      - description: Portout id
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      - description: Updated portout status
        in: path
        name: status
        required: true
        schema:
          enum:
          - authorized
          - rejected-pending
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                host_messaging:
                  default: false
                  description: Indicates whether messaging services should be maintained with Telnyx after the port out completes
                  example: false
                  type: boolean
                reason:
                  description: Provide a reason if rejecting the port out request
                  example: I do not recognize this transaction
                  type: string
              required:
              - reason
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/PortoutResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity. Check message field in response for details.
      summary: Update Status
      tags:
      - Number Portout
      x-latency-category: responsive
components:
  responses:
    ListPortoutRejections:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortoutRejection'
                type: array
            type: object
      description: Successful response
    PortoutCommentResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/PortoutComment'
            type: object
      description: Portout Comment Response
    ListPortoutComments:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortoutComment'
                type: array
              meta:
                $ref: '#/components/schemas/Metadata'
            type: object
      description: Portout Comments
    ListPortoutResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortoutDetails'
                type: array
              meta:
                $ref: '#/components/schemas/Metadata'
            type: object
      description: Portout Response
    PortOutListSupportingDocumentsResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortOutSupportingDocument'
                type: array
            type: object
      description: Portout Supporting Documents
    ShowPortoutEventResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/PortoutEvent'
            type: object
      description: Successful response
    ListPortoutReports:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortoutReport'
                type: array
              meta:
                $ref: '#/components/schemas/PaginationMeta'
            type: object
      description: Successful response
    ShowPortoutReport:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/PortoutReport'
            type: object
      description: Successful response
    CreatePortOutSupportingDocumentsResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortOutSupportingDocument'
                type: array
            type: object
      description: Portout Supporting Documents
    CreatePortoutReport:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/PortoutReport'
            type: object
      description: Successful response
    ListPortoutEventsResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/PortoutEvent'
                type: array
              meta:
                $ref: '#/components/schemas/PaginationMeta'
            type: object
      description: Successful response
    PortoutResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/PortoutDetails'
            type: object
      description: Portout Response
  schemas:
    ExportPortoutsCSVReport:
      description: The parameters for generating a port-outs CSV report.
      properties:
        filters:
          description: The filters to apply to the export port-out CSV report.
          properties:
            created_at__gt:
              description: The date and time the port-out was created after.
              format: date-time
              type: string
            created_at__lt:
              description: The date and time the port-out was created before.
              format: date-time
              type: string
            customer_reference__in:
              description: The customer reference of the port-outs to include in the report.
              items:
                example: my-customer-reference
                type: string
              type: array
            end_user_name:
              description: The end user name of the port-outs to include in the report.
              example: McPortersen
              type: string
            phone_numbers__overlaps:
              description: A list of phone numbers that the port-outs phone numbers must overlap with.
              items:
                example: '+1234567890'
                type: string
              type: array
            status__in:
              description: The status of the port-outs to include in the report.
              items:
                enum:
                - pending
                - authorized
                - ported
                - rejected
                - rejected-pending
                - canceled
                type: string
              type: array
          type: object
      required:
      - filters
      type: object
    PortoutComment:
      example:
        body: This is a comment
        created_at: '2018-02-02T22:25:27.521Z'
        id: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
        portout_id: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
        record_type: portout
        user_id: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
      properties:
        body:
          description: Comment body
          example: This is a comment
          type: string
        created_at:
          description: Comment creation timestamp in ISO 8601 format
          example: '2018-02-02T22:25:27.521Z'
          type: string
        id:
          example: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
          type: string
        portout_id:
          default: null
          description: Identifies the associated port request
          example: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
          type: string
        record_type:
          description: Identifies the type of the resource.
          example: portout
          readOnly: true
          type: string
        user_id:
          description: Identifies the user who created the comment. Will be null if created by Telnyx Admin
          example: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
          type: string
      required:
      - id
      - body
      - user_id
      - created_at
      type: object
    Metadata:
      properties:
        page_number:
          description: Current Page based on pagination settings (included when defaults are used.)
          example: 3
          format: integer
          type: number
        page_size:
          description: Number of results to return per page based on pagination settings (included when defaults are used.)
          example: 1
          format: integer
          type: number
        total_pages:
          description: Total number of pages based on pagination settings
          example: 13
          format: integer
          type: number
        total_results:
          description: Total number of results
          example: 13
          format: integer
          type: number
      title: Metadata
      type: object
    PortOutSupportingDocument:
      example:
        created_at: '2018-02-02T22:25:27.521Z'
        document_id: f1c5e079-9d82-4f50-95bc-ae2f6b8d84d7
        id: 5a16902a-2ee9-4882-a247-420fc6627b62
        portout_id: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
        record_type: supporting_document
        type: loa
        updated_at: '2018-02-02T22:25:27.521Z'
      properties:
        created_at:
          description: Supporting document creation timestamp in ISO 8601 format
          example: '2018-02-02T22:25:27.521Z'
          type: string
        document_id:
          description: Identifies the associated document
          example: f1c5e079-9d82-4f50-95bc-ae2f6b8d84d7
          format: uuid
          type: string
        id:
          example: 5a16902a-2ee9-4882-a247-420fc6627b62
          format: uuid
          type: string
        portout_id:
          description: Identifies the associated port request
          example: 0ccc7b54-4df3-4bca-a65a-3da1ecc777f0
          format: uuid
          readOnly: true
          type: string
        record_type:
          description: Identifies the type of the resource.
          example: supporting_document
          readOnly: true
          type: string
        type:
          description: Identifies the type of the document
          enum:
          - loa
          - invoice
          example: loa
          readOnly: true
          type: string
        updated_at:
          description: Supporting document last changed timestamp in ISO 8601 format
          example: '2018-02-02T22:25:27.521Z'
          type: string
      required:
      - id
      - record_type
      - type
      - portout_id
      - document_id
      - created_at
      - updated_at
      type: object
    PortoutRejection:
      properties:
        code:
          example: 1002
          type: integer
        description:
          example: Invalid PIN
          type: string
        reason_required:
          example: false
          type: boolean
      type: object
    WebhookPortoutFocDateChanged:
      properties:
        available_notification_methods:
          description: Indicates the notification methods used.
          items:
            enum:
            - email
            - webhook
            type: string
          type: array
        created_at:
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527000Z'
          format: date-time
          type: string
        event_type:
          description: Identifies the event type
          enum:
          - portout.status_changed
          - portout.foc_date_changed
          - portout.new_comment
          example: portout.status_changed
          type: string
        id:
          description: Uniquely identifies the event.
          example: eef3340b-8903-4466-b445-89b697315a3a
          format: uuid
          type: string
        payload:
          description: The webhook payload for the portout.foc_date_changed event
          properties:
            foc_date:
              description: ISO 8601 formatted date indicating the new FOC date.
              example: '2021-03-19T10:07:15.527Z'
              format: date-time
              type: string
            id:
              description: Identifies the port-out order that have the FOC date changed.
              example: 96dfa9e4-c753-4fd3-97cd-42d66f26cf0c
              format: uuid
              type: string
            user_id:
              description: Identifies the organization that port-out order belongs to.
              example: 0e19c89e-f0ce-458a-a36c-3c60bc2014b1
              type: string
          type: object
        payload_status:
          description: The status of the payload generation.
          enum:
          - created
          - completed
          example: created
          type: string
        portout_id:
          description: Identifies the port-out order associated with the event.
          example: 9471c873-e3eb-4ca1-957d-f9a451334d52
          format: uuid
          type: string
        record_type:
          description: Identifies the type of the resource.
          example: portout_event
          readOnly: true
          type: string
        updated_at:
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2021-03-19T10:07:15.527000Z'
          format: date-time
          type: string
      type: object
    PortoutEvent:
      discriminator:
        mapping:
          portout.foc_date_changed: '#/components/schemas/WebhookPortoutFocDateChanged'
          portout.new_comment: '#/components/schemas/WebhookPortoutNewComment'
          portout.status_changed: '#/components/schemas/WebhookPortoutStatusChanged'
        propertyName: event_type
      oneOf:
      - $ref: '#/components/schemas/WebhookPortoutStatusChanged'
      - $ref: '#/components/schemas/WebhookPortoutNewComment'
      - $ref: '#/components/schemas/WebhookPortoutFocDateChanged'
      type: object
    WebhookPortoutStatusChanged:
      properties:
        available_notification_methods:
          description: Indicates the notification methods used.
          items:
            enum:
            - email
            - webhook
            type: string
          type: array
        created_at:
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527000Z'
          format: date-time
          type: string
        event_type:
          description: Identifies the event type
          enum:
          - portout.status_changed
          - portout.foc_date_changed
          - portout.new_comment
          example: portout.status_changed
          type: string
        id:
          description: Uniquely identifies the event.
          example: eef3340b-8903-4466-b445-89b697315a3a
          format: uuid
          type: string
        payload:
          description: The webhook payload for the portout.status_changed event
          properties:
            attempted_pin:
              description: The PIN that was attempted to be used to authorize the port out.
              example: '1234'
              type: string
            carrier_name:
              description: Carrier the number will be ported out to
              example: 

# --- truncated at 32 KB (45 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/telnyx/refs/heads/main/openapi/telnyx-number-portout-api-openapi.yml