Skip to main content
PATCH
Update a routine

Authorizations

Authorization
string
header
required

Secret key (sk_live_...)

Headers

Idempotency-Key
string

Optional key that makes the request idempotent. Retrying with the same key returns the original response instead of repeating the operation; keys expire after 24 hours. Any string up to 256 characters. See Idempotency.

Maximum string length: 256
Example:

"550e8400-e29b-41d4-a716-446655440000"

Path Parameters

routine_id
string
required

Unique identifier for the routine (prefixed with rtn_).

Pattern: ^rtn_
Example:

"rtn_AbC123xYz456"

Body

Only the fields you include are updated.

name
string

Display name for the routine.

type
enum<string>

Set to change how the routine runs. Changing to playwright requires playwright; changing to agent removes the code.

Available options:
playwright,
agent
playwright
object

The new code. Only valid when the routine's type is, or is being set to, playwright.

Response

OK

A routine: how a task runs on one source.

id
string
required

Unique identifier for the routine, prefixed with rtn_.

Pattern: ^rtn_
Example:

"rtn_AbC123xYz456"

object
string
required

Always routine.

task_id
string
required

The task this routine runs for. Prefixed with task_.

source_id
string
required

The source this routine runs on. Prefixed with src_.

name
string
required

Display name for the routine.

type
enum<string>
required

How the routine runs: playwright runs your code, agent lets the Deck agent complete the task.

Available options:
playwright,
agent
created_at
string<date-time>
required

ISO 8601 timestamp of when the resource was created.

Example:

"2026-09-22T12:00:00Z"

updated_at
string<date-time>
required

ISO 8601 timestamp of when the resource was last updated.

Example:

"2026-09-22T12:00:00Z"

playwright
null | object

The routine's code. Present when type is playwright.

version
null | integer

The version number. Present only on a version snapshot.

request_id
null | string

Unique identifier for the API request. Include this when contacting support.