Skip to content

post_api_projects_id_automation_setup

POST
/api/projects/{id}/automation/setup
curl --request POST \
--url https://example.com/api/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/automation/setup \
--header 'Content-Type: application/json' \
--cookie supacloud_session=<supacloud_session> \
--data '{ "auto_developer_enabled": true, "git_credential_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "git_default_branch": "example", "git_provider": "example", "git_repo_url": "example" }'

Configure project automation and register the associated forge webhook.

id
required
string format: uuid

Project id

Media typeapplication/json
object
auto_developer_enabled
required
boolean
git_credential_id
string | null format: uuid
git_default_branch
string | null
git_provider
string | null
git_repo_url
string | null

Example generated

{
"auto_developer_enabled": true,
"git_credential_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"git_default_branch": "example",
"git_provider": "example",
"git_repo_url": "example"
}

Automation configured successfully

Media typeapplication/json
object
enabled_events
required
Array<string>
project
required
object
auto_developer_workflow_id

D1 — materialized Auto Developer workflow id.

string | null format: uuid
autonomy_clamp

SC-11 (mig 447) — the trust ledger’s automatic down-clamp of the merge ceiling ({merge_ceiling, reason, since, evidence_snapshot_id, acknowledged_by}); None = not clamped. Written only by queries::trust; read through autonomy::trust_clamp_of, which fails closed on a value it cannot parse.

autonomy_level

ADR 0045 §3.1 Stage 4 — OPTIONAL project autonomy override (mig 214, nullable SMALLINT). None = inherit the workspace level (the precedence chain resolves the first non-null). #[serde(default)] keeps pre-214 rows readable.

integer | null format: int32
autonomy_overrides

ADR 0045 §3.1 — per-axis Advanced override vector (mig 214, JSONB NOT NULL DEFAULT '{}'). Empty {} = no per-axis override.

backlog_classifier

'llm' (default) or 'rules' — how items are classified/prioritized.

string
backlog_cursor_at

Timestamp of the last successful scan that changed the backlog. A successful scan that changed nothing refreshes it only once the value is an hour old, so an idle project’s row is not rewritten every tick while a cursor older than that still means the scans are failing. None until the first sweep.

string | null format: date-time
backlog_daily_budget_usd

Per-sweep daily budget cap in USD; None leaves only the workspace cap.

number | null format: double
backlog_max_concurrent

Per-sweep fan-out bound. None → falls back to max_concurrent_runs.

integer | null format: int32
backlog_max_waiting

AUD-INT-011 (mig 451) — the cap on backlog runs parked on a human gate (a run in waiting, or whose tree has a waiting human node or a pending tool approval). Those runs no longer consume backlog_max_concurrent; dispatch launches only while their count is below this cap. None = twice the effective concurrency cap.

integer | null format: int32
backlog_merge_policy

'pr_only' (default) | 'auto_on_green' | 'full_auto' (D5).

string
backlog_mode_enabled

Kill-switch: the ticker skips a project whose flag is false.

boolean
backlog_required_reviewers

N human approvals required on the in_review → done/merge step (D5).

integer format: int32
checkout

SC-28 — the SPARSE per-project checkout override (projects.checkout, nullable JSONB): clone depth, partial clone, clone timeout, submodules and the Git LFS include set. None (SQL NULL) = inherit the built-in full single-branch clone. SELECT * maps it, so the launch stamp reads it from the already-loaded row. Validated on write by sc_types::CheckoutConfig; a stored value that no longer parses is dropped at launch (not a safety knob: the runner’s LFS pointer check runs regardless). #[serde(default)] keeps any non-SELECT * path readable.

closeout_config
One of:

#712 (ADR 0049) — the SPARSE standard-closeout override (mig 283, nullable JSONB). None (SQL NULL) = inherit the workspace default entirely; an object overrides only the steps it names (per-step first-non-null vs the workspace). Parsed defensively via [sc_closeout_models::CloseoutConfigPatch::parse]. #[serde(default)] keeps any non-SELECT * deserialize path readable. #708 S4 types the schema interior via CloseoutConfigPatch (was an opaque unknown).

object
memory

Gates the Tier-0 closeout MEMORY proposal. None inherits the next tier.

boolean | null
project_docs
One of:

A sparse project-docs step override.

object
condition
One of:
string
Allowed values: if_touched always
enabled
boolean | null
globs
Array<string> | null
user_docs
One of:

A sparse user-docs step override.

object
condition
One of:
string
Allowed values: if_touched always
enabled
boolean | null
globs
Array<string> | null
langs
Array<string> | null
wiki
One of:

A sparse wiki step override.

object
condition
One of:
string
Allowed values: if_touched always
enabled
boolean | null
created_at
required
string format: date-time
daily_budget_usd

