# Porting history

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/porting-history/{phone}:
    get:
      summary: Porting history
      deprecated: false
      description: |-
        :::info
        This endpoint costs €0.02 per lookup
        :::
        This endpoint allows you to see all past porting dates of a phone number
      tags:
        - Fraud prevention
      parameters:
        - name: phone
          in: path
          description: Phone number to lookup
          required: true
          example: 18179208058
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  porting_history:
                    type: array
                    items:
                      type: object
                      properties:
                        action:
                          type: string
                          description: Type of porting action
                          enum:
                            - A
                            - D
                            - C
                            - P
                            - R
                          x-apidog-enum:
                            - value: A
                              name: Addition
                              description: Number added to network
                            - value: D
                              name: Deletion
                              description: Number removed from network
                            - value: C
                              name: Change
                              description: Network details changed
                            - value: P
                              name: Port
                              description: Number ported between networks
                            - value: R
                              name: Return
                              description: Number returned to original network
                        tmtnetwork:
                          type: integer
                          description: Unique identifier on our network
                        i_type:
                          type: string
                          description: Network type identifier
                          enum:
                            - m
                            - f
                            - v
                            - o
                          x-apidog-enum:
                            - value: m
                              name: Mobile network operator
                              description: ''
                            - value: f
                              name: Fixed/landline network
                              description: ''
                            - value: v
                              name: VoIP provider
                              description: ''
                            - value: o
                              name: Other network type
                              description: ''
                        ts:
                          type: string
                          description: Timestamp of the event in ISO 8601 format
                      required:
                        - action
                        - tmtnetwork
                        - i_type
                        - ts
                      x-apidog-orders:
                        - action
                        - tmtnetwork
                        - i_type
                        - ts
                  ported:
                    type: boolean
                    description: Ported or not
                  ported_date:
                    type: string
                    description: Ported date
                  ported_date_type:
                    type: string
                    description: Ported date type
                  status:
                    type: string
                    description: Request status
                    enum:
                      - success
                      - error
                  status_message:
                    type: string
                    description: Status message
                required:
                  - porting_history
                  - ported
                  - ported_date
                  - ported_date_type
                  - status
                  - status_message
                x-apidog-orders:
                  - porting_history
                  - ported
                  - ported_date
                  - ported_date_type
                  - status
                  - status_message
                x-apidog-refs: {}
              example:
                porting_history:
                  - action: A
                    tmtnetwork: 150537
                    i_type: f
                    ts: '2020-07-29T00:00:00'
                  - action: A
                    tmtnetwork: 150537
                    i_type: f
                    ts: '2019-03-13T00:00:00'
                  - action: A
                    tmtnetwork: 152692
                    i_type: f
                    ts: '2018-12-10T00:00:00'
          headers: {}
          x-apidog-name: OK
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                x-apidog-orders:
                  - error
              example:
                error: Missing API key
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  status:
                    type: string
                required:
                  - message
                  - status
                x-apidog-orders:
                  - message
                  - status
              example:
                message: 'Error: Invalid Number'
                status: error
          headers: {}
          x-apidog-name: Server Error
      security:
        - CallerAPI Key: []
          x-apidog:
            schemeGroups:
              - id: 7Wgpz7XqJ5wdLyzsKr91e
                schemeIds:
                  - CallerAPI Key
            required: true
            use:
              id: 7Wgpz7XqJ5wdLyzsKr91e
      x-apidog-folder: Fraud prevention
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1027392/apis/api-20035134-run
components:
  schemas: {}
  securitySchemes:
    CallerAPI Key:
      type: apikey
      in: header
      name: x-auth
    ApiKeyAuth:
      type: apikey
      in: header
      name: X-Auth
      description: CallerAPI API key (UUID).
servers:
  - url: https://api.callerapi.com
    description: Prod Env
security:
  - CallerAPI Key: []
    x-apidog:
      schemeGroups:
        - id: 7Wgpz7XqJ5wdLyzsKr91e
          schemeIds:
            - CallerAPI Key
      required: true
      use:
        id: 7Wgpz7XqJ5wdLyzsKr91e

```
