Update an Inbound Route

Updates an existing inbound route record. Please see Create an Inbound Routes to review the route values that you can associate with your Flowroute phone numbers.

Endpoint

PATCH /routes/:id

Path Parameter

  • id
    integer required

    The record id of the route record to update.

Body Parameters

  • data
    required

    Data object composed of the following:

    • type
      required

      This will always be route.

    • attributes
      required

      Object composed of the following route attributes:

      • alias

        Unique friendly name for the inbound route to be created.

      • route_type

        Indicates the type of route: host, number, uri.

      • value
      • Value of the route, dependent on the route_type:

        • If host, the value must be an IP address or URL
          with an optional port number. For example, an IP address could be 24.239.23.40:5060 or a URL could be myphone.com. If no port is specified, the server will attempt to use DNS SRV records.

        • If number, the value must be an 11-digit number in E.164 format. e.g.,16476998778.

        • Ifuri, the value must be formatted as protocol:user@domain[:port][;transport=<tcp/udp>.

          For example, sip:alice@atlanta.com, sip:16476998778@215.122.69.152:5060;transport=tcp, or sips:securecall@securedserver.com.

      • edge_strategy_id

        The PoP to receive traffic from. See the section on PoPs for more information.

Response Fields

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

  • data
    object

    Route object composed of the following:

    • attributes
      object

      Object composed of attributes described above.

    • id
      integer

      ID of the newly created route object.

    • links
      object

      Links object pointing to the route's URI. For example, https://api.flowroute.com/v2/routes/98396.

    • type
      string

      This will always be route.

  • links
    object

    Links object pointing to your newly created route. For example, https://api.flowroute.com/v2/routes/98396.

Example Request

PATCH /v2/routes/33443 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": {
    "type": "route",
    "attributes": {
      "route_type": "host",
      "value": "www.getouttahere.com",
      "alias": "new_route_5000",
      "edge_strategy_id": "4"
    }
  }
}

                        

Example Request

curl https://api.flowroute.com/v2/routes/33453 -X PATCH -u accessKey:secretKey \
 -d '{"data": {"type":"route", "attributes": {"route_type": "host", "value": "www.getouttahere.com", "alias":"new_route_5000", "edge_strategy_id": "4"}}}' \
-H 'Content-Type':'application/vnd+api.json'

                        

Example Responses

200 OK


{
  "data": {
    "attributes": {
      "alias": "new_route_5000",
      "route_type": "host",
      "value": "www.getouttahere.com",
      "edge_strategy_id": 4
    },
    "id": "33443",
    "links": {
      "self": "https://api.flowroute.com/routes/33443"
    },
    "type": "route"
  },
  "links": {
    "self": "https://api.flowroute.com/routes/33443"
  }
}

            

422 UNPROCESSABLE ENTITY

{
  "errors": [
    {
      "detail": "Invalid host: 123",
      "id": "f3a378a2-60ac-42d6-8915-bbd5cf2229bf",
      "status": 422
    }
  ]
}