Update a cron schedule
const url = 'https://example.com/v1/schedules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"flowId":"example","flowVersion":"example","agentId":"example","agentVersion":"example","improve":{"agentId":"example","projectId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"},"config":{"cronExpression":"example","timezone":"example","input":"example"},"catchUp":"latest","overlap":"skip","startingDeadlineSeconds":1,"label":"example","toolsAllowedUnattended":["example"],"sendResultsTo":[{"to":"example","on":["completed"]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/schedules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "flowId": "example", "flowVersion": "example", "agentId": "example", "agentVersion": "example", "improve": { "agentId": "example", "projectId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "config": { "cronExpression": "example", "timezone": "example", "input": "example" }, "catchUp": "latest", "overlap": "skip", "startingDeadlineSeconds": 1, "label": "example", "toolsAllowedUnattended": [ "example" ], "sendResultsTo": [ { "to": "example", "on": [ "completed" ] } ] }'Partial merge on config. If config.cronExpression changes, nextFireAt is recomputed. label: null clears the label; omit to leave unchanged. Malformed cron expressions return 400 trigger-invalid-config. toolsAllowedUnattended replaces the list ([] clears it; absent keeps it): naming it takes admin on the schedule’s project, and every change is audited. A new target (another flow or agent) while the list isn’t empty must name it again, as it is or [], else 400; a new version alone keeps it. A schedule is personal or shared, and no change moves its owner: only POST /v1/schedules/{triggerId}/owner does. So with an authorization store, a new target (another flow or agent, or an Improve run) must be one the owner can run, a person or a service account, else 409 trigger-owner-cannot-run-target; that’s not checked when the caller is the owner, nor for an owner that was unregistered or removed. A schedule a person owns is personal: only they (holding run on its project; write for an improve schedule, or to make it one) or a project admin may change it. A schedule a service account owns is shared: changing its target or version, its input or toolsAllowedUnattended takes admin on its project, and the project’s writers may change its label, cron line and policies. Without an authorization store, a project admin here is a tenant-admin key. A change by anyone but a personal schedule’s owner is audited as trigger-changed-for-owner, naming the fields changed and the schedule’s version after it, never their values.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Change what it runs (the target fields, as at registration, which also needs what registering it needs on the new target; a new improve target stays in the schedule’s project), when, or its policies.
object
Responses
Section titled “Responses”Updated schedule.
A schedule: what it runs (a flow at a version, or an agent), when (a cron expression in a timezone), as whom (its owner), and what it does after a gap or while a run is still going.
object
Example
{ "owner": { "kind": "user", "isProjectAccount": true }, "catchUp": "latest", "overlap": "skip", "status": "active", "pausedReason": "month-cap", "sendResultsTo": [ { "on": [ "completed" ] } ]}Malformed request body, or trigger-invalid-config. Or reference-out-of-scope: a new target isn’t registered in the schedule’s project, its org or the workspace, or the version it names isn’t one that project runs (details.issues, at /target, whose message names the version). Nothing changes.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}permission-denied: the schedule is personal and the caller is neither its owner nor a project admin (the message names the owner), or it’s shared and changing what it runs takes a project admin. A caller without write on its project (its owner: run, except on an improve schedule; for an improve schedule, publish on the agent as well) is refused first, and learns nothing of its owner. Without an authorization store, key-project-mismatch (details.keyProjectId, details.projectId): the API key or session is limited to another project than the trigger’s (with a store, that is permission-denied).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No cron trigger with that id.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}A new target the schedule’s owner can’t run (trigger-owner-cannot-run-target), with an authorization store. schedule-exists: a new improve target whose agent has another Improve schedule in the project (details.scheduleId). Or an Idempotency-Key reused with a different body. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/schedules/{triggerId}: Fetch a cron schedulePOST /v1/schedules/{triggerId}/pause: Pause a cron schedulePOST /v1/schedules/{triggerId}/resume: Resume a cron schedulePOST /v1/schedules/{triggerId}/unregister: Soft-delete a cron schedule (tombstone)- Error code
authz-backend-unavailable - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
key-project-mismatch - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
reference-out-of-scope - Error code
request-too-large - Error code
schedule-exists - Error code
tenant-state-unavailable - Error code
trigger-invalid-config - Error code
trigger-owner-cannot-run-target - Every error code