{
  "openapi": "3.0.1",
  "info": {
    "title": "Carrier Lookup API",
    "description": "The Carrier Lookup API lets you query information about a phone number before you message or call it, including carrier name, line type (mobile, landline, or VoIP), and whether the number is currently able to send/receive messages. Running a lookup ahead of sending helps you route messages correctly, avoid delivery failures, and keep your outbound traffic compliant.\n\nThis API is subject to rate limiting. See [Rate Limits](https://api.telgorithm.com/docs/integration/rate-limits) for current quotas and details on the `RateLimit-*` response headers.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "/carrierlookup"
    }
  ],
  "paths": {
    "/v1/Numbers/{Number}": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Get Phone Number information",
        "parameters": [
          {
            "name": "Number",
            "in": "path",
            "description": "Phone Number",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID for the request",
                "schema": {
                  "type": "string",
                  "description": "Correlation ID for the request"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NumberInformationModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberInformationModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberInformationModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-Id": {
                "description": "Correlation ID for the request",
                "schema": {
                  "type": "string",
                  "description": "Correlation ID for the request"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                },
                "example": {"errors":{"Name":["The Name field is required."]},"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"detail":"Some detailed message","traceId":"|4ef17786-b103-420e-89c0-cc425ac14809.edfcbee9_"}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                },
                "example": {"errors":{"Name":["The Name field is required."]},"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"detail":"Some detailed message","traceId":"|4ef17786-b103-420e-89c0-cc425ac14809.edfcbee9_"}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                },
                "example": {"errors":{"Name":["The Name field is required."]},"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"detail":"Some detailed message","traceId":"|4ef17786-b103-420e-89c0-cc425ac14809.edfcbee9_"}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "NumberInformationModel": {
        "required": [
          "number",
          "status"
        ],
        "type": "object",
        "properties": {
          "number": {
            "minLength": 1,
            "type": "string",
            "description": "Phone Number",
            "example": "+10987654321"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PhoneMessagingStatus"
              }
            ],
            "description": "Phone Messaging Status\n<p>Possible values:</p>\n<ul>\n<li><b>Active</b>: Phone number has ability to send/recieve messages</li>\n<li><b>Inactive</b>: Phone number doesn't have ability to send/recieve messages</li>\n</ul>\n"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PhoneType"
              }
            ],
            "description": "Phone Type\n<p>Possible values:</p>\n<ul>\n<li><b>Unknown</b>: Unknown</li>\n<li><b>Wireless</b>: Wireless</li>\n<li><b>Landline</b>: Landline</li>\n<li><b>VoIP</b>: VoIP</li>\n</ul>\n"
          },
          "carrierName": {
            "type": "string",
            "description": "Carrier Name",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Phone Number information"
      },
      "PhoneMessagingStatus": {
        "enum": [
          "Active",
          "Inactive"
        ],
        "type": "string",
        "description": "Phone Messaging Status\n<p>Possible values:</p>\n<ul>\n<li><b>Active</b>: Phone number has ability to send/recieve messages</li>\n<li><b>Inactive</b>: Phone number doesn't have ability to send/recieve messages</li>\n</ul>\n"
      },
      "PhoneType": {
        "enum": [
          "Unknown",
          "Wireless",
          "Landline",
          "VoIP"
        ],
        "type": "string",
        "description": "Phone Type\n<p>Possible values:</p>\n<ul>\n<li><b>Unknown</b>: Unknown</li>\n<li><b>Wireless</b>: Wireless</li>\n<li><b>Landline</b>: Landline</li>\n<li><b>VoIP</b>: VoIP</li>\n</ul>\n",
        "example": "Wireless"
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      }
    },
    "securitySchemes": {
      "basic": {
        "type": "http",
        "description": "Basic Authorization header using the BASIC scheme. Use a pair `companySid:token` to access the API.",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basic": [ ]
    }
  ],
  "tags": [
    {
      "name": "Numbers",
      "description": "Provides information about the Phone Numbers (not necessarily the ones you've set up with Telgorithm), namely:\n<ul><li>Whether it's a mobile or a landline number</li><li>Whether the Messaging Service is enabled for a number</li><li>The Phone Number Carrier name</li></ul>"
    }
  ]
}