---
title: "Get custom route by ID"
method: GET
path: "/v1/projects/{project_id}/routes/{id}"
tags: ["Phone"]
---

# Get custom route by ID

`GET /v1/projects/{project_id}/routes/{id}`

## Request

- Base URL: `https://api.telerivet.com`
- URL: `https://api.telerivet.com/v1/projects/{project_id}/routes/{id}`
- Auth: one of:
  - HTTP basic
  - OAuth 2 (authorization code, authorization URL `https://telerivet.com/oauth/authorize`, token URL `https://api.telerivet.com/oauth/token`)

Gets a custom route by ID

## Path parameters

- `project_id` string, required
- `id` string, required

## Response `200`

Successful response

- Route: Represents a custom route that can be used to send messages via one or more basic routes (phones). Custom Routes were formerly referred to simply as "Routes" within Telerivet. API methods, parameters, and properties related to Custom Routes continue to use the term "Route" to maintain backwards compatibility.
  - `id` string: Telerivet's internal ID for the route
  - `name` string: The name of the route
  - `vars` object: Custom variables stored for this route. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _. Values may be strings, numbers, or boolean (true/false). String values may be up to 4096 bytes in length when encoded as UTF-8. Up to 100 variables are supported per object. Setting a variable to null will delete the variable.
  - `url` string: URL to this route in the Telerivet web app
  - `project_id` string: ID of the project this route belongs to
  - `actions` RoutingAction[]: Array of routing action objects. Allowed action types: `use_phone`, `condition`.
    - union: A routing action for custom routes. Only `use_phone` and `condition` action types are supported.
      - object: Within a custom route, selects one or more basic routes that can be used to send the message.
        - `type` 'use_phone', required: Action type identifier
        - `phone_ids` string[], required: Array of basic route IDs that can be used to send the message
      - object: A rule that only matches if a certain condition is true (e.g. the message has a particular keyword or sender). Always combined with one or more other rules. "If ... then ..." rules can use the following types of conditions: * is * is not * has word * does not have word * contains * does not contain * starts with * does not start with * ends with * does not end with * alphabetically before * alphabetically after * equals * does not equal * less than * greater than * less than or equal to * greater than or equal to * contact is in group * contact is not in group A single "If ... then ..." rule can contain multiple conditions, joined together with either 'and' or 'or'.
        - `type` 'condition', required: Action type identifier
        - `conditions` object[]: Array of condition objects. Required unless <code>if_mode</code> is <code>else</code>.
          - `type` string, required: Condition type. Values: <code>is</code>, <code>is_not</code>, <code>has_word</code>, <code>does_not_have_word</code>, <code>contains</code>, <code>does_not_contain</code>, <code>starts_with</code>, <code>does_not_start_with</code>, <code>ends_with</code>, <code>does_not_end_with</code>, <code>alpha_before</code>, <code>alpha_after</code>, <code>equals</code>, <code>does_not_equal</code>, <code>less_than</code>, <code>greater_than</code>, <code>less_or_equal</code>, <code>greater_or_equal</code>, <code>contact_is_in_group</code>, <code>contact_not_in_group</code>.
          - `variable` string, required: Variable to test, e.g. <code>[[word1]]</code>, <code>[[contact.name]]</code>. Not required for <code>contact_is_in_group</code> and <code>contact_not_in_group</code> conditions.
          - `value` string, required: Value to compare against (or group name for group membership conditions).
        - `actions` Action[], required: Array of actions to execute if the conditions match.
          - union: An action in a Custom Actions service. The `type` property determines which action is performed and what additional properties are available. See [Rules Engine Actions](/api/rules_engine#actions) for detailed documentation.
            - object: Adds the current contact to a group. If the group doesn't exist yet, Telerivet will create it. If you want to add a contact other than the one who sent the message, add a "Use another contact" rule before this rule.
              - …
            - object: Adds a label to the current message. This makes it easy to segment certain types of messages on your Messages page.
              - …
            - object: Blocks the current contact.
              - …
            - object: Sends a voice call to the current contact using a specified IVR service.
              - …
            - object: Cancels all scheduled messages to the current contact. Note this doesn't cancel messages that are scheduled to an entire group. In this case, the contact would need to be removed from the group in order to cancel the message.
              - …
            - object: A rule that only matches if a certain condition is true (e.g. the message has a particular keyword or sender). Always combined with one or more other rules. "If ... then ..." rules can use the following types of conditions: * is * is not * has word * does not have word * contains * does not contain * starts with * does not start with * ends with * does not end with * alphabetically before * alphabetically after * equals * does not equal * less than * greater than * less than or equal to * greater than or equal to * contact is in group * contact is not in group A single "If ... then ..." rule can contain multiple conditions, joined together with either 'and' or 'or'.
              - …
            - object: Copies the current incoming message to another project within the same organization. This is useful for routing messages to different projects based on message content or contact information, while keeping the original message in the current project.
              - …
            - object: Ends the current USSD session.
              - …
            - object: Within a poll service, skips to the end of the survey.
              - …
            - object: Forwards the incoming call to another phone number.
              - …
            - object: Hangs up the phone call.
              - …
            - object: Within a poll service, ignores the current message.
              - …
            - object: Adds a log message to Telerivet's [service log](/dashboard/service_logs). To view the service log, open your [Services page](/dashboard/services) and click More > View logs. When using the "Test Service" feature, log messages will be displayed directly in the simulated phone dialog.
              - …
            - object: Plays an audio file in WAV or MP3 format in the voice call, which may be uploaded, linked, or recorded via the Telerivet web app. Alternatively, can use text-to-speech to speak a message.
              - …
            - object: Pushes the message to a HubSpot Help Desk inbox, in a conversation associated with the current contact. HubSpot agents can reply directly to send a reply to the contact.
              - …
            - object: Pushes the message to a Zendesk support inbox, in a ticket associated with the current contact. Zendesk agents can reply directly to the Zendesk ticket to send a reply to the contact.
              - …
            - object: Records an audio response from the caller, saves the recording URL as a custom variable on the message, then triggers the associated response handler.
              - …
            - object: Removes the current contact from a group. If you want to remove a contact other than the one who sent the message, add a "Use another contact" rule before this rule.
              - …
            - object: Within a poll service, repeats the current question again.
              - …
            - object: Sends a text reply to the sender. Optionally, the reply can be scheduled after a predefined delay, or sent via a different phone than the one that received the message.
              - …
            - object: Sends a text reply to the sender (simple version without labels, schedule, or route configuration).
              - …
            - object: Within a service triggered when a message status changes, will automatically resend the current message via the same route or a different route.
              - …
            - object: Runs custom JavaScript code on Telerivet's servers using Telerivet's Cloud Script API. This makes it possible to define custom actions such as calling the Telerivet REST API or third-party APIs, or parsing structured data from incoming messages. For more details, see the [Cloud Script API documentation](/api/script).
              - …
            - object: Triggers a set of actions which can be reused multiple times in the same service.
              - …
            - object: Sends airtime to the current contact if they are on a particular mobile network. Acts like a condition, and allows running other actions if the contact is on one of the supported networks. An 'else' condition can be added below this action to handle contacts that are not on the supported mobile networks.
              - …
            - object: Sends a plain-text email with custom subject line and body. Each rule can only send to a single email address; if you need multiple recipients, we recommend setting up a mailing list on your own server. When receiving MMS and chat messages, you can optionally send the multimedia files as email attachments. To prevent abuse, it isn't possible to change the 'From' name or email address of the email, although these settings can be configured when using Telerivet on a custom domain.
              - …
            - object: Sends a text message to any phone number. Optionally, the message can be scheduled after a predefined delay, or sent via a different phone than the one that received the message.
              - …
            - object: Sends a text message to the current contact.
              - …
            - object: Sends a SMS message to a group defined on your Contacts page. Optionally, you can exclude the message sender from receiving the message (common when implementing a group chat system).
              - …
            - object: Sends a USSD request from your Android phone to your mobile network. On some mobile networks, USSD requests can be used to check your airtime balance, transfer airtime to other phone numbers, and more. Note that this requires a compatible Android phone running the Telerivet Gateway app. Also, Telerivet cannot automatically invoke USSD requests that return menus or prompts.
              - …
            - object: Shows the specified text in the active USSD session. If this action is followed by a 'Wait for response' action, the text will be displayed as part of a USSD prompt.
              - …
            - object: Creates or retrieves a contact with a particular phone number, and sets that as the "current" contact for subsequent rules. This rule is often used to allow your organization's workers to register other people via SMS, and is typically combined with other rules to add the contact to a group and update their contact information.
              - …
            - object: Updates the name of the current contact in Telerivet.
              - …
            - object: Updates custom contact information for the current contact (for example, email address or birthdate). The rules editor lists the current variable names available for your project. You can also use a new variable name consisting of letters, numbers, and underscores.
              - …
            - object: Updates a custom variable for the current message. When triggered from a service that has a response data table (such as a poll service or custom actions with response handlers), custom message variables set via this action are automatically copied as custom variables on the corresponding response data table row. This is the recommended way to store derived or computed values in the response data table.
              - …
            - object: Updates the value of any writable variable within the Rules Engine. Optionally, you can use this rule to perform simple numeric operations between two variables such as addition, subtraction, multiplication and division. Read-only variables cannot be updated via this rule. [See available variables](#message_variables)
              - …
            - object: Within a poll service, skips to a question outside the normal order.
              - …
            - object: Adds a star to the current message. This makes it easy to segment important messages on your Messages page.
              - …
            - object: Stops processing rules for this message (for this service only).
              - …
            - object: Triggers another service for the current contact.
              - …
            - object: Triggers another service for the current message.
              - …
            - object: Triggers another service for the current project.
              - …
            - object: Within a custom route, selects one or more basic routes that can be used to send the message.
              - …
            - object: Waits for the caller to enter digits on the keypad, saves the input as a custom variable on the message, then triggers the associated response handler.
              - …
            - object: Waits for the caller to press a single key on the keypad, saves the input as a custom variable on the message, then triggers the associated response handler.
              - …
            - object: Waits for a response from the current contact, then processes the response using another set of actions or conditions. Useful for back-and-forth conversations or data collection that requires the contact to send multiple messages.
              - …
            - object: Prompts the user for input in the active USSD session, saves the response as a custom variable on the message, and triggers the associated response handler.
              - …
            - object: Makes a HTTP POST request to a URL on your server, passing several POST parameters with information about the current message and contact. Your webhook script may optionally return a JSON response with a 'messages' property containing an array of messages to send, and a 'variables' property containing variable names and values to update. For details, see the [Webhook API documentation](/api/webhook).
              - …
        - `op` string: Operator to join multiple conditions. Values: <code>and</code> (all conditions must match), <code>or</code> (any condition must match). Default: <code>or</code>.
        - `if_mode` string: Controls how this condition relates to previous conditions. Values: <code>if</code> (default, starts a new conditional block), <code>else_if</code> (only evaluated if the previous <code>if</code> or <code>else_if</code> did not match), <code>else</code> (executed if none of the previous <code>if</code>/<code>else_if</code> conditions matched; does not require <code>conditions</code> array).

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key or Bearer token
- `404`: Resource not found

---

[API](https://skmtc.dev/telerivet/apis/telerivet-api.md) · [All operations](https://skmtc.dev/telerivet/apis/telerivet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telerivet/apis/telerivet-api/revisions/4e14b1c8d917?raw)
