Specify Primary Voice Route for a Phone Number

Specifies the primary voice route record to for a phone number. You must create the route first by following Create an Inbound Route. You can then assign the created route by specifying its value in a PATCH request.

Endpoint

PATCH /numbers/:id/relationships/primary_route

Path Parameter

  • number_id
    string REQUIRED

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

Body Parameters

  • type
    string REQUIRED

    Object type of the data that you are updating the phone number with. This will always be "route".

  • route_id
    string REQUIRED

    ID of the primary voice route to be assigned to the phone number that you are updating.

Response

On success, the HTTP status code in the response header is 204 NO CONTENT which means that the server successfully processed the request and is not returning any content. 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/12013451234/relationships/primary_route HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
  "data": {
    "type": "route",
    "id": "1234"
  }
}

                        

Example Request

curl https://api.flowroute.com/v2/numbers/12013451234/relationships/primary_route -X PATCH \
-u accessKey:secretKey -H 'Content-Type':'application/vnd.api+json' -d \
'{ "data": { "type":"route", "id":"1234" } }' 

                        

Example Responses

204 NO CONTENT (Success)

401 Unauthorized

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

                

403 Forbidden

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