Skip to content

post_api_schedules

POST
/api/schedules
curl --request POST \
--url https://example.com/api/schedules \
--header 'Content-Type: application/json' \
--cookie supacloud_session=<supacloud_session> \
--data '{ "agent_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "agent_type": "example", "app_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "app_inputs": "example", "cadence": "example", "config": "example", "interval_minutes": 1, "next_run_at": "2026-04-15T12:00:00Z", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "prompt": "example", "timezone": "example", "title": "example", "workflow_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Create a task schedule in the selected workspace.

Media typeapplication/json
object
agent_profile_id

#708 F11 / who-5 — the agent PROFILE the fired task runs under (its agent_profile_id WHO column). Optional; None = no pin (the no-profile WHO default). A task schedule only.

string | null format: uuid
agent_type
string
app_id

ADR 0030 W4 — when set, the schedule fires a kind='app' run of this App instead of a task or a workflow. Exactly one of workflow_id / app_id / a task definition (agent_type + prompt) must be set. prompt and agent_type are unused for an App schedule.

string | null format: uuid
app_inputs

ADR 0030 W4 — the per-fire App input payload, prefilled into the fired run’s trigger context. Ignored for a task / workflow schedule.

cadence
required

once | daily | weekly | monthly | interval.

string
config
interval_minutes

#908 — the step width of an interval cadence in minutes. Required iff cadence = 'interval'; rejected on any other cadence. The scheduler advances the schedule by plain UTC arithmetic (next_run_at + N min), independent of timezone — no DST drift.

integer | null format: int32
>= 5 <= 1440
next_run_at
required
string format: date-time
project_id

Optional: a task schedule runs in a project, but an App schedule is workspace-scoped and may omit it (the service stores Option<Uuid>).

string | null format: uuid
prompt
string
timezone
string | null
title
required
string
workflow_id

When set, the schedule fires a kind='workflow' run of this workflow instead of creating a task (ADR 0020 V4 schedule trigger). prompt and agent_type are unused for a workflow schedule.

string | null format: uuid

Example generated

{
"agent_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"agent_type": "example",
"app_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"app_inputs": "example",
"cadence": "example",
"config": "example",
"interval_minutes": 1,
"next_run_at": "2026-04-15T12:00:00Z",
"project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"prompt": "example",
"timezone": "example",
"title": "example",
"workflow_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

OK

Media typeapplication/json
object
agent_profile_id
required

#708 F11 / who-5 — the agent PROFILE the fired task runs under (agent_profile_id WHO column). None = no pin. Surfaced so the schedule editor shows the current pin.

string | null format: uuid
agent_type
required
string
app_id
required

ADR 0030 W4 — when set, this schedule fires a kind='app' run of the given App on cadence. Exactly one of workflow_id / app_id / a task definition is set. Surfaced on the wire so the schedule-editor can show (and the trigger picker can filter on) the App target.

string | null format: uuid
app_inputs
required

ADR 0030 W4 — the per-fire App input payload prefilled into the run’s trigger context. None for a task / workflow schedule.

cadence
required

once | daily | weekly | monthly | interval.

string
config
required
consecutive_failed_runs
required

How many of the newest produced tasks failed or were cancelled since the last one that completed; 0 when the newest completed or nothing fired yet.

integer format: int64
created_at
required
string format: date-time
failure_count
required
integer format: int32
fires_in_quiet_hours
required

AUD-WIR-034 — the next fire lands inside the workspace quiet-hours window at a wall-clock time this schedule repeats: a recurring fire there is skipped on every occurrence, a one-time fire is deferred to the window end. The editor warns on it.

boolean
id
required
string format: uuid
interval_minutes
required

#908 — the step width of an interval cadence in minutes (5–1440); null for calendar cadences (DB CHECK pair, migration 323).

integer | null format: int32
last_error
required
string | null
last_run_at
required
string | null format: date-time
last_run_id
required

The runs row of the schedule’s most recent fire (ADR 0022 R4). R5’s schedule-page run column links this into /runs/{last_run_id}; last_task_id (the task definition) is kept alongside it.

string | null format: uuid
last_task_id
required
string | null format: uuid
last_task_status
required

03.09.2026 — the status of the newest task this schedule FIRED (completed, failed, running, …), read from the tasks it stamped with its id; null when it never fired. failure_count counts TRIGGER failures only, which is why a schedule whose every produced task fails could read healthy before this.

string | null
next_run_at
required
string | null format: date-time
project_id
required
string | null format: uuid
prompt
required
string
run_count
required
integer format: int32
status
required
string
timezone
required
string
title
required
string
updated_at
required
string format: date-time
user_id
required
string format: uuid
workflow_id
required

When set, this schedule fires a kind='workflow' run of the given workflow on cadence (ADR 0020 V4 schedule trigger). Exposed on the wire (V10) so the web builder’s schedule trigger config form can filter the schedules picker down to the rows that already belong to the workflow being edited, without a second round-trip.

string | null format: uuid
workspace_id
required
string format: uuid

Example generated

{
"agent_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"agent_type": "example",
"app_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"app_inputs": "example",
"cadence": "example",
"config": "example",
"consecutive_failed_runs": 1,
"created_at": "2026-04-15T12:00:00Z",
"failure_count": 1,
"fires_in_quiet_hours": true,
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"interval_minutes": 1,
"last_error": "example",
"last_run_at": "2026-04-15T12:00:00Z",
"last_run_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"last_task_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"last_task_status": "example",
"next_run_at": "2026-04-15T12:00:00Z",
"project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"prompt": "example",
"run_count": 1,
"status": "example",
"timezone": "example",
"title": "example",
"updated_at": "2026-04-15T12:00:00Z",
"user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"workflow_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Structured client error

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Authentication required

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Permission denied

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Project, workflow or App is not available in the selected workspace

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Structured server error

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}