openapi: 3.1.0
info:
  title: Brand API - Phone Numbers
  description: API for retrieving phone numbers available for use with impact.com's native call tracking solution.
  version: v12
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/PhoneNumbers:
    get:
      summary: List All Phone Numbers
      description: Returns a list of all phone numbers available to your account, with optional filtering.
      operationId: listPhoneNumbers
      tags:
      - Phone Numbers
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: Id
        in: query
        schema:
          type: string
        description: A comma-separated list of specific Phone Number IDs to retrieve.
      - name: LastDateAssigned
        in: query
        schema:
          type: string
          format: date-time
        description: Filter for numbers last assigned on a specific date (ISO 8601).
      - name: LastDateReleased
        in: query
        schema:
          type: string
          format: date-time
        description: Filter for numbers last released on a specific date (ISO 8601).
      - name: Number
        in: query
        schema:
          type: string
        description: A comma-separated list of specific phone numbers to retrieve.
      responses:
        '200':
          description: A list of phone number objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  PhoneNumbers:
                    type: array
                    description: The list of phone number objects.
                    items:
                      $ref: '#/components/schemas/PhoneNumber'
  /Advertisers/{AccountSID}/PhoneNumbers/{PhoneNumberId}:
    get:
      summary: Retrieve a Phone Number
      description: Retrieves the details of a single phone number by its unique ID.
      operationId: getPhoneNumberById
      tags:
      - Phone Numbers
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: PhoneNumberId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the phone number.
      responses:
        '200':
          description: A single phone number object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    PhoneNumber:
      type: object
      properties:
        Id:
          type: integer
          description: Unique identifier for the phone number (Phone Number ID).
          example: 12345
        Country:
          type: string
          description: Two-letter country code (ISO 3166).
          example: US
        Number:
          type: string
          description: The full phone number.
          example: '8051234567'
        InternationalNumber:
          type: string
          description: The full phone number with the international prefix.
          example: +1 805 123 4567
        DateCreated:
          type: string
          format: date-time
          nullable: true
          description: The date and time the phone number was created.
          example: '2026-01-15T10:00:00-08:00'
        LastDateAssigned:
          type: string
          format: date-time
          nullable: true
          description: The date and time the phone number was last assigned to a partner.
          example: '2026-02-01T10:00:00-08:00'
        LastDateReleased:
          type: string
          format: date-time
          nullable: true
          description: The date and time the phone number was last released from a partner.
          example: '2026-03-15T10:00:00-08:00'
        Uri:
          type: string
          format: uri-reference
          description: The URI path to this phone number object.
          example: /Advertisers/<AccountSID>/PhoneNumbers/12345
