Update Details for a Phone Number

Allows you to update the Alias or CNAM Lookup parameters for your long code or toll-free phone number.

Endpoint

PATCH /numbers/:id

Request Parameters

Path Parameter

  • id
    string REQUIRED

    The phone number to which the alias will be assigned. This number must be in 11-digit North American format. e.g. 12065551234.

Body Parameters

  • type
    string REQUIRED

    Type of the data object to be updated. This will always be number.

  • alias
    string

    Nonunique friendly name to be assigned to the phone number.

  • cnam_lookups_enabled
    boolean

    Enable or Disable CNAM Lookups on inbound calls.

Response

On success, the HTTP status code in the response header is 200 OK and the response body contains the updated phone number object in JSON format. On error, the header status code is an error code and the response body contains an array of error objects.


Example Request

PATCH /v2/numbers/16463451234 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
    "type": "number",
    "alias": "NYC Number"
}

                        

Example Request

curl https://api.flowroute.com/v2/numbers/16463451234 -X PATCH \
-u accessKey:secretKey -H 'Content-Type':'application/vnd.api+json' -d \
'{"type":"number", "alias":"NYC Number"}' 

                        

Example Responses

200 OK

{
  "data": {
    "attributes": {
      "alias": "My NYC number",
      "cnam_lookups_enabled": true,
      "number_type": "longcode",
      "rate_center": "nwyrcyzn01",
      "state": "ny",
      "value": "16463451234"
    },
    "id": "16463451234",
    "links": {
      "self": "https://api.flowroute.com/v2/numbers/16463451234"
    },
    "relationships": {
      "cnam_preset": {
        "data": null
      },
      "e911_address": {
        "data": null
      },
      "failover_route": {
        "data": null
      },
      "primary_route": {
        "data": {
          "id": "0",
          "type": "route"
        }
      }
    },
    "type": "number"
  },
  "included": [
    {
      "attributes": {
        "alias": "sip-reg",
        "route_type": "sip-reg",
        "value": null
      },
      "id": "0",
      "links": {
        "self": "https://api.flowroute.com/v2/routes/0"
      },
      "type": "route"
    }
  ],
  "links": {
    "self": "https://api.flowroute.com/v2/numbers/16463451234"
  }
}

        

401 Unauthorized

{
  "errors": [
    {
      "detail": "Authentication failed.",
      "id": "7fc8c70a-ca58-430c-b383-b89df84f8083",
      "status": 401,
      "title": "Unauthorized"
    }
  ]
}

                

403 Forbidden

{  "errors": 
  [
    {
      "status": 403, 
      "detail": "", 
      "title": "ActionNotAuthorizedError"
    }
  ]
}