---
title: "Update service details"
method: POST
path: "/v1/projects/{project_id}/services/{id}"
tags: ["Service"]
---

# Update service details

`POST /v1/projects/{project_id}/services/{id}`

## Request

- Base URL: `https://api.telerivet.com`
- URL: `https://api.telerivet.com/v1/projects/{project_id}/services/{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`)

Updates writable fields on the given service.

## Path parameters

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

## Request body

- object
  - `name` string: Name of the service
  - `active` boolean: Whether the service is active or inactive. Inactive services are not automatically triggered and cannot be invoked via the API.
  - `priority` integer: A number that determines the order that services are triggered when a particular event occurs (smaller numbers are triggered first). Any service can determine whether or not execution "falls-through" to subsequent services (with larger priority values) by setting the return_value variable within Telerivet's Rules Engine.
  - `vars` object: Custom variables stored for this service. 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.
  - `response_table_id` string: ID of the data table where responses to this service will be stored
  - `phone_ids` string: IDs of phones (basic routes) associated with this service, or null if the service is associated with all routes. Only applies for service types that handle incoming messages, voice calls, or USSD sessions.
  - `message_types` string[]: Types of messages that this service handles. Only provided for service types that handle incoming messages.
  - `table_ids` string: IDs of data tables that this service applies to, or null if this service applies to all data tables. Only provided for data row services (`data_row_script` and `data_row_actions`).
  - `message_statuses` string[]: Message statuses that this service handles. Only provided for `message_status_actions` services.
  - `tags` string[]: Tags used to organize this service. Each tag can be up to 32 characters in length.
  - `apply_mode` 'always' | 'unhandled': If apply_mode is `unhandled`, the service will not be triggered if another service has already handled the incoming message. If apply_mode is `always`, the service will always be triggered regardless of other services. Only applies to services that handle incoming messages.
  - `contact_number_filter` 'long_number' | 'all': If contact_number_filter is `long_number`, this service will only be triggered if the contact phone number has at least 7 digits (ignoring messages from shortcodes and alphanumeric senders). If contact_number_filter is `all`, the service will be triggered for all contact phone numbers. Only applies to services that handle incoming messages.
  - `show_action` boolean: Whether this service is shown in the 'Actions' menu within the Telerivet web app when the service is active. Only provided for service types that are manually triggered.
  - `direction` 'incoming' | 'outgoing' | 'both': Determines whether the service handles incoming voice calls, outgoing voice calls, or both. Only applies to services that handle voice calls.
  - `solution_id` string: ID of the solution that this service belongs to, if any

## Response `200`

Successful response

- Service: Represents an automated service on Telerivet, for example a poll, auto-reply, webhook service, etc. A service, generally, defines some automated behavior that can be invoked/triggered in a particular context, and may be invoked either manually or when a particular event occurs. Most commonly, services work in the context of a particular message, when the message is originally received by Telerivet.
  - `id` string: ID of the service
  - `name` string: Name of the service
  - `service_type` string: Type of the service.
  - `active` boolean: Whether the service is active or inactive. Inactive services are not automatically triggered and cannot be invoked via the API.
  - `priority` integer: A number that determines the order that services are triggered when a particular event occurs (smaller numbers are triggered first). Any service can determine whether or not execution "falls-through" to subsequent services (with larger priority values) by setting the return_value variable within Telerivet's Rules Engine.
  - `contexts` object: A key/value map where the keys are the names of contexts supported by this service (e.g. message, contact), and the values are themselves key/value maps where the keys are event names and the values are all true. (This structure makes it easy to test whether a service can be invoked for a particular context and event.)
  - `vars` object: Custom variables stored for this service. 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 service in the Telerivet web app
  - `url_edit` string: URL to edit the service in the Telerivet web app
  - `project_id` string: ID of the project this service belongs to
  - `response_table_id` string: ID of the data table where responses to this service will be stored
  - `phone_ids` string: IDs of phones (basic routes) associated with this service, or null if the service is associated with all routes. Only applies for service types that handle incoming messages, voice calls, or USSD sessions.
  - `message_types` string[]: Types of messages that this service handles. Only provided for service types that handle incoming messages.
  - `table_ids` string: IDs of data tables that this service applies to, or null if this service applies to all data tables. Only provided for data row services (`data_row_script` and `data_row_actions`).
  - `message_statuses` string[]: Message statuses that this service handles. Only provided for `message_status_actions` services.
  - `tags` string[]: Tags used to organize this service. Each tag can be up to 32 characters in length.
  - `apply_mode` 'always' | 'unhandled': If apply_mode is `unhandled`, the service will not be triggered if another service has already handled the incoming message. If apply_mode is `always`, the service will always be triggered regardless of other services. Only applies to services that handle incoming messages.
  - `contact_number_filter` 'long_number' | 'all': If contact_number_filter is `long_number`, this service will only be triggered if the contact phone number has at least 7 digits (ignoring messages from shortcodes and alphanumeric senders). If contact_number_filter is `all`, the service will be triggered for all contact phone numbers. Only applies to services that handle incoming messages.
  - `show_action` boolean: Whether this service is shown in the 'Actions' menu within the Telerivet web app when the service is active. Only provided for service types that are manually triggered.
  - `direction` 'incoming' | 'outgoing' | 'both': Determines whether the service handles incoming voice calls, outgoing voice calls, or both. Only applies to services that handle voice calls.
  - `webhook_url` string: URL that a third-party can invoke to trigger this service. Only provided for services that are triggered by a webhook request.
  - `is_custom_template` boolean: Whether this service was created from a custom service template
  - `solution_id` string, nullable: ID of the solution that this service belongs to, if any

## 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)
