Skip to main content
PATCH
/
v3
/
organizations
/
{org_id}
/
schedules
/
{schedule_id}
Update schedule
curl --request PATCH \
  --url https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent": "devin",
  "bypass_approval": true,
  "enabled": true,
  "frequency": "<string>",
  "interval_count": 123,
  "name": "<string>",
  "notify_on": "always",
  "playbook_id": "<string>",
  "prompt": "<string>",
  "run_as_user_id": "<string>",
  "schedule_type": "recurring",
  "scheduled_at": "2023-11-07T05:31:56Z",
  "slack_channel_id": "<string>",
  "slack_team_id": "<string>",
  "tags": [
    "<string>"
  ],
  "target_devin_id": "<string>"
}
'
{
  "agent": "devin",
  "consecutive_failures": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "enabled": true,
  "frequency": "<string>",
  "last_error_at": "2023-11-07T05:31:56Z",
  "last_error_message": "<string>",
  "last_executed_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "notify_on": "always",
  "org_id": "<string>",
  "playbook": {
    "playbook_id": "<string>",
    "title": "<string>"
  },
  "prompt": "<string>",
  "scheduled_session_id": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "bypass_approval": false,
  "interval_count": 1,
  "schedule_type": "recurring",
  "scheduled_at": "2023-11-07T05:31:56Z",
  "slack_channel_id": "<string>",
  "slack_team_id": "<string>",
  "tags": [
    "<string>"
  ],
  "target_devin_id": "<string>"
}

Permissions

Requires a service user with the ManageOrgSchedules permission at the organization level.

Notes

All fields are optional. Only the fields provided in the request body will be updated. To disable a schedule, set enabled to false. Setting playbook_id to null will clear the associated playbook. You can change the schedule_type between recurring and one_time. When changing to one_time, provide scheduled_at with a future ISO 8601 datetime. When changing to recurring, provide frequency with a valid cron expression.

Execution identity

The run_as_user_id parameter controls which user identity the schedule runs as. When a schedule fires, sessions are created under this user — they receive notifications and the session appears in their history.
  • Set a user: Provide a valid user ID to change the execution identity. This requires:
    1. The service user must have ImpersonateOrgSessions permission
    2. The target user must be a member of the organization
    3. The target user must have UseDevinSessions permission
  • Clear (set to null): Reverts the schedule to run as the default bot user
  • Omit the field: Leaves the current execution identity unchanged

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

schedule_id
string
required

Schedule ID (prefix: sched-)

Example:

"sched-abc123def456"

Body

application/json
agent
enum<string> | null
Available options:
devin,
data_analyst,
advanced
bypass_approval
boolean | null
enabled
boolean | null
frequency
string | null
interval_count
integer | null
name
string | null
notify_on
enum<string> | null
Available options:
always,
failure,
never
playbook_id
string | null
prompt
string | null
run_as_user_id
string | null

Set the user ID that this schedule will run as. Requires ImpersonateOrgSessions permission. Setting to null reverts to the default bot user. Omitting the field leaves the current identity unchanged.

schedule_type
enum<string> | null
Available options:
recurring,
one_time
scheduled_at
string<date-time> | null
slack_channel_id
string | null
slack_team_id
string | null
tags
string[] | null
target_devin_id
string | null

Response

Successful Response

agent
enum<string>
required
Available options:
devin,
data_analyst,
advanced
consecutive_failures
integer
required
created_at
string<date-time>
required
created_by
string | null
required
enabled
boolean
required
frequency
string | null
required
last_error_at
string<date-time> | null
required
last_error_message
string | null
required
last_executed_at
string<date-time> | null
required
name
string
required
notify_on
enum<string>
required
Available options:
always,
failure,
never
org_id
string
required
playbook
PlaybookInfo · object
required
prompt
string
required
scheduled_session_id
string
required
updated_at
string<date-time>
required
bypass_approval
boolean
default:false
interval_count
integer
default:1
schedule_type
enum<string>
default:recurring
Available options:
recurring,
one_time
scheduled_at
string<date-time> | null
slack_channel_id
string | null
slack_team_id
string | null
tags
string[] | null
target_devin_id
string | null