{"openapi":"3.1.0","info":{"title":"RunFlow","description":"Trusted Docker execution service with scheduling and RBAC","version":"0.2.0"},"paths":{"/ping":{"get":{"summary":"Ping","description":"Liveness probe. Needs no API key and answers GET and HEAD. A GET returns `{\"message\": \"PONG\"}`.","operationId":"ping_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Ping Ping Get"}}}}}}},"/api/v1/runs":{"get":{"summary":"List Runs","description":"Lists the caller's runs and builds. Query parameters are `state_filter`, `tag`, `limit` (default 50), `offset`, `include_scheduling_info` and `kind` (`run` or `build`).\n\n`state_filter` takes one state. Active states are `scheduled`, `queued`, `pulling`, `running`, `paused` and `stopping`. Terminal states are `exited`, `failed`, `timeout` and `killed`, and there is no `completed` state. An unknown `state_filter` or `kind` value is refused with 422 and the accepted values. Secret-pattern `env` keys are redacted.","operationId":"list_runs_api_v1_runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Filter"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"include_scheduling_info","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Scheduling Info"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunStatus"},"title":"Response List Runs Api V1 Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Submit Run","description":"Submits a container run. Answers 202 with `track_id`, `status` (`scheduled`), `eligible_start` and `clamped`. Requires the `runflow_run_submit` permission, and unknown body fields are refused with 422.\n\nOmitted `cpu_limit`, `memory_limit_mb` and `timeout_seconds` get defaults. Every value is capped at the tenant quota and at this node's per-run ceiling, and `clamped` is true when a value you supplied was lowered. `cpu_limit` is the run's share of the node's CPUs when they are busy. On a node whose `GET /health` `capacity` reports `\"cpu_burst\": true`, a run can use idle cores beyond its `cpu_limit`, up to the tenant's `cpu_cores` and the node's per-run ceiling, at no extra charge. A `scheduled_start` in the past starts the run at once. `expires_at` must be in the future (400 `expires_at_in_past`), and a run that has not started by then fails as `expired`. A timestamp without a timezone is read as UTC.\n\n`idempotency_key` (1 to 128 characters) makes the submit safe to retry. A repeat with the same key and the same image, command and resources answers 200 with the existing run and `\"idempotent_replay\": true`, and creates nothing. A repeat with a different request, or with a key whose run was deleted, answers 409 with code `idempotency_key_reused`.\n\nErrors: 400 for an invalid image reference or inline webhook. 403 `image_not_allowed` when your tier's image allowlist excludes the image. 403 `sandbox_not_permitted` when `sandbox: \"trusted\"` names an image outside the operator's trusted allowlist. 409 `node_build_only` on a node that only builds images. 429 `daily_quota_exceeded`, or `quota_exceeded:<policy>` with `Retry-After` on a metered tier. 503 when metering cannot be reached on a tier that requires it.","operationId":"submit_run_api_v1_runs_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSubmitRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}":{"get":{"summary":"Get Run","description":"Returns one run's status, events, scheduling information and measured `usage`. Secret-pattern `env` keys are redacted. `log_capture` reports whether each output stream was captured whole. Answers 404 `Run not found` for a run that does not exist or belongs to another tenant.","operationId":"get_run_api_v1_runs__track_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Run","description":"Deletes a run. A run that is still active is killed first. Its logs and utilization samples are removed, and the run row is soft-deleted and purged on the normal retention clock. Requires the `runflow_run_delete` permission. Answers 404 `Run not found` for an unknown run.","operationId":"delete_run_api_v1_runs__track_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Run Api V1 Runs  Track Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/result":{"get":{"summary":"Get Result","description":"Returns a finished run's result: `exit_code`, terminal `status`, `duration_seconds`, the byte sizes of stdout and stderr, and `result_summary` (the last 1 KB of stdout). Answers 409 `not_terminal` while the run is still active and 404 `Run not found` for an unknown run.","operationId":"get_result_api_v1_runs__track_id__result_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/logs":{"get":{"summary":"Get Logs","description":"Returns a page of a run's log. Query parameters are `stream` (`stdout`, `stderr` or `both`, default `both`), `since`, `limit` (default 100, at most 1,000) and `tail`.\n\nWithout `since` the page starts at the beginning of the log. Page forward with `since=<next_since>` until `next_since` equals `total_lines`. `tail=true` returns the last `limit` lines for live-following. `eof` is true once the run is terminal and the cursor is at the end. `stream=both` is the whole stdout log followed by the whole stderr log.\n\nTo know whether you hold the whole log, read `capture.status`. `complete` means every byte the container wrote is in the log, `capped` means a stream reached its size cap, `error` means capture ended early, `pending` means the run has not finished, and `unknown` means RunFlow holds no capture record for the run.","operationId":"get_logs_api_v1_runs__track_id__logs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}},{"name":"stream","in":"query","required":false,"schema":{"type":"string","default":"both","title":"Stream"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"tail","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Tail"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/utilization":{"get":{"summary":"Get Utilization","description":"Returns a run's CPU, memory and network samples, optionally bounded by `from_ts` and `to_ts`. While the run is running, the latest live sample is first in the list. Answers 404 `Run not found` for an unknown run.","operationId":"get_utilization_api_v1_runs__track_id__utilization_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}},{"name":"from_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Ts"}},{"name":"to_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Ts"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UtilizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/pause":{"post":{"summary":"Pause Run","description":"Pauses a running run. Requires the `runflow_run_control` permission. Answers 409 `invalid_state` when the run is not `running`, 409 `No worker found for this run` when no worker holds it, and 404 `Run not found` for an unknown run.","operationId":"pause_run_api_v1_runs__track_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Pause Run Api V1 Runs  Track Id  Pause Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/resume":{"post":{"summary":"Resume Run","description":"Resumes a paused run. Requires the `runflow_run_control` permission. Answers 409 `invalid_state` when the run is not `paused`, 409 `No worker found for this run` when no worker holds it, and 404 `Run not found` for an unknown run.","operationId":"resume_run_api_v1_runs__track_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Resume Run Api V1 Runs  Track Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/stop":{"post":{"summary":"Stop Run","description":"Stops a run gracefully. The run moves to `stopping` and then to a terminal state. Requires the `runflow_run_control` permission. Answers 409 `already_terminal` for a finished run, 409 `No worker found for this run` when no worker holds it, and 409 `not_stoppable` when the run is already stopping or has just left its worker.","operationId":"stop_run_api_v1_runs__track_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Stop Run Api V1 Runs  Track Id  Stop Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/kill":{"post":{"summary":"Kill Run","description":"Kills a run immediately. The run ends in the `killed` state once its container exits. Requires the `runflow_run_control` permission. Answers 409 `already_terminal` for a finished run, 409 `No worker found for this run` when no worker holds it, and 404 `Run not found` for an unknown run.","operationId":"kill_run_api_v1_runs__track_id__kill_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Kill Run Api V1 Runs  Track Id  Kill Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/builds":{"post":{"summary":"Submit Build","operationId":"submit_build_api_v1_builds_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildSubmitRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Builds a Dockerfile from a GitHub repository at a pinned commit and pushes the image to `push_ref`. Answers 202 with `track_id`. A build is a run of kind `build`, and its logs, events and kill endpoints work on that `track_id`. Requires the `runflow_run_submit` permission and counts against `max_daily_runs`.\n\n`idempotency_key` makes the submit safe to retry. A repeat with the same build request answers 200 with `\"idempotent_replay\": true`, and a repeat with a different request answers 409 with code `idempotency_key_reused`.\n\nErrors: 409 `image_builder_unavailable` on a node that does not offer builds. 403 `build_not_permitted` on a metered tier or for a tenant without a build prefix. 422 for an invalid request or a resource above the node's build ceiling. 409 `push_ref_exists` when the tag is already in the registry. 503 `registry_unavailable` when the registry cannot be checked. 429 `daily_quota_exceeded`."},"get":{"summary":"List Builds","operationId":"list_builds_api_v1_builds_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Filter"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunStatus"},"title":"Response List Builds Api V1 Builds Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Lists the caller's image builds in the same shape as runs. Query parameters are `state_filter`, `tag`, `limit` (default 50) and `offset`. An unknown `state_filter` value is refused with 422."}},"/api/v1/builds/{track_id}":{"get":{"summary":"Get Build","operationId":"get_build_api_v1_builds__track_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Returns one build's status. `build` holds the build request and `build_result` the pushed reference and manifest digest. A build ends `exited` with `exit_code` 0 when the image is pushed and verified, or `timeout`, `killed` or `failed`. Answers 404 `Build not found` when the id is unknown or is not a build."}},"/api/v1/builds/{track_id}/kill":{"post":{"summary":"Kill Build","operationId":"kill_build_api_v1_builds__track_id__kill_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Kill Build Api V1 Builds  Track Id  Kill Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Stops a build and every process it started. Requires the `runflow_run_control` permission. Answers 404 `Build not found` when the id is unknown or is not a build, and 409 `already_terminal` for a finished build."}},"/health":{"get":{"summary":"Health Endpoint","operationId":"health_endpoint_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Endpoint Health Get"}}}}},"description":"Reports the health of this node. Needs no API key and answers GET and HEAD.\n\nThe status code is 200 whether `status` is `healthy` or `degraded`. Read `status` and the component fields (`postgres`, `redis`, `docker`, `webhook_dispatcher`, `disk`) to tell them apart.\n\n`capabilities` lists the optional features this node offers, from `run_usage`, `memory_admission`, `run_requests`, `build` and `build_only`. A node that offers builds reports its build ceilings in `builds`."}},"/api/v1/usage":{"get":{"summary":"Get Usage Endpoint","description":"Reports the caller's tier, enforced limits and current usage. For an untiered tenant, `tier` is null, `metered` is false and `limits` holds its own quotas.\n\n`limits` holds every enforced ceiling, including the request-rate limit in `requests_per_second` and `request_burst`. The `active_*` counts and `runs_today` are read from the same counters the limits are enforced against. On a metered tier `usage` lists the metering policies. `usage_error` is present only when metering cannot be reached.","operationId":"get_usage_endpoint_api_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse","additionalProperties":true,"type":"object","title":"Response Get Usage Endpoint Api V1 Usage Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/audit":{"get":{"summary":"List Audit Endpoint","description":"Returns the calling tenant's audit trail, newest first. Filter by `action` or `resource_id`. `limit` defaults to 100 and is clamped to between 1 and 1,000.","operationId":"list_audit_endpoint_api_v1_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"resource_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntry"},"title":"Response List Audit Endpoint Api V1 Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenant/quotas":{"get":{"summary":"Get Quotas","description":"Returns the tenant's quotas as they are enforced.","operationId":"get_quotas_api_v1_tenant_quotas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantQuotas"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"summary":"Update Quotas","description":"Replaces every tenant quota. Requires the `runflow_tenant_admin` permission.\n\nThe body must contain every field. A partial body is refused with 422 and `\"error\": \"partial_quota_replace\"`, listing the `missing_fields`. Use PATCH to change some limits and leave the rest as they are.\n\nValues are clamped to this node's ceilings, and the response is what was stored. A `working_hours_tjp` calendar that is too large or cannot be parsed is refused with 422.","operationId":"update_quotas_api_v1_tenant_quotas_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantQuotas"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantQuotas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"summary":"Patch Quotas","description":"Changes the quota fields in the body and leaves every other quota at its current value. Requires the `runflow_tenant_admin` permission.\n\nAnswers 422 with `unknown_quota_fields` for a field name that is not a quota, `empty_patch` for an empty body, and `invalid_quota_value` for a value out of bounds. Values are clamped to this node's ceilings, and the response is what was stored.","operationId":"patch_quotas_api_v1_tenant_quotas_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Changes"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantQuotas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/workflows":{"post":{"summary":"Submit Workflow","description":"Submits a DAG workflow. Answers 202 with `workflow_id` and `status` `pending`. Requires the `runflow_workflow_submit` permission.\n\n`scheduled_start` holds every node until that time. A value in the past starts the workflow at the next tick. An approval gate without `approval_timeout_seconds` gets a default wait, and a tier with a maximum wait lowers larger values to it.\n\nErrors: 400 `invalid_image:<ref>`, `invalid_graph`, `cyclic_graph` or `too_many_nodes`. 403 `image_not_permitted:<ref>`, `image_not_allowed:<ref>` or `sandbox_not_permitted:<ref>`. 409 `node_build_only` on a node that only builds images. 429 `workflow_quota_exceeded` at the concurrent-workflow cap.","operationId":"submit_workflow_api_v1_workflows_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowSubmitRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Workflows Endpoint","description":"Lists the caller's workflows. Query parameters are `state_filter`, `tag`, `limit` (default 50), `offset` and `template_id`, which returns only the instances of one template. Workflow states are `pending`, `running`, `paused`, `succeeded`, `failed` and `cancelled`. An unknown `state_filter` value is refused with 422.","operationId":"list_workflows_endpoint_api_v1_workflows_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Filter"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"template_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStatus"},"title":"Response List Workflows Endpoint Api V1 Workflows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}":{"get":{"summary":"Get Workflow Endpoint","description":"Returns a workflow's live graph: its state, every node's state and attempt, and its edges. Answers 404 `Workflow not found` for an unknown or deleted workflow.","operationId":"get_workflow_endpoint_api_v1_workflows__workflow_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Workflow Endpoint","description":"Deletes a workflow. A workflow that is still active is cancelled first, exactly as `POST .../cancel` does. Its in-flight node runs are killed, and every non-terminal node and the workflow itself are marked `cancelled` before the workflow is deleted. An already-terminal workflow keeps its final state. Requires the `runflow_workflow_control` permission.\n\nAfter deletion, `GET .../nodes/{ref}` still returns each node's final state. Every other read and control endpoint answers 404.","operationId":"delete_workflow_endpoint_api_v1_workflows__workflow_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Workflow Endpoint Api V1 Workflows  Workflow Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/nodes/{ref}":{"get":{"summary":"Get Workflow Node Endpoint","description":"Returns one node's detail, including the `track_id` of every attempt and the node's output.\n\nThis read still works after its workflow is deleted. Deletion cancels the workflow first, and the state returned is final. An approval system can use it to confirm that a gate will never be decided. Every other workflow read and control endpoint answers 404 for a deleted workflow. Answers 404 `Workflow not found` or `Node not found` otherwise.","operationId":"get_workflow_node_endpoint_api_v1_workflows__workflow_id__nodes__ref__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowNodeDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/result":{"get":{"summary":"Get Workflow Result Endpoint","description":"Returns a finished workflow's result: its state, `duration_seconds`, each node's final state, exit code, attempts and output, and the refs in `failed_nodes`. Answers 409 `not_terminal` while the workflow is still active.","operationId":"get_workflow_result_endpoint_api_v1_workflows__workflow_id__result_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/cancel":{"post":{"summary":"Cancel Workflow Endpoint","description":"Cancels a workflow. In-flight node runs are killed, and every node that has not finished is marked `cancelled`. Requires the `runflow_workflow_control` permission. Answers 409 `already_terminal` for a finished workflow.","operationId":"cancel_workflow_endpoint_api_v1_workflows__workflow_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cancel Workflow Endpoint Api V1 Workflows  Workflow Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/pause":{"post":{"summary":"Pause Workflow Endpoint","description":"Pauses a workflow until you resume it. The engine starts no new nodes, and node runs already in flight complete. Answers 409 `not_pausable` unless the workflow is `pending` or `running`.","operationId":"pause_workflow_endpoint_api_v1_workflows__workflow_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Pause Workflow Endpoint Api V1 Workflows  Workflow Id  Pause Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/resume":{"post":{"summary":"Resume Workflow Endpoint","description":"Resumes a paused workflow. Answers 409 `not_paused` when the workflow is not paused.","operationId":"resume_workflow_endpoint_api_v1_workflows__workflow_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Resume Workflow Endpoint Api V1 Workflows  Workflow Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/nodes/{ref}/retry":{"post":{"summary":"Retry Node Endpoint","description":"Retries a finished node and everything downstream of it. Finished nodes in that set are reset to pending and run again, and a terminal or paused workflow becomes active. Answers 409 `node_not_terminal` when the node has not finished, and 429 when reactivating the workflow would exceed `max_concurrent_workflows`.","operationId":"retry_node_endpoint_api_v1_workflows__workflow_id__nodes__ref__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Retry Node Endpoint Api V1 Workflows  Workflow Id  Nodes  Ref  Retry Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/nodes/{ref}/approve":{"post":{"summary":"Approve Node Endpoint","description":"Approves an approval gate that is waiting for a decision. The node succeeds and its `on_success` edges fire on the next engine tick.\n\nThe body is optional. Send `{\"actor\": \"...\"}` to record who decided. RunFlow records the actor as caller-asserted and does not verify it. Without an actor the decision is recorded as unattributed.\n\nA 409 carries one of two `detail` values. `not_awaiting_approval` means the gate has already been decided and can be treated as success. `not_an_approval_node` means the ref names a node that is not a gate. Branch on `detail`. A missing workflow or node is 404.","operationId":"approve_node_endpoint_api_v1_workflows__workflow_id__nodes__ref__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/NodeDecisionRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Approve Node Endpoint Api V1 Workflows  Workflow Id  Nodes  Ref  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/nodes/{ref}/reject":{"post":{"summary":"Reject Node Endpoint","description":"Rejects an approval gate that is waiting for a decision. The node fails and its `on_failure` edges fire.\n\nSend `{\"actor\": \"...\"}` in the optional body to record who decided. RunFlow records the actor as caller-asserted and does not verify it. Answers 409 `not_awaiting_approval` or `not_an_approval_node`, and 404 for a missing workflow or node.","operationId":"reject_node_endpoint_api_v1_workflows__workflow_id__nodes__ref__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/NodeDecisionRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Reject Node Endpoint Api V1 Workflows  Workflow Id  Nodes  Ref  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/events":{"get":{"summary":"Get Workflow Events Endpoint","description":"Returns workflow and node events after the cursor `since`, oldest first, up to `limit` (default 200). Replay from `since=0`. To follow a workflow, poll again with the highest `id` you have seen.","operationId":"get_workflow_events_endpoint_api_v1_workflows__workflow_id__events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowEvent"},"title":"Response Get Workflow Events Endpoint Api V1 Workflows  Workflow Id  Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates":{"post":{"summary":"Create Template","description":"Stores a reusable, parameterized workflow definition and answers 201 with the template. Requires the `runflow_template_write` permission.\n\n`name` must match `^[a-z][a-z0-9-]{1,62}$`. Every placeholder in the definition must be a declared parameter, and images are checked against your tier when the template is stored and again on every run. Errors: 422 for an invalid name, parameter schema or placeholder. 409 `template_name_taken`. 429 `template_quota_exceeded`.","operationId":"create_template_api_v1_templates_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Templates","description":"Lists the caller's templates that have not been deleted. Page with `limit` (default 50) and `offset`.","operationId":"list_templates_api_v1_templates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSummary"},"title":"Response List Templates Api V1 Templates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{ref}":{"get":{"summary":"Get Template","description":"Returns one template by id or name. The response includes its declared parameters, its versions and the health of its triggers. Pass `version` to read an earlier version. Secret-pattern env keys in the definition are redacted. Answers 404 `template_not_found` for an unknown template, one that belongs to another tenant, or a ref that is neither a valid id nor a valid name.","operationId":"get_template_api_v1_templates__ref__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Template","description":"Renames or describes a template, or publishes a new version. Only the fields you send change.\n\nSending `definition` or `params` creates a new version. Earlier versions stay intact, and a run or trigger pinned to a version keeps executing it. Sending only `name` or `description` leaves the version unchanged. `\"name\": null` clears the name. Answers 409 `template_name_taken` or `template_version_limit`, and 422 for an invalid definition or parameters.","operationId":"update_template_api_v1_templates__ref__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Template","description":"Soft-deletes a template. Its name and quota slot are released, and its triggers are disabled. Workflows already launched from it are unaffected, because each holds its own copy of the graph. Answers 404 `template_not_found` for an unknown template.","operationId":"delete_template_api_v1_templates__ref__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Template Api V1 Templates  Ref  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{ref}/run":{"post":{"summary":"Run Template","description":"Runs a template as an ordinary workflow, substituting the parameters you supply. Answers 202 with `workflow_id`, `template_id`, `version` and `start_after`.\n\nRequires both `runflow_template_run` and `runflow_workflow_submit`. The run goes through the same validation, tier and quota checks as `POST /api/v1/workflows`, evaluated against your tier at the time of the call. Answers 404 `template_not_found` for an unknown template or version, and 422 when the parameters do not satisfy the template's declarations.","operationId":"run_template_api_v1_templates__ref__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TemplateRunRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{ref}/triggers":{"post":{"summary":"Create Trigger","description":"Registers a cron trigger that runs a template on a schedule, and answers 201 with the trigger. Requires the `runflow_template_write` permission.\n\nThe trigger stores the template's `template_id`. Renaming the template, or deleting it and creating another under the same name, does not move a live trigger to a different template. `params` are checked against the template's declarations when you register.\n\nErrors: 404 `template_not_found`. 422 `invalid_params`, `invalid_schedule` or `schedule_too_frequent` when the cron fires more often than your tier allows. 429 `trigger_quota_exceeded`.","operationId":"create_trigger_api_v1_templates__ref__triggers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/triggers":{"get":{"summary":"List Triggers Endpoint","description":"Lists the caller's triggers, optionally for one `template_id`, up to `limit` (default 100). Secret-pattern `params` keys are redacted.","operationId":"list_triggers_endpoint_api_v1_triggers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TriggerView"},"title":"Response List Triggers Endpoint Api V1 Triggers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/triggers/{trigger_id}":{"get":{"summary":"Get Trigger Endpoint","description":"Returns one trigger. A trigger that does not exist or belongs to another tenant answers 404 `trigger_not_found`. RunFlow never answers 403 here, because that would confirm another tenant holds the id.","operationId":"get_trigger_endpoint_api_v1_triggers__trigger_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","title":"Trigger Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Trigger Endpoint","description":"Changes a trigger's `cron`, `timezone`, `params`, `overlap_policy` or `enabled`. Set `enabled` to pause or resume it.\n\nRe-enabling computes `next_fire_at` from the current time. A paused trigger does not fire for the occurrences it missed. Re-enabling also clears `consecutive_failures` and the disable reason.","operationId":"update_trigger_endpoint_api_v1_triggers__trigger_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","title":"Trigger Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Trigger Endpoint","description":"Deletes a trigger and releases its quota slot. Answers 404 `trigger_not_found` for an unknown trigger.","operationId":"delete_trigger_endpoint_api_v1_triggers__trigger_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","title":"Trigger Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Trigger Endpoint Api V1 Triggers  Trigger Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/triggers/{trigger_id}/fires":{"get":{"summary":"List Trigger Fires Endpoint","description":"Returns a trigger's recent fires, up to `limit` (default 50). Each entry says when it fired, the outcome, and the workflow it started or the reason it did not. Read it to find an unattended trigger whose fires are being refused.","operationId":"list_trigger_fires_endpoint_api_v1_triggers__trigger_id__fires_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","title":"Trigger Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TriggerFireView"},"title":"Response List Trigger Fires Endpoint Api V1 Triggers  Trigger Id  Fires Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks":{"get":{"summary":"List Webhooks","description":"Lists the tenant's webhook endpoints. The signing secret is never returned.","operationId":"list_webhooks_api_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookEndpointView"},"type":"array","title":"Response List Webhooks Api V1 Webhooks Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"summary":"Create Webhook","description":"Registers a webhook endpoint and answers 201. Requires the `runflow_webhook_admin` permission.\n\n`url` must use `https` and carry no userinfo. `events` defaults to `[\"run.terminal\"]`. The signing secret is returned exactly once, in this response. A secret you supply is used verbatim. When you omit it, RunFlow generates 32 random bytes and returns them as 64 hex characters, and the HMAC key is the decoded bytes.\n\nAnswers 400 for an invalid URL or event name and 429 `webhook_quota_exceeded` at the endpoint cap.","operationId":"create_webhook_api_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/webhooks/{endpoint_id}":{"get":{"summary":"Get Webhook","description":"Returns one webhook endpoint without its secret. Answers 404 `Webhook endpoint not found` when the endpoint does not exist or belongs to another tenant.","operationId":"get_webhook_api_v1_webhooks__endpoint_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Webhook","description":"Changes only the fields you send and leaves the rest of the endpoint unchanged.\n\nSetting `active: true` resets `consecutive_failures` and clears the disable state, and leaves `dead_deliveries_total` unchanged. Sending `secret` replaces the signing secret with the value you supply and sets `secret_origin` to `supplied`. An empty `secret` is refused with 422 `empty_secret`. Use `clear_resource_filter` to remove a resource filter.","operationId":"update_webhook_api_v1_webhooks__endpoint_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Webhook","description":"Deletes a webhook endpoint and cancels its pending deliveries.","operationId":"delete_webhook_api_v1_webhooks__endpoint_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Webhook Api V1 Webhooks  Endpoint Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{endpoint_id}/test":{"post":{"summary":"Test Webhook","description":"Enqueues a signed test delivery to the endpoint and returns its `delivery_id` and `event_type`.\n\nWith no body it sends a `webhook.test` event, whatever the endpoint subscribes to. Send `event_type` to rehearse a real subscription such as `tenant.suspended`. The event must be in the catalog (422 `unknown_event_type`) and matched by the endpoint's subscription (422 `event_not_subscribed`). A rehearsal payload carries `\"test\": true`.\n\nA test delivery does not change the endpoint's health. A failed test does not raise `consecutive_failures` or `dead_deliveries_total`, does not count toward auto-disable, and does not send `tenant.delivery_dead`. Its outcome is recorded on its own delivery row, which the endpoint's deliveries list returns. Each call counts against the per-tenant rate limit.","operationId":"test_webhook_api_v1_webhooks__endpoint_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/WebhookTestRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{endpoint_id}/rotate-secret":{"post":{"summary":"Rotate Webhook Secret","description":"Generates a new signing secret for the endpoint and returns it exactly once, as 64 hex characters. The HMAC key is the decoded bytes, and `secret_origin` becomes `generated`. Receivers fail verification until they hold the new secret. To rotate without a gap, install a secret of your own in the receiver first and send it with PATCH.","operationId":"rotate_webhook_secret_api_v1_webhooks__endpoint_id__rotate_secret_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRotateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{endpoint_id}/deliveries":{"get":{"summary":"List Endpoint Deliveries","description":"Lists an endpoint's deliveries. Query parameters are `state_filter`, `since`, `before`, `limit` (default 100) and `order` (`asc` or `desc`, default `asc`).","operationId":"list_endpoint_deliveries_api_v1_webhooks__endpoint_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}},{"name":"state_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Filter"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"asc","title":"Order"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryView"},"title":"Response List Endpoint Deliveries Api V1 Webhooks  Endpoint Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/deliveries/{delivery_id}":{"get":{"summary":"Get Delivery","description":"Returns one delivery. Answers 404 `Delivery not found` when the delivery does not exist or belongs to another tenant.","operationId":"get_delivery_api_v1_webhooks_deliveries__delivery_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"integer","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/deliveries/{delivery_id}/redeliver":{"post":{"summary":"Redeliver","description":"Enqueues a fresh delivery of the same event with the original `event_id`, and returns the new `delivery_id`. Answers 404 `Delivery not found` for an unknown delivery.","operationId":"redeliver_api_v1_webhooks_deliveries__delivery_id__redeliver_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"integer","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRedeliverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{track_id}/deliveries":{"get":{"summary":"List Run Deliveries","description":"Lists up to 100 webhook deliveries for a run. Answers 404 `Run not found` when the run does not belong to the tenant.","operationId":"list_run_deliveries_api_v1_runs__track_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"track_id","in":"path","required":true,"schema":{"type":"string","title":"Track Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryView"},"title":"Response List Run Deliveries Api V1 Runs  Track Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}/deliveries":{"get":{"summary":"List Workflow Deliveries","description":"Lists up to 100 webhook deliveries for a workflow. Answers 404 `Workflow not found` when the workflow does not belong to the tenant.","operationId":"list_workflow_deliveries_api_v1_workflows__workflow_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryView"},"title":"Response List Workflow Deliveries Api V1 Workflows  Workflow Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/timers":{"post":{"summary":"Create Timer","description":"Schedules a signed `timer.fired` webhook for a future instant. A timer starts no container and uses no run quota. Answers 201 with the timer.\n\nUse a timer for an alarm clock. A deferred run spends a `max_daily_runs` slot on the day it is submitted, and when its time comes it needs a worker, an image pull and a container. A pending timer counts only against `max_pending_timers`.\n\n`fire_at` must be timezone-aware and in the future (422 otherwise). The timer fires at the first tick at or after `fire_at`, up to about a second late and never early. `payload` is echoed back in the delivery and is capped at 64 KiB serialized (422 above that). `idempotency_key` allows at most one timer per key. A repeat answers 200 with the existing timer, whatever its state, and schedules nothing new.\n\nAnswers 403 when timers are not enabled for the tenant, and 429 at the pending-timer cap.","operationId":"create_timer_api_v1_timers_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Timers","description":"Lists the tenant's timers, newest first. Query parameters are `state_filter` (`pending`, `fired` or `cancelled`), `label_filter`, `limit` (default 100) and `offset`. `label_filter` is an exact match. A client that lost a create response can find the timer by the label it chose.","operationId":"list_timers_api_v1_timers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"label_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimerView"},"title":"Response List Timers Api V1 Timers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/timers/{timer_id}":{"get":{"summary":"Get Timer","description":"Returns one timer, including `fired_at`, `fire_delay_seconds` and `deliveries_enqueued` once it has fired. Answers 404 `Timer not found` for an unknown timer.","operationId":"get_timer_api_v1_timers__timer_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"timer_id","in":"path","required":true,"schema":{"type":"string","title":"Timer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Cancel Timer","description":"Cancels a pending timer. A timer that has already fired or been cancelled answers 409 `Timer already fired or cancelled; it cannot be cancelled now`. A 409 tells you the delivery may already have gone out. Answers 404 `Timer not found` for an unknown timer.","operationId":"cancel_timer_api_v1_timers__timer_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"timer_id","in":"path","required":true,"schema":{"type":"string","title":"Timer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cancel Timer Api V1 Timers  Timer Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules":{"post":{"summary":"Create Schedule","description":"Registers a recurring schedule that sends a signed `schedule.fired` webhook on each cron occurrence. A schedule starts no container and uses no run quota. Answers 201 with the schedule.\n\n`cron` is evaluated in the IANA `timezone` (default UTC). Your tier's minimum interval applies. `payload` is capped at 64 KiB serialized. `idempotency_key` works as it does for timers, and a repeat answers 200 with the existing schedule. Schedules use the timer permissions.\n\nErrors: 422 for an invalid cron or timezone, a schedule that never fires, or a payload over the cap. 403 when schedules are not enabled for the tenant. 429 at the `max_schedules` cap.","operationId":"create_schedule_api_v1_schedules_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Schedules","description":"Lists the tenant's schedules, newest first. Query parameters are `enabled_filter`, `label_filter`, `limit` (default 100) and `offset`.","operationId":"list_schedules_api_v1_schedules_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled Filter"}},{"name":"label_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleView"},"title":"Response List Schedules Api V1 Schedules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules/{schedule_id}":{"get":{"summary":"Get Schedule","description":"Returns one schedule. Answers 404 `Schedule not found` when it does not exist or belongs to another tenant.","operationId":"get_schedule_api_v1_schedules__schedule_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Schedule","description":"Enables or disables a schedule.\n\nEnabling computes `next_fire_at` from the current time. The schedule does not fire for the occurrences it missed while disabled. After a service outage, a schedule that stayed enabled still fires its most recent missed occurrence. Re-enabling counts against `max_schedules` and answers 429 at the cap.","operationId":"update_schedule_api_v1_schedules__schedule_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Schedule","description":"Deletes a schedule and its fire ledger. Its delivery history stays until it reaches the end of its own retention period.","operationId":"delete_schedule_api_v1_schedules__schedule_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Schedule Api V1 Schedules  Schedule Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules/{schedule_id}/fires":{"get":{"summary":"List Schedule Fires","description":"Returns the schedule's occurrence ledger, newest first, up to `limit` (default 50). Each entry records the fire time, the outcome, `fire_delay_seconds` and `deliveries_enqueued`. Reconcile your own records against it.","operationId":"list_schedule_fires_api_v1_schedules__schedule_id__fires_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleFireView"},"title":"Response List Schedule Fires Api V1 Schedules  Schedule Id  Fires Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AuditEntry":{"properties":{"id":{"type":"integer","title":"Id"},"action":{"type":"string","title":"Action"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id","description":"track_id / workflow_id / endpoint_id the action targeted"},"ts":{"type":"string","format":"date-time","title":"Ts"},"success":{"type":"boolean","title":"Success"},"detail":{"additionalProperties":true,"type":"object","title":"Detail"}},"type":"object","required":["id","action","ts","success"],"title":"AuditEntry","description":"One entry in the tenant's audit trail. `resource_id` is the `track_id`, `workflow_id` or `endpoint_id` the action targeted. `detail` never carries a secret. It records which fields changed and the shape of a run, and never a webhook secret, an env value or the value of a `secret: true` template parameter."},"BuildContext":{"properties":{"git_url":{"type":"string","maxLength":200,"title":"Git Url","description":"https://github.com/<owner>/<repo>[.git]"},"sha":{"type":"string","title":"Sha","description":"Commit to build, 40 lowercase hex"},"submodules":{"type":"boolean","title":"Submodules","default":false},"dir":{"type":"string","maxLength":256,"title":"Dir","description":"Context directory within the repo","default":"."}},"additionalProperties":false,"type":"object","required":["git_url","sha"],"title":"BuildContext","description":"The source of an image build: a GitHub repository in `git_url`, the commit to build in `sha` (40 lowercase hex characters), whether to follow `submodules`, and the context directory `dir` within the repository. Submodules are followed only to `https://github.com/` repositories. Unknown fields are refused with 422."},"BuildSubmitRequest":{"properties":{"context":{"$ref":"#/components/schemas/BuildContext"},"dockerfile":{"type":"string","maxLength":256,"title":"Dockerfile","default":"Dockerfile"},"target":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Target"},"build_args":{"additionalProperties":{"type":"string"},"type":"object","title":"Build Args"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"push_ref":{"type":"string","maxLength":512,"title":"Push Ref"},"pull_refs":{"items":{"type":"string"},"type":"array","title":"Pull Refs"},"cache_scope":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Cache Scope"},"cache_from":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Cache From"},"cpu_limit":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Cpu Limit"},"memory_limit_mb":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Memory Limit Mb"},"timeout_seconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Timeout Seconds"},"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"env":{"additionalProperties":{"type":"string"},"type":"object","title":"Env","description":"GIT_TOKEN only"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["context","push_ref"],"title":"BuildSubmitRequest","description":"Body of `POST /api/v1/builds`. Unknown fields are refused with 422.\n\n`dockerfile` and `context.dir` are relative to the repository root. `push_ref` has the form `<registry>/<your build prefix><owner>/<repo>/<image>:<tag>` with no digest. `pull_refs` lists private images the build may pull, each pinned by `@sha256:` digest. `cache_scope` keeps a layer cache per tenant and scope, and `cache_from` imports an exported cache read-only. Omitted `cpu_limit`, `memory_limit_mb` and `timeout_seconds` default to the node's build ceilings. `env` accepts only `GIT_TOKEN`, which is passed to git and never to the build. `build_args` keys starting with `BUILDKIT_` are refused."},"BuildSubmitResponse":{"properties":{"track_id":{"type":"string","title":"Track Id"},"status":{"type":"string","title":"Status","default":"scheduled"},"kind":{"type":"string","title":"Kind","default":"build"},"idempotent_replay":{"type":"boolean","title":"Idempotent Replay","default":false}},"type":"object","required":["track_id"],"title":"BuildSubmitResponse","description":"Response to `POST /api/v1/builds`: the build's `track_id`, its `status`, `kind` (`build`) and `idempotent_replay`, which is true when an earlier build with the same `idempotency_key` was returned."},"EdgeSpec":{"properties":{"from":{"type":"string","title":"From","description":"upstream node ref"},"to":{"type":"string","title":"To","description":"downstream node ref"},"condition":{"type":"string","enum":["on_success","on_failure","always"],"title":"Condition","default":"on_success"}},"type":"object","required":["from","to"],"title":"EdgeSpec","description":"A directed dependency between two nodes, from `from` to `to`. `condition` is `on_success` (default), `on_failure` or `always`."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError","description":"Body of a 422 request-validation error. `detail` is a list of errors, each with `loc`, `msg` and `type`. The submitted value is not echoed back."},"InlineWebhook":{"properties":{"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string","enum":["*","node.*","node.cancelled","node.failed","node.retrying","node.running","node.skipped","node.succeeded","node.waiting_approval","run.*","run.exited","run.failed","run.killed","run.paused","run.pulling","run.queued","run.resumed","run.running","run.scheduled","run.stopping","run.terminal","run.timeout","schedule.*","schedule.fired","tenant.*","tenant.delivery_dead","tenant.suspended","tenant.tier_changed","tenant.timer_delivery_dead","tenant.trigger_disabled","tenant.trigger_unhealthy","tenant.unsuspended","tenant.webhook_endpoint_degraded","tenant.webhook_endpoint_disabled","timer.*","timer.fired","webhook.test","workflow.*","workflow.cancelled","workflow.failed","workflow.paused","workflow.resumed","workflow.running","workflow.succeeded","workflow.terminal"]},"type":"array","title":"Events"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},"additionalProperties":false,"type":"object","required":["url"],"title":"InlineWebhook","description":"A webhook declared on a submit body, scoped to that one run or workflow. Unknown keys are refused with 422, which stops a misspelled `secret` from producing unsigned deliveries. `events` defaults to `[\"run.terminal\"]`. On a workflow, list the events you want, such as `workflow.terminal`."},"LogCapture":{"properties":{"status":{"type":"string","enum":["pending","complete","capped","error","unknown"],"title":"Status"},"streams":{"additionalProperties":{"$ref":"#/components/schemas/LogStreamCapture"},"type":"object","title":"Streams"}},"type":"object","required":["status"],"title":"LogCapture","description":"Whether RunFlow captured the requested log streams whole. `status` is `complete`, `capped`, `error`, `pending` or `unknown`. `streams` gives each stream's own status with `bytes_received` and `bytes_written`."},"LogResponse":{"properties":{"lines":{"items":{"type":"string"},"type":"array","title":"Lines"},"next_since":{"type":"integer","title":"Next Since"},"eof":{"type":"boolean","title":"Eof"},"total_lines":{"type":"integer","title":"Total Lines","description":"Total lines in the authoritative log. Compare against `next_since` to know whether you hold the whole log: a window that does not say how much it left out cannot be checked by the caller.","default":0},"capture":{"$ref":"#/components/schemas/LogCapture","description":"Whether RunFlow captured the requested streams whole. complete: every byte the container wrote is in the log. capped: the per-stream size cap was reached. error: capture ended early. pending: the run is not finished. unknown: RunFlow holds no capture record."}},"type":"object","required":["lines","next_since","eof"],"title":"LogResponse","description":"Response to `GET /api/v1/runs/{track_id}/logs`: a page of `lines`, the cursor `next_since`, `total_lines`, `eof` and `capture`."},"LogStreamCapture":{"properties":{"status":{"type":"string","enum":["complete","capped","error"],"title":"Status"},"bytes_received":{"type":"integer","title":"Bytes Received","default":0},"bytes_written":{"type":"integer","title":"Bytes Written","default":0},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["status"],"title":"LogStreamCapture","description":"Capture record for one log stream. `status` is `complete`, `capped` or `error`. `bytes_received` and `bytes_written` count the stream's bytes, and `reason` says why capture ended early."},"NodeDecisionRequest":{"properties":{"actor":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Actor","description":"Who decided, as the caller asserts it — an email, a name, an operator id. RunFlow does NOT verify this and records it as caller-asserted. Omit it and the decision is recorded as explicitly unattributed."},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Reason","description":"Optional free text recorded with the decision."}},"type":"object","title":"NodeDecisionRequest","description":"Optional body for approving or rejecting an approval gate. Send `actor` to record who decided. RunFlow does not verify it and stores it as caller-asserted. Omit the body and the decision is recorded as unattributed. `reason` is optional free text."},"NodeSpec":{"properties":{"ref":{"type":"string","maxLength":128,"title":"Ref","description":"unique node id within the workflow"},"type":{"type":"string","enum":["container","approval"],"title":"Type","default":"container"},"image":{"type":"string","title":"Image","description":"Docker image reference (container nodes)","default":""},"command":{"items":{"type":"string"},"type":"array","title":"Command"},"env":{"additionalProperties":{"type":"string"},"type":"object","title":"Env"},"cpu_limit":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Cpu Limit"},"memory_limit_mb":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Memory Limit Mb"},"timeout_seconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Timeout Seconds"},"retries":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Retries","default":0},"retry_backoff_seconds":{"type":"integer","minimum":0.0,"title":"Retry Backoff Seconds","default":10},"start_deadline_seconds":{"anyOf":[{"type":"integer","maximum":86400.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Start Deadline Seconds","description":"container nodes: fail the attempt if it has not started this many seconds after launch, so a node waiting for a worker cannot hold its workflow open"},"sandbox":{"anyOf":[{"type":"string","const":"trusted"},{"type":"null"}],"title":"Sandbox","description":"'trusted' = relaxed sandbox for a trusted, allowlisted image. Honored only for images on the operator's trusted_images allowlist; rejected otherwise."},"inputs_from":{"items":{"type":"string"},"type":"array","title":"Inputs From","description":"upstream node refs whose output to inject as env"},"approval_timeout_seconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Approval Timeout Seconds","description":"approval nodes only: auto-reject the gate after this many seconds"}},"type":"object","required":["ref"],"title":"NodeSpec","description":"One workflow node. `type: \"container\"` runs a Docker image on each attempt. `type: \"approval\"` is a gate that waits for an approve or reject decision and runs no container."},"ResourceFilter":{"properties":{"schedule_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":200},{"type":"null"}],"title":"Schedule Ids"},"timer_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":200},{"type":"null"}],"title":"Timer Ids"},"label_prefix":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Label Prefix"}},"type":"object","title":"ResourceFilter","description":"Restricts which schedules and timers an endpoint receives events for. Without a filter the endpoint hears about every schedule and timer in the tenant. A resource matches when its id is listed or its label starts with `label_prefix`."},"RunResult":{"properties":{"track_id":{"type":"string","title":"Track Id"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"status":{"type":"string","title":"Status"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"stdout_bytes":{"type":"integer","title":"Stdout Bytes"},"stderr_bytes":{"type":"integer","title":"Stderr Bytes"},"stdout_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stdout File"},"stderr_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stderr File"},"result_summary":{"type":"string","title":"Result Summary"},"applied_sandbox":{"anyOf":[{"type":"string","enum":["trusted","hardened","built"]},{"type":"null"}],"title":"Applied Sandbox"},"sandbox_downgrade_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Downgrade Reason"}},"type":"object","required":["track_id","exit_code","status","started_at","finished_at","duration_seconds","stdout_bytes","stderr_bytes","stdout_file","stderr_file","result_summary"],"title":"RunResult","description":"Response to `GET /api/v1/runs/{track_id}/result` for a finished run."},"RunStatus":{"properties":{"track_id":{"type":"string","title":"Track Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"state":{"type":"string","title":"State"},"image":{"type":"string","title":"Image"},"command":{"items":{"type":"string"},"type":"array","title":"Command"},"env":{"additionalProperties":{"type":"string"},"type":"object","title":"Env"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"},"eligible_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Eligible Start"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"oom_killed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Oom Killed","description":"True when the kernel killed a process in the run's container for memory, including a child process while the main process kept running. Null when RunFlow could not read it."},"container_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Container Id"},"worker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Id"},"cpu_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpu Limit"},"memory_limit_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory Limit Mb"},"memory_request_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory Request Mb"},"timeout_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeout Seconds"},"usage":{"$ref":"#/components/schemas/RunUsageReport"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"stdout_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stdout File"},"stderr_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stderr File"},"events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Events"},"scheduling_info":{"anyOf":[{"$ref":"#/components/schemas/SchedulingInfo"},{"type":"null"}]},"applied_sandbox":{"anyOf":[{"type":"string","enum":["trusted","hardened","built"]},{"type":"null"}],"title":"Applied Sandbox"},"sandbox_downgrade_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Downgrade Reason"},"kind":{"type":"string","enum":["run","build"],"title":"Kind","default":"run"},"entrypoint":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entrypoint"},"image_scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Scope"},"build":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Build"},"build_result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Build Result"},"log_capture":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Log Capture"}},"type":"object","required":["track_id","tenant_id","state","image","command","env","submitted_at"],"title":"RunStatus","description":"A run or build as returned by the run and build read endpoints. Secret-pattern `env` keys are redacted."},"RunSubmitRequest":{"properties":{"image":{"type":"string","title":"Image","description":"Docker image reference"},"command":{"items":{"type":"string"},"type":"array","title":"Command","description":"Command arguments"},"env":{"additionalProperties":{"type":"string"},"type":"object","title":"Env","description":"Environment variables"},"scheduled_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Start","description":"ISO-8601 start time (omit for ASAP)"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Absolute deadline (ISO-8601). If the run has not started by this time it is failed as 'expired' instead of dispatched — independent of eligible_start and max_queue_seconds. A naive value is treated as UTC."},"timeout_seconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Timeout Seconds","description":"Max runtime in seconds"},"cpu_limit":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Cpu Limit","description":"CPU limit in cores"},"memory_limit_mb":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Memory Limit Mb","description":"Memory limit in MB"},"memory_request_mb":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Memory Request Mb","description":"Memory (MB) the run is expected to use, at most memory_limit_mb. Admission by memory reserves this; the container is still capped at memory_limit_mb. Omitted means equal to the limit"},"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name","description":"Optional run name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Optional tags"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Idempotency Key","description":"A repeated key returns the existing run (200, idempotent_replay true) instead of creating one. Unique per tenant until the run row is purged by retention"},"webhook":{"anyOf":[{"$ref":"#/components/schemas/InlineWebhook"},{"type":"null"}],"description":"Inline webhook for this run"},"sandbox":{"anyOf":[{"type":"string","enum":["trusted","built"]},{"type":"null"}],"title":"Sandbox","description":"Relaxed sandbox for a trusted, allowlisted image. 'trusted' = writable rootfs + image's own user so the image can run services that genuinely need them (PostgreSQL/Redis initdb). Honored only for images on the operator's trusted_images allowlist; rejected otherwise. 'built' = hardened with a writable rootfs, for a digest-pinned image under the tenant's own build prefix."},"entrypoint":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":16},{"type":"null"}],"title":"Entrypoint","description":"Replaces the image ENTRYPOINT. An empty list clears it."},"image_scope":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Image Scope","description":"A registry path such as ci/<owner>/<repo>/. An image under any build prefix must lie under it, or the run is refused."}},"additionalProperties":false,"type":"object","required":["image"],"title":"RunSubmitRequest","description":"Body of `POST /api/v1/runs`. Unknown fields are refused with 422."},"RunSubmitResponse":{"properties":{"track_id":{"type":"string","title":"Track Id"},"status":{"type":"string","title":"Status","default":"scheduled"},"eligible_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Eligible Start"},"clamped":{"type":"boolean","title":"Clamped","default":false},"idempotent_replay":{"type":"boolean","title":"Idempotent Replay","default":false}},"type":"object","required":["track_id"],"title":"RunSubmitResponse","description":"Response to `POST /api/v1/runs`. `clamped` is true when a resource value you supplied was lowered to a limit. `idempotent_replay` is true when an earlier run with the same `idempotency_key` was returned."},"RunUsageReport":{"properties":{"memory_current_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory Current Mb"},"memory_peak_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory Peak Mb"},"cpu_usage_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpu Usage Seconds"},"cpu_cores_avg_60s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpu Cores Avg 60S"},"sampled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sampled At"},"source":{"type":"string","enum":["cgroup-v2","unavailable"],"title":"Source","default":"unavailable"}},"type":"object","title":"RunUsageReport","description":"A run's measured resource use, read from the container's cgroup v2 files every 2 seconds. Memory is reported in MiB. A null value was not measured and does not mean zero. `source` is `unavailable` when the run cannot be measured."},"ScheduleCreate":{"properties":{"cron":{"type":"string","title":"Cron","description":"5-field crontab expression, evaluated in `timezone`."},"timezone":{"type":"string","title":"Timezone","description":"IANA name (e.g. Europe/London). A UTC offset is refused — it would be wrong for half the year.","default":"UTC"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"Opaque caller data, echoed on every occurrence. Maximum 65536 bytes when serialized as JSON (len(json.dumps(payload).encode('utf-8'))); a larger payload is refused with 422 naming both the actual size and this cap. Send a short reference (an id, a key) and resolve it when the timer fires.","x-maxSerializedBytes":65536},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["cron"],"title":"ScheduleCreate","description":"Body of `POST /api/v1/schedules`. A recurring wake: a cron expression in an IANA timezone that sends `schedule.fired` on each occurrence. It starts no container and uses no run quota. The payload is an opaque echo with the same size cap and encryption as a timer's."},"ScheduleFireView":{"properties":{"fire_time":{"type":"string","format":"date-time","title":"Fire Time"},"outcome":{"type":"string","title":"Outcome"},"deliveries_enqueued":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deliveries Enqueued"},"fire_delay_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fire Delay Seconds"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["fire_time","outcome","created_at"],"title":"ScheduleFireView","description":"One occurrence in a schedule's fire ledger."},"ScheduleUpdateRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"ScheduleUpdateRequest","description":"Body of `PATCH /api/v1/schedules/{schedule_id}`. Its only field is `enabled`."},"ScheduleView":{"properties":{"schedule_id":{"type":"string","title":"Schedule Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"cron":{"type":"string","title":"Cron"},"timezone":{"type":"string","title":"Timezone"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"next_fire_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Fire At"},"last_fire_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Fire At"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"},"payload_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payload Error"}},"type":"object","required":["schedule_id","tenant_id","cron","timezone","enabled","created_at"],"title":"ScheduleView","description":"A recurring schedule as returned by the API."},"SchedulingInfo":{"properties":{"eligible_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Eligible Start"},"working_hours_applied":{"type":"boolean","title":"Working Hours Applied","default":false},"queue_position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Queue Position"},"estimated_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Estimated Start"},"effective_concurrency_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Effective Concurrency Limit"}},"type":"object","title":"SchedulingInfo","description":"Scheduling details for a run: when it becomes eligible to start, its queue position, an estimated start, whether working hours applied, and the effective concurrency limit."},"TemplateCreateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional tenant-unique slug to address the template by, ^[a-z][a-z0-9-]{1,62}$. The template_id always works regardless."},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"params":{"items":{"$ref":"#/components/schemas/TemplateParamSpec"},"type":"array","maxItems":64,"title":"Params"},"definition":{"$ref":"#/components/schemas/TemplateDefinition"}},"additionalProperties":false,"type":"object","required":["definition"],"title":"TemplateCreateRequest","description":"Body of `POST /api/v1/templates`. Unknown fields are refused with 422."},"TemplateDefinition":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"failure_policy":{"type":"string","enum":["fail_fast","continue"],"title":"Failure Policy","default":"fail_fast"},"nodes":{"items":{"$ref":"#/components/schemas/NodeSpec"},"type":"array","maxItems":1000,"minItems":1,"title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/EdgeSpec"},"type":"array","maxItems":10000,"title":"Edges"},"webhook":{"anyOf":[{"$ref":"#/components/schemas/InlineWebhook"},{"type":"null"}],"description":"Inline workflow webhook"}},"additionalProperties":false,"type":"object","required":["nodes"],"title":"TemplateDefinition","description":"A workflow definition as stored in a template. An unknown or misspelled field is refused with 422 when the template is stored."},"TemplateParamSpec":{"properties":{"name":{"type":"string","maxLength":64,"title":"Name","description":"placeholder name: ${{ name }}"},"type":{"type":"string","enum":["string","integer","number","boolean","enum"],"title":"Type","default":"string"},"required":{"type":"boolean","title":"Required","default":false},"default":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Default"},"description":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Description"},"enum":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":64},{"type":"null"}],"title":"Enum"},"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"},"max_length":{"anyOf":[{"type":"integer","maximum":8192.0,"minimum":1.0},{"type":"null"}],"title":"Max Length"},"pattern":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Pattern"},"secret":{"type":"boolean","title":"Secret","description":"Never echo this parameter's value back in any API response (independent of the env-key redaction pattern).","default":false}},"additionalProperties":false,"type":"object","required":["name"],"title":"TemplateParamSpec","description":"One declared template parameter. The declarations make a bad run request fail with 422 before any container starts, and `GET /api/v1/templates/{ref}` publishes them. `enum` applies to enum parameters, `min` and `max` to integer and number parameters, and `max_length` and `pattern` to string parameters."},"TemplateRunRequest":{"properties":{"params":{"additionalProperties":true,"type":"object","maxProperties":64,"title":"Params"},"version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Version","description":"pin a version; omit for the latest"},"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name","description":"override the workflow's display name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"tags ADDED to the definition's tags"},"scheduled_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Start","description":"ISO-8601; no node starts before this time"},"webhook":{"anyOf":[{"$ref":"#/components/schemas/InlineWebhook"},{"type":"null"}],"description":"replaces the definition's inline webhook for this run"}},"additionalProperties":false,"type":"object","title":"TemplateRunRequest","description":"Body of `POST /api/v1/templates/{ref}/run`. The body is optional."},"TemplateRunResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"template_id":{"type":"string","title":"Template Id"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"version":{"type":"integer","title":"Version"},"status":{"type":"string","title":"Status","default":"pending"},"start_after":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start After"}},"type":"object","required":["workflow_id","template_id","version"],"title":"TemplateRunResponse","description":"Response to `POST /api/v1/templates/{ref}/run`."},"TemplateSummary":{"properties":{"template_id":{"type":"string","title":"Template Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"version":{"type":"integer","title":"Version"},"params":{"items":{"type":"string"},"type":"array","title":"Params","description":"declared parameter names"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["template_id","version","created_at","updated_at"],"title":"TemplateSummary","description":"One template in the list returned by `GET /api/v1/templates`."},"TemplateUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"params":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateParamSpec"},"type":"array","maxItems":64},{"type":"null"}],"title":"Params"},"definition":{"anyOf":[{"$ref":"#/components/schemas/TemplateDefinition"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"TemplateUpdateRequest","description":"Body of `PATCH /api/v1/templates/{ref}`. Only the fields you send change. Sending `definition` or `params` publishes a new version. Sending only `name` or `description` updates the template in place and keeps its current version. `\"name\": null` clears the name."},"TemplateVersionView":{"properties":{"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["version","created_at"],"title":"TemplateVersionView","description":"One stored version of a template."},"TemplateView":{"properties":{"template_id":{"type":"string","title":"Template Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"version":{"type":"integer","title":"Version"},"params":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Params"},"definition":{"additionalProperties":true,"type":"object","title":"Definition"},"triggers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Triggers"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"versions":{"items":{"$ref":"#/components/schemas/TemplateVersionView"},"type":"array","title":"Versions"}},"type":"object","required":["template_id","tenant_id","version","created_at","updated_at"],"title":"TemplateView","description":"A template as returned by the API. In `definition`, secret-pattern env keys read as `***REDACTED***`, as they do in run and node responses. The container still receives the real value."},"TenantQuotas":{"properties":{"max_concurrent_runs":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Max Concurrent Runs","default":10},"max_daily_runs":{"type":"integer","minimum":1.0,"title":"Max Daily Runs","default":100},"max_timeout_seconds":{"type":"integer","maximum":2592000.0,"minimum":1.0,"title":"Max Timeout Seconds","default":86400},"max_cpu_cores":{"type":"number","maximum":1024.0,"exclusiveMinimum":0.0,"title":"Max Cpu Cores","default":4.0},"max_memory_mb":{"type":"integer","maximum":4194304.0,"minimum":1.0,"title":"Max Memory Mb","default":4096},"max_queue_seconds":{"type":"integer","minimum":1.0,"title":"Max Queue Seconds","default":3600},"working_hours_tjp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Working Hours Tjp"},"retention_days":{"type":"integer","maximum":3650.0,"minimum":1.0,"title":"Retention Days","default":30},"max_nodes_per_workflow":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Max Nodes Per Workflow","default":50},"max_concurrent_workflows":{"type":"integer","minimum":1.0,"title":"Max Concurrent Workflows","default":10},"max_webhook_endpoints":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Max Webhook Endpoints","default":10},"max_webhook_payload_bytes":{"type":"integer","maximum":10485760.0,"minimum":1024.0,"title":"Max Webhook Payload Bytes","default":262144},"max_workflow_templates":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Max Workflow Templates","default":20},"max_template_triggers":{"type":"integer","maximum":1000.0,"minimum":0.0,"title":"Max Template Triggers","default":10},"max_pending_timers":{"type":"integer","maximum":1000000.0,"minimum":0.0,"title":"Max Pending Timers","default":1000},"max_schedules":{"type":"integer","maximum":100000.0,"minimum":0.0,"title":"Max Schedules","default":100}},"type":"object","title":"TenantQuotas","description":"Per-tenant quotas.\n\n**Quotas cap how many objects may exist. They do not cap how fast you may create them.** The request-rate limit is separate and is not part of this model. Read the effective rate limit from `GET /api/v1/usage` in `limits.requests_per_second` and `limits.request_burst`.\n\nA large quota headroom does not protect you from the rate limit. When each user action creates one timer, your create rate equals your user rate. A backlog drain or a migration can then hit the rate limit with the quota barely touched.\n\nThe rate limit that binds first is enforced at the edge proxy per client IP address. It is stricter than the per-tenant limit, and tenants behind one NAT or one agent host share it. An edge refusal is a 429 with an HTML body and no `Retry-After` header. Branch on the status code and do not assume a 429 body is JSON.\n\nEvery field has a minimum and a maximum. Each node also applies its own ceilings, and no quota can raise a run above the node's per-run CPU and memory ceiling."},"TimerCreate":{"properties":{"fire_at":{"type":"string","format":"date-time","title":"Fire At","description":"When to fire, as an absolute instant. Timezone-aware ISO-8601."},"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"Opaque caller data, echoed back verbatim when the timer fires. Maximum 65536 bytes when serialized as JSON (len(json.dumps(payload).encode('utf-8'))); a larger payload is refused with 422 naming both the actual size and this cap. Send a short reference (an id, a key) and resolve it when the timer fires.","x-maxSerializedBytes":65536},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["fire_at"],"title":"TimerCreate","description":"Body of `POST /api/v1/timers`. `fire_at` must be timezone-aware. `idempotency_key` allows at most one timer per key for the life of the timer record."},"TimerView":{"properties":{"timer_id":{"type":"string","title":"Timer Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"fire_at":{"type":"string","format":"date-time","title":"Fire At"},"state":{"type":"string","title":"State"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"fired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fired At"},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cancelled At"},"fire_delay_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fire Delay Seconds"},"payload_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payload Error"},"deliveries_enqueued":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deliveries Enqueued"}},"type":"object","required":["timer_id","tenant_id","fire_at","state","created_at"],"title":"TimerView","description":"A timer as returned by the API. `deliveries_enqueued` is the number of deliveries its fire created, and zero means the fire reached no endpoint. `payload_error` is set when the stored payload could not be read."},"TriggerCreateRequest":{"properties":{"cron":{"type":"string","maxLength":256,"title":"Cron","description":"5-field crontab expression: minute hour day month day-of-week"},"timezone":{"type":"string","maxLength":64,"title":"Timezone","description":"IANA timezone name (e.g. Europe/London). An offset like +01:00 is rejected: it would drift by an hour across a DST transition.","default":"UTC"},"params":{"additionalProperties":true,"type":"object","maxProperties":64,"title":"Params","description":"Parameter values, validated against the template's declared schema at REGISTRATION so an unattended schedule cannot be created that can only 422."},"version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Version","description":"Pin a template version. Omit to follow the latest — resolved at each fire."},"overlap_policy":{"type":"string","enum":["skip","allow"],"title":"Overlap Policy","description":"skip (default): do not start a new instance while the previous one is active. allow: start regardless, still subject to quotas.","default":"skip"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["cron"],"title":"TriggerCreateRequest","description":"Body of `POST /api/v1/templates/{ref}/triggers`. Unknown fields are refused with 422."},"TriggerFireView":{"properties":{"fire_time":{"type":"string","format":"date-time","title":"Fire Time"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"outcome":{"type":"string","title":"Outcome","description":"fired | skipped_overlap | refused | error"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["fire_time","outcome","created_at"],"title":"TriggerFireView","description":"One entry in a trigger's fire history."},"TriggerUpdateRequest":{"properties":{"cron":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Cron"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"params":{"anyOf":[{"additionalProperties":true,"type":"object","maxProperties":64},{"type":"null"}],"title":"Params"},"overlap_policy":{"anyOf":[{"type":"string","enum":["skip","allow"]},{"type":"null"}],"title":"Overlap Policy"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"TriggerUpdateRequest","description":"Body of `PATCH /api/v1/triggers/{trigger_id}`. Only the fields you send change."},"TriggerView":{"properties":{"trigger_id":{"type":"string","title":"Trigger Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"template_id":{"type":"string","title":"Template Id"},"pinned_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pinned Version"},"cron":{"type":"string","title":"Cron"},"timezone":{"type":"string","title":"Timezone"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"overlap_policy":{"type":"string","title":"Overlap Policy"},"enabled":{"type":"boolean","title":"Enabled"},"next_fire_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Fire At"},"last_fire_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Fire At"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures","default":0},"last_workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Workflow Id"},"last_workflow_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Workflow Status"},"last_workflow_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Workflow At"},"consecutive_workflow_failures":{"type":"integer","title":"Consecutive Workflow Failures","default":0},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["trigger_id","tenant_id","template_id","cron","timezone","overlap_policy","enabled","created_at","updated_at"],"title":"TriggerView","description":"A trigger as returned by the API. Secret-pattern keys in `params` read as `***REDACTED***`, and a fire still substitutes the real value."},"UsageLimits":{"properties":{"memory_limit_mb":{"type":"integer","title":"Memory Limit Mb"},"cpu_cores":{"type":"number","title":"Cpu Cores"},"timeout_seconds":{"type":"integer","title":"Timeout Seconds"},"concurrent_runs":{"type":"integer","title":"Concurrent Runs"},"daily_runs":{"type":"integer","title":"Daily Runs"},"workflow_nodes":{"type":"integer","title":"Workflow Nodes"},"retention_days":{"type":"integer","title":"Retention Days"},"workflow_templates":{"type":"integer","title":"Workflow Templates"},"concurrent_workflows":{"type":"integer","title":"Concurrent Workflows"},"pending_timers":{"type":"integer","title":"Pending Timers"},"template_triggers":{"type":"integer","title":"Template Triggers"},"schedules":{"type":"integer","title":"Schedules"},"queue_seconds":{"type":"integer","title":"Queue Seconds","description":"Seconds a run may wait in the queue before it fails with queue_timeout."},"webhook_endpoints":{"type":"integer","title":"Webhook Endpoints","description":"Registered webhook endpoints the tenant may hold."},"webhook_payload_bytes":{"type":"integer","title":"Webhook Payload Bytes","description":"Byte ceiling for one webhook delivery body. Larger bodies are truncated."},"requests_per_second":{"type":"integer","title":"Requests Per Second"},"request_burst":{"type":"integer","title":"Request Burst"}},"additionalProperties":false,"type":"object","required":["memory_limit_mb","cpu_cores","timeout_seconds","concurrent_runs","daily_runs","workflow_nodes","retention_days","workflow_templates","concurrent_workflows","pending_timers","template_triggers","schedules","queue_seconds","webhook_endpoints","webhook_payload_bytes","requests_per_second","request_burst"],"title":"UsageLimits","description":"The `limits` object in `GET /api/v1/usage`. Every ceiling here is enforced. `requests_per_second` and `request_burst` are the request-rate limit, and the other fields are quotas whose current counts appear in the same response."},"UsagePolicy":{"properties":{"policy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Used"},"limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining"},"resets_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resets At"}},"additionalProperties":false,"type":"object","title":"UsagePolicy","description":"One metering policy in the `usage` list of `GET /api/v1/usage`. Present on metered tiers only. `used` is null for a rate-limit policy."},"UsageResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"metered":{"type":"boolean","title":"Metered"},"limits":{"$ref":"#/components/schemas/UsageLimits"},"templates_in_use":{"type":"integer","title":"Templates In Use"},"allowed_images":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Images"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"runs_today":{"type":"integer","title":"Runs Today"},"active_concurrent_runs":{"type":"integer","title":"Active Concurrent Runs"},"active_concurrent_workflows":{"type":"integer","title":"Active Concurrent Workflows"},"active_pending_timers":{"type":"integer","title":"Active Pending Timers"},"pending_timers":{"type":"integer","title":"Pending Timers","description":"DEPRECATED alias of active_pending_timers — the CURRENT count of pending timers, not the quota. The quota is limits.pending_timers. Prefer active_pending_timers; this name collides with the limits key."},"active_schedules":{"type":"integer","title":"Active Schedules"},"usage":{"items":{"$ref":"#/components/schemas/UsagePolicy"},"type":"array","title":"Usage"},"usage_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Error","description":"Present only when TokenGate metering is unreachable."}},"additionalProperties":false,"type":"object","required":["tenant_id","tier","metered","limits","templates_in_use","allowed_images","expires_at","runs_today","active_concurrent_runs","active_concurrent_workflows","active_pending_timers","pending_timers","active_schedules","usage"],"title":"UsageResponse","description":"Response to `GET /api/v1/usage`. `usage_error` is absent when metering is working and present only when metering cannot be reached."},"UtilizationResponse":{"properties":{"samples":{"items":{"$ref":"#/components/schemas/UtilizationSample"},"type":"array","title":"Samples"}},"type":"object","required":["samples"],"title":"UtilizationResponse","description":"Response to `GET /api/v1/runs/{track_id}/utilization`: a list of `samples`."},"UtilizationSample":{"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"cpu_percent":{"type":"number","title":"Cpu Percent"},"memory_mb":{"type":"number","title":"Memory Mb"},"memory_limit_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory Limit Mb"},"net_rx_bytes":{"type":"integer","title":"Net Rx Bytes"},"net_tx_bytes":{"type":"integer","title":"Net Tx Bytes"}},"type":"object","required":["timestamp","cpu_percent","memory_mb","memory_limit_mb","net_rx_bytes","net_tx_bytes"],"title":"UtilizationSample","description":"One utilization sample: CPU percent, memory in MB, the memory limit, and bytes received and sent on the network."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","description":"One request-validation error: where it occurred (`loc`), a message (`msg`) and the error type (`type`)."},"WebhookCreateRequest":{"properties":{"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string","enum":["*","node.*","node.cancelled","node.failed","node.retrying","node.running","node.skipped","node.succeeded","node.waiting_approval","run.*","run.exited","run.failed","run.killed","run.paused","run.pulling","run.queued","run.resumed","run.running","run.scheduled","run.stopping","run.terminal","run.timeout","schedule.*","schedule.fired","tenant.*","tenant.delivery_dead","tenant.suspended","tenant.tier_changed","tenant.timer_delivery_dead","tenant.trigger_disabled","tenant.trigger_unhealthy","tenant.unsuspended","tenant.webhook_endpoint_degraded","tenant.webhook_endpoint_disabled","timer.*","timer.fired","webhook.test","workflow.*","workflow.cancelled","workflow.failed","workflow.paused","workflow.resumed","workflow.running","workflow.succeeded","workflow.terminal"]},"type":"array","title":"Events"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret","description":"Signing secret. If you SUPPLY one it is used verbatim as UTF-8 and that is the HMAC key. If you omit it we generate 32 random bytes and return them as 64 hex characters, in which case the key is bytes.fromhex(secret) — not the characters. There is no origin-independent 'wrong' derivation: the same operation is correct or incorrect depending only on where the secret came from. Returned exactly once."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active":{"type":"boolean","title":"Active","default":true},"resource_filter":{"anyOf":[{"$ref":"#/components/schemas/ResourceFilter"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["url"],"title":"WebhookCreateRequest","description":"Body of `POST /api/v1/webhooks`. Unknown fields are refused with 422."},"WebhookCreateResponse":{"properties":{"endpoint_id":{"type":"string","title":"Endpoint Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"active":{"type":"boolean","title":"Active"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["endpoint_id","url","events","active","created_at","secret"],"title":"WebhookCreateResponse","description":"Response to `POST /api/v1/webhooks`. The signing secret is returned here once and never again."},"WebhookDeliveryView":{"properties":{"id":{"type":"integer","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"endpoint_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Id"},"target_url":{"type":"string","title":"Target Url"},"event_type":{"type":"string","title":"Event Type"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"state":{"type":"string","title":"State"},"attempts":{"type":"integer","title":"Attempts"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"},"last_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["id","event_id","tenant_id","target_url","event_type","resource_type","resource_id","payload","state","attempts","created_at"],"title":"WebhookDeliveryView","description":"One webhook delivery and its delivery state."},"WebhookEndpointView":{"properties":{"resource_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Resource Filter"},"last_delivery_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Delivery At"},"last_delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery Status","description":"delivered | pending | dead"},"last_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status Code"},"endpoint_id":{"type":"string","title":"Endpoint Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active":{"type":"boolean","title":"Active"},"secret_origin":{"type":"string","title":"Secret Origin","description":"Which HMAC derivation applies to this endpoint's secret. `generated`: RunFlow minted 32 random bytes and handed them over as 64 hex chars, so the signing key is bytes.fromhex(secret). `supplied`: you gave us the secret and it is used verbatim as UTF-8. `unknown`: registered before we recorded this — we do not guess, because a confidently wrong provenance points you at the wrong derivation. Rotation ALWAYS generates, so a supplied-secret endpoint flips to `generated` on rotation and the governing rule flips with it. This is for an operator reading a runbook; it is the wrong input to a hot verification path, where a delivery is checked against a SET of secrets before it can be attributed to any endpoint.","default":"unknown"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures","description":"Deliveries that have died back-to-back with no success since. RESET TO ZERO BY ANY SUCCESSFUL DELIVERY, and by re-activating the endpoint. It does not drive the auto-disable — that decision reads the last 24h of deliveries instead: the endpoint is disabled only after 20 dead in the window with ZERO successes (reason `dead_without_success_24h`), and an endpoint losing deliveries while still succeeding gets `tenant.webhook_endpoint_degraded` at 5 dead in 24h rather than a disable that would stop its remaining good deliveries too. Do not read this field as a health check: an endpoint that drops one delivery in four resets it to 0 constantly. Use `dead_deliveries_total` for health.","default":0},"dead_deliveries_total":{"type":"integer","title":"Dead Deliveries Total","description":"Lifetime count of this endpoint's deliveries that exhausted their retry budget (~36m10s over 5 attempts) or were refused as a blocked target. NEVER reset — not by a success, not by re-activating the endpoint. Rising while `consecutive_failures` sits at 0 is the signature of an intermittently failing receiver — deliberately never auto-disabled (its remaining good deliveries would stop too), but announced via tenant.webhook_endpoint_degraded at 5 dead in 24h. DO NOT ALARM ON THE ABSOLUTE VALUE: because nothing ever resets it, an alert on `dead_deliveries_total > 0` fires from the first dead delivery and can NEVER clear, including after you have fixed the receiver — and an alarm that is usually stale stops being read. IT DOES NOT TELL YOU WHETHER LOSS IS ONGOING. Alarm on the RATE OF CHANGE (compare two reads), and use `last_dead_delivery_at` in this same response to decide whether the losses are current: a `last_dead_delivery_at` older than your own repair is history, not an incident. Counts only deliveries that died after this field was introduced, so it understates history for older endpoints and only ever becomes more accurate.","default":0},"last_dead_delivery_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Dead Delivery At","description":"When this endpoint's most recent delivery died, or null if none has since the counter began. THE RECENCY DISCRIMINATOR for `dead_deliveries_total`: compare it against your own deploy or repair time. A non-zero `dead_deliveries_total` whose `last_dead_delivery_at` predates your fix is history, not an incident. The count alone cannot distinguish 20 failures last year from 20 since Tuesday, and cannot tell you whether loss is ongoing."},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["endpoint_id","url","events","active","created_at","updated_at"],"title":"WebhookEndpointView","description":"A webhook endpoint as returned by GET and PATCH. It never includes the secret."},"WebhookRedeliverResponse":{"properties":{"delivery_id":{"type":"integer","title":"Delivery Id"}},"type":"object","required":["delivery_id"],"title":"WebhookRedeliverResponse","description":"Response to `POST /api/v1/webhooks/deliveries/{delivery_id}/redeliver`: the new `delivery_id`."},"WebhookRotateResponse":{"properties":{"endpoint_id":{"type":"string","title":"Endpoint Id"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["endpoint_id","secret"],"title":"WebhookRotateResponse","description":"Response to `POST /api/v1/webhooks/{endpoint_id}/rotate-secret`: the new secret, returned once."},"WebhookTestRequest":{"properties":{"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type","description":"Event type to rehearse. Must be in the catalog AND matched by this endpoint's subscription. The payload is marked `test: true` so a receiver can never mistake the rehearsal for the real thing."}},"additionalProperties":false,"type":"object","title":"WebhookTestRequest","description":"Optional body of `POST /api/v1/webhooks/{endpoint_id}/test`. Omit it to send a `webhook.test` event whatever the endpoint subscribes to. Send `event_type` to rehearse a subscription. Every `tenant.*` event reports a real change such as a suspension, a disabled endpoint or a tier change, and a rehearsal is how you test the endpoint that receives them."},"WebhookTestResponse":{"properties":{"delivery_id":{"type":"integer","title":"Delivery Id"},"event_type":{"type":"string","title":"Event Type","description":"What was actually enqueued, echoed back so a caller who nominated an event_type is not left inferring it from a bare delivery id.","default":"webhook.test"}},"type":"object","required":["delivery_id"],"title":"WebhookTestResponse","description":"Response to `POST /api/v1/webhooks/{endpoint_id}/test`: the `delivery_id` and the `event_type` that was enqueued."},"WebhookUpdateRequest":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string","enum":["*","node.*","node.cancelled","node.failed","node.retrying","node.running","node.skipped","node.succeeded","node.waiting_approval","run.*","run.exited","run.failed","run.killed","run.paused","run.pulling","run.queued","run.resumed","run.running","run.scheduled","run.stopping","run.terminal","run.timeout","schedule.*","schedule.fired","tenant.*","tenant.delivery_dead","tenant.suspended","tenant.tier_changed","tenant.timer_delivery_dead","tenant.trigger_disabled","tenant.trigger_unhealthy","tenant.unsuspended","tenant.webhook_endpoint_degraded","tenant.webhook_endpoint_disabled","timer.*","timer.fired","webhook.test","workflow.*","workflow.cancelled","workflow.failed","workflow.paused","workflow.resumed","workflow.running","workflow.succeeded","workflow.terminal"]},"type":"array"},{"type":"null"}],"title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"resource_filter":{"anyOf":[{"$ref":"#/components/schemas/ResourceFilter"},{"type":"null"}]},"clear_resource_filter":{"type":"boolean","title":"Clear Resource Filter","default":false},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret","description":"Replace the signing secret with one you supply; it is used verbatim as UTF-8 and secret_origin becomes `supplied`. This is the ZERO-GAP rotation path: install the value in your receiver first, then PATCH it here, then retire the old one — unlike rotate-secret, which mints and so cannot be pre-installed. An empty string is refused (422): it would disable signing for this endpoint. Note a supplied secret is keyed verbatim whatever it looks like, so 64 hex characters you supply still must NOT be hex-decoded by your receiver."}},"additionalProperties":false,"type":"object","title":"WebhookUpdateRequest","description":"Body of `PATCH /api/v1/webhooks/{endpoint_id}`. Only the fields you send change, and the rest are left as they are. Unknown fields are refused with 422."},"WorkflowEvent":{"properties":{"id":{"type":"integer","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"node_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Node Ref"},"kind":{"type":"string","title":"Kind"},"to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"},"detail":{"additionalProperties":true,"type":"object","title":"Detail"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workflow_id","kind","created_at"],"title":"WorkflowEvent","description":"One workflow or node lifecycle event. `id` is an increasing cursor. Poll `GET /api/v1/workflows/{workflow_id}/events?since=<last id>` to replay from a point or to follow the workflow."},"WorkflowNodeDetail":{"properties":{"ref":{"type":"string","title":"Ref"},"state":{"type":"string","title":"State"},"attempt":{"type":"integer","title":"Attempt"},"attempts":{"items":{"type":"string"},"type":"array","title":"Attempts","description":"track_ids of all attempts"},"current_track_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Track Id"},"output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["ref","state","attempt"],"title":"WorkflowNodeDetail","description":"Response to `GET /api/v1/workflows/{workflow_id}/nodes/{ref}`. `attempts` lists the `track_id` of every attempt."},"WorkflowNodeResult":{"properties":{"ref":{"type":"string","title":"Ref"},"final_state":{"type":"string","title":"Final State"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"oom_killed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Oom Killed","description":"True when the kernel killed a process in the run's container for memory, including a child process while the main process kept running. Null when RunFlow could not read it."},"attempts":{"type":"integer","title":"Attempts"},"output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output"}},"type":"object","required":["ref","final_state","attempts"],"title":"WorkflowNodeResult","description":"One node's outcome in a workflow result."},"WorkflowNodeStatus":{"properties":{"ref":{"type":"string","title":"Ref"},"type":{"type":"string","title":"Type","default":"container"},"state":{"type":"string","title":"State"},"attempt":{"type":"integer","title":"Attempt"},"current_track_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Track Id"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"oom_killed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Oom Killed","description":"True when the kernel killed a process in the run's container for memory, including a child process while the main process kept running. Null when RunFlow could not read it."},"start_deadline_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Deadline Seconds"},"approval_timeout_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approval Timeout Seconds","description":"For approval gates: the effective auto-reject window in seconds, including any default or clamp the tier applied. Read it to know when an unanswered gate will expire and free its slot."}},"type":"object","required":["ref","state","attempt"],"title":"WorkflowNodeStatus","description":"A node's live state within a workflow."},"WorkflowResult":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"state":{"type":"string","title":"State"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"nodes":{"items":{"$ref":"#/components/schemas/WorkflowNodeResult"},"type":"array","title":"Nodes"},"failed_nodes":{"items":{"type":"string"},"type":"array","title":"Failed Nodes"}},"type":"object","required":["workflow_id","state"],"title":"WorkflowResult","description":"Response to `GET /api/v1/workflows/{workflow_id}/result` for a finished workflow."},"WorkflowStatus":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"state":{"type":"string","title":"State"},"failure_policy":{"type":"string","title":"Failure Policy"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"template_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Version"},"start_after":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start After"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"nodes":{"items":{"$ref":"#/components/schemas/WorkflowNodeStatus"},"type":"array","title":"Nodes"},"edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edges"}},"type":"object","required":["workflow_id","tenant_id","state","failure_policy","submitted_at"],"title":"WorkflowStatus","description":"A workflow as returned by `GET /api/v1/workflows/{workflow_id}`. `template_id` and `template_version` are set when the workflow was started from a template."},"WorkflowSubmitRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"failure_policy":{"type":"string","enum":["fail_fast","continue"],"title":"Failure Policy","default":"fail_fast"},"nodes":{"items":{"$ref":"#/components/schemas/NodeSpec"},"type":"array","maxItems":1000,"minItems":1,"title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/EdgeSpec"},"type":"array","maxItems":10000,"title":"Edges"},"webhook":{"anyOf":[{"$ref":"#/components/schemas/InlineWebhook"},{"type":"null"}],"description":"Inline workflow webhook"},"scheduled_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Start","description":"ISO-8601 time before which no node may start (omit for ASAP). A naive value is treated as UTC; a past value starts at the next tick."}},"type":"object","required":["nodes"],"title":"WorkflowSubmitRequest","description":"Body of `POST /api/v1/workflows`: the nodes, edges, `failure_policy` (`fail_fast` or `continue`), an optional inline webhook and an optional `scheduled_start`. Unknown fields are ignored."},"WorkflowSubmitResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"type":"string","title":"Status","default":"pending"}},"type":"object","required":["workflow_id"],"title":"WorkflowSubmitResponse","description":"Response to `POST /api/v1/workflows`: the new `workflow_id` and `status` `pending`."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}