Phone Numbers

Overview

This endpoint retrieves a list of phone numbers associated with the authenticated user’s company.

Endpoint Details

  • URL: /phone_number
  • Method: GET
  • Authentication: Required ( API KEY )

Request Headers

HeaderValueDescription
AuthorizationBearer <api_key>Your API KEY

Example Request

    Response

    Success Response

    • Status Code: 200 OK
    {
      "status": "ok",
      "message": "ok",
      "data": [
        {
          "nickname": "Support Line",
          "phone_number": "+1234567890",
          "number_country_code": "US",
          "created_at": "2023-10-01T12:00:00",
          "updated_at": "2023-10-01T12:00:00"
        },
        {
          "nickname": "Sales Hotline",
          "phone_number": "+9876543210",
          "number_country_code": null,
          "created_at": "2023-09-01T10:30:00",
          "updated_at": "2023-09-15T14:45:00"
        }
      ]
    }
    
    

    Error Response

    • Status Code: 200 OK (with error message)
    When an error occurs in your endpoint, the server responds with an HTTP status code of 200 OK. However, the response body contains an error message in a structured format to indicate that something went wrong. This approach is sometimes used to standardize API responses, even for errors.
    {
      "status": "error",
      "message": "error",
      "data": ""
    }
    

    Response Fields

    Each object in the data array represents a phone number and has the following structure:
    FieldTypeDescription
    nicknamestringA nickname or label for the phone number.
    phone_numberstringThe actual phone number in E.164 format.
    number_country_codestring (nullable)The country code for the phone number, if applicable.
    created_atstringTimestamp when the phone number was created (in YYYY-MM-DDTHH:MM:SS format).
    updated_atstringTimestamp when the phone number was last updated (in YYYY-MM-DDTHH:MM:SS format).