#708 M5 (mig 296) — the project-TOTAL daily/monthly $-budget caps that AND-gate EVERY task launch (not just backlog dispatch) under the workspace budget. None leaves only the workspace cap. FromRow auto-maps them from SELECT *.

number | null format: double
denied_tools

ADR 0045 Stage 1b — per-project blast-radius tool denylist (mig 210, TEXT[] NOT NULL DEFAULT '{}'). #[serde(default)] so pre-209 rows (and any Deserialize path without the field) read as [].

Array<string>
detected_stack
git_credential_id
string | null format: uuid
git_default_branch
string | null
git_provider
string | null
git_repo_url
string | null
id
required
string format: uuid
image_built_at
string | null format: date-time
image_config
image_digest

#1468 / ADR 0086 — the pushed sha256: digest, set when the image was built on the runner fleet; launches pin it (<image_tag>@<digest>). NULL on a hub build.

string | null
image_error
string | null
image_size
integer | null format: int64
image_status
string | null
image_tag
string | null
issue_close_policy

SC-22 (mig 411) — the project-level issue close policy: 'on_completion' (default, today’s behaviour: a completed issue-linked task closes its issue) | 'merged_pr_only' (only a pull request confirmed merged into the default branch closes an issue). SELECT * maps it; readers parse it fail-closed through sc_kernel::issue_close_policy::IssueClosePolicy::from_db. The serde default keeps any non-SELECT * deserialize path on today’s behaviour.

string
issue_tracker

ADR 0029 — tracker provider/key, OAuth credential and state-name overrides.

string | null
issue_tracker_autodev_enabled
required

ADR 0029 Slice 7 — tracker auto-developer toggle + webhook HMAC secret.

boolean
issue_tracker_credential_id
string | null format: uuid
issue_tracker_key
string | null
issue_tracker_state_map
max_concurrent_runs

Issue #110: per-project concurrency cap. None = unlimited.

integer | null format: int32
memory_governance_policy

#708 W13 (ADR 0061) — the SPARSE per-project memory-governance override (mig 289, nullable JSONB). None (SQL NULL) = inherit the workspace policy entirely; an object overrides only the memory scopes it names (folded per-scope over the workspace via effective_memory_governance). #[serde(default)] keeps any non-SELECT * deserialize path readable.

monthly_budget_usd
number | null format: double
name
required
string
notify_config

SC-21 (mig 436) — the SPARSE per-project notification override (projects.notify_config, nullable JSONB): {human_action_channel, project_channel}. None (SQL NULL) = inherit everything. SELECT * maps it. Validated on write by validate_notify_config; read fail-open through [crate::models::NotifyConfig::from_value]. #[serde(default)] keeps any non-SELECT * deserialize path readable.

object | null
required_worker_group_ids

ADR 0046 RUNG 1b — OPTIONAL project worker-group affinity override (mig 227, nullable UUID[]). None = inherit (the column was NULL — contributes nothing to the first-non-null profile->project->task chain); Some(vec![]) = an explicit “no affinity from this source”. Resolved into the task’s required_labels by services::runners::groups. #[serde(default)] keeps pre-227 rows readable.

Array<string> | null
routing_artifact

SC-12 / #855 G1 (mig 448) — the CACHED, parsed routing artifact keyed on the forge blob SHA ({path, blob_sha, loaded_at, parsed, findings, last_error}). None = never loaded. SELECT * maps it, so backlog dispatch reads the artifact off the already-loaded project row instead of a second query or a per-item forge call. Parsed defensively via sc_svc_foundation::routing_artifact::parse; a value that no longer parses contributes NO routing.

routing_artifact_path

SC-12 / #855 G1 (mig 448) — the repository path of this project’s routing artifact. None (SQL NULL) = OFF: no file is read and the tier precedence starts at the arm’s route_by_label. Conventionally agents/routing/model-routing.yaml.

string | null
sidecars

#1376 (mig 403) — the SPARSE per-project generic sidecar override (projects.sidecars, nullable JSONB). None (SQL NULL) = inherit the instance defaults entirely; an object overrides only the kinds it names. SELECT * maps it, so the launch fold reads it from the already-loaded project row instead of issuing a second SELECT sidecars. Parsed + validated against the typed registry by sc_types::ProjectSidecarConfig; a stored value that no longer parses fails the launch CLOSED. #[serde(default)] keeps any non-SELECT * deserialize path readable.

trust_policy

SC-11 (mig 447) — the SPARSE trust-policy override (None = inherit the workspace, then the built-in). Validated by sc_kernel::trust::TrustPolicy.

user_id
required
string format: uuid
workspace_id
string | null format: uuid
webhook_configured
required
boolean
webhook_url
string | null

Example

{
"project": {
"closeout_config": {
"project_docs": {
"condition": "if_touched"
},
"user_docs": {
"condition": "if_touched"
},
"wiki": {
"condition": "if_touched"
}
}
}
}

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"
}

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"
}