---
title: "Schedule a service"
method: POST
path: "/v1/projects/{project_id}/scheduled_services"
tags: ["Service"]
---

# Schedule a service

`POST /v1/projects/{project_id}/scheduled_services`

## Request

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

Schedules a service to be triggered at a specified time.

 Only services that can be triggered for the project context and handle the default event can be scheduled. This includes services with types `scheduled_actions`, `scheduled_script`, and other service types that support project-level triggering.

 (Note: To schedule services that are triggered for a contact, project.scheduleMessage should be used instead with `message_type`=`service`.)

## Path parameters

- `project_id` string, required

## Request body

- object
  - `service_id` string, required: ID of the service to schedule
  - `start_time` integer: The time that the service will be triggered (or first triggered for recurring scheduled services)
  - `start_time_offset` integer: Number of seconds from now to trigger the service
  - `rrule` string: A recurrence rule describing how the schedule repeats, e.g. 'FREQ=MONTHLY' or 'FREQ=WEEKLY;INTERVAL=2'; see <https://tools.ietf.org/html/rfc2445#section-4.3.10>. (UNTIL is ignored; use end_time parameter instead).
  - `timezone_id` string: TZ database timezone ID; see [List of tz database time zones Wikipedia article](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
  - `end_time` integer: Time after which a recurring scheduled service will stop (not applicable to non-recurring scheduled services)
  - `end_time_offset` integer: Number of seconds from now until the recurring scheduled service will stop
  - `vars` object: Custom variables to store for this scheduled service

## Response `200`

Successful response

- ScheduledService: Represents a scheduled service within Telerivet. Scheduled services allow services to be triggered automatically at specified times. The ScheduledService object is only used for services that are triggered for a project (e.g. `scheduled_actions` or `scheduled_script`). Note: To schedule services that are triggered for a contact, the ScheduledMessage object should be used instead, with `message_type`=`service`.
  - `id` string: ID of the scheduled service
  - `service_id` string: ID of the service to be triggered
  - `rrule` string: Recurrence rule for recurring scheduled services, e.g. 'FREQ=MONTHLY' or 'FREQ=WEEKLY;INTERVAL=2'; see [RFC2445](https://tools.ietf.org/html/rfc2445#section-4.3.10).
  - `timezone_id` string: Timezone ID used to compute times for recurring scheduled services; see [List of tz database time zones Wikipedia article](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
  - `time_created` integer: Time the scheduled service was created in Telerivet
  - `start_time` integer: The time that the service will be triggered (or first triggered for recurring scheduled services)
  - `end_time` integer, nullable: Time after which a recurring scheduled service will stop (not applicable to non-recurring scheduled services)
  - `prev_time` integer, nullable: The most recent time that Telerivet triggered this scheduled service (null if it has never been triggered)
  - `next_time` integer, nullable: The next upcoming time that Telerivet will trigger this scheduled service (null if it will not be triggered again)
  - `occurrences` integer: Number of times this scheduled service has already been triggered
  - `vars` object: Custom variables stored for this scheduled 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.
  - `project_id` string: ID of the project this scheduled service belongs to

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