Roll back to a version
Makes an earlier version active again (triggers switch atomically). Running runs keep their version. The rollback is recorded as the routine's update; no new version is created. Trigger subscriptions follow the version: those of action triggers the earlier version does not have are removed, and the others are updated to its definition.
POST
/v1/routines/{routine}/rollback
Makes an earlier version active again (triggers switch atomically). Running runs keep their version. The
rollback is recorded as the routine's update; no new version is created. Trigger subscriptions follow the
version: those of action triggers the earlier version does not have are removed, and the others are updated
to its definition.
Authentication
Bearer Token (b3os_sk_ API key or b3os_pat_ token) API Key (cookie: __Host-b3os_session)
Path Parameters
routine
string
required
path
A routine ID (`rtn_…`) or name. Names are unique per project; `runs`, `hooks`, `validate` and `import` are
reserved and cannot be routine names.
Example:
"nightly-digest"Request Body required
application/jsonversion
string | integer
REQUIRED
A `ver_` ID or a version number.
One of:
Option 1string
Option 2integer
Responses
200
The routine with the restored active version.
application/jsonid
string
REQUIRED
object
string
REQUIRED
Enum:
routinename
string
REQUIRED
description
string | null
REQUIRED
status
string
REQUIRED
`paused` when triggers are stopped; API runs still work unless `paused_reason` is `run_as_revoked`.
Enum:
active, pausedpaused_reason
string | null
REQUIRED
Enum:
manual, run_as_revoked, nullversion
object
REQUIRED
id
string
REQUIRED
number
integer
REQUIRED
created_at
string (date-time)
REQUIRED
triggers
object[]
REQUIRED
Array of:
id
string
REQUIRED
The trigger's `id` in the definition.
type
string
REQUIRED
Enum:
cron, interval, webhook, actionstatus
string
REQUIRED
Enum:
active, pausednext_fire_at
string (date-time) | null
REQUIRED
Next scheduled fire (cron and interval), or `null`.
hook
object | null
REQUIRED
The inbound URL of a webhook trigger, or `null`.
id
string
REQUIRED
url
string (uri)
REQUIRED
Give this URL to the provider.
verify
string
REQUIRED
Enum:
b3os, github, stripe, slack, standard_webhooks, hmac_sha256secret
string
The `b3os` scheme's signing secret. Present only in the response of the publish that created the hook (and of a rotation).
subscription_id
string | null
REQUIRED
The trigger subscription of an action trigger (`GET /v1/actions/subscriptions/{subscription_id}`), or `null`.
run_as
object
REQUIRED
The identity runs execute as (the key that published the active version, with its scopes at publish time).
key
string | null
REQUIRED
The API key ID; `null` when a dashboard user published.
scopes
string[]
REQUIRED
Array of:
string
created_at
string (date-time)
REQUIRED
updated_at
string (date-time)
REQUIRED
metadata
object
REQUIRED
Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of
`A-Z a-z 0-9 _ . : -`; values are at most 500 characters. B3OS never interprets them.
400
The request failed validation (`invalid_request`, `invalid_url`).
401
Missing, malformed, expired or revoked credentials (`unauthorized`).
403
Authenticated but not allowed (`forbidden`, `egress_denied`).
404
No such routine or version (`routine_not_found`, `routine_version_not_found`).
413
The request body exceeds this operation's limit.
415
The Content-Type is not accepted by this operation.
422
The version's pack trigger subscriptions could not be set up; the code is the actions product's (for example `connection_required` or `action_input_invalid`). Nothing changed.
429
A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500
Something failed inside B3OS (`internal`). Retry with backoff.
503
The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X POST 'https://beta-api.b3os.org/v1/routines/nightly-digest/rollback' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "version": 1}'
const response = await fetch('https://beta-api.b3os.org/v1/routines/nightly-digest/rollback', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "version": 1 })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://beta-api.b3os.org/v1/routines/nightly-digest/rollback', headers=headers, json={ "version": 1})print(response.json())
200
Response
{ "id": "rtn_01m5t6vhkw4a8fa4tb5w4ffz37", "object": "routine", "name": "nightly-digest", "description": null, "status": "active", "paused_reason": null, "version": { "id": "ver_01m5t3vcc6bxj0v3x705zmg4cd", "number": 1, "created_at": "2026-10-25T19:10:00.000Z" }, "triggers": [], "run_as": { "key": "key_01m5t5gb92a5zncjx654gevx4p", "scopes": [ "vision:run", "infer:run" ] }, "created_at": "2026-10-25T19:10:00.000Z", "updated_at": "2026-10-25T19:40:00.000Z", "metadata": {}}
API Playground
Try this endpoint
POST
/v1/routines/{routine}/rollback