{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"abtests.dev vendor control plane","version":"0.3.0","description":"Tenant-isolated vendor implementation workflows. No SaaS procurement or outreach. Statistical workbench is a separately deployed service."},"servers":[{"url":"https://abtests.dev"}],"security":[{"BearerAuth":[]}],"paths":{"/api/v1/health":{"get":{"operationId":"health","summary":"Worker liveness; does not test storage connectivity","tags":["health"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"}},"required":["ok","service"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/config":{"get":{"operationId":"config","summary":"Public Clerk configuration, release and runtime policy","tags":["config"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/version":{"get":{"operationId":"version","summary":"Release identity and declared persistence environment","tags":["version"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Release"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/releases/current":{"get":{"operationId":"currentRelease","summary":"Alias of release identity","tags":["releases"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Release"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/capabilities":{"get":{"operationId":"capabilities","summary":"Workflow and transport discovery","tags":["capabilities"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/openapi.json":{"get":{"operationId":"openapi","summary":"This OpenAPI document","tags":["openapi.json"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me":{"get":{"operationId":"identity","summary":"Read verified account and scopes","tags":["me"],"x-required-auth":"Any verified bearer","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"login":{"type":"string"}},"required":["id","login"]},"auth":{"type":"object","properties":{"kind":{"enum":["session","device","runtime"]},"scopes":{"type":"array","items":{"type":"string"}}},"required":["kind","scopes"]}},"required":["account","auth"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects":{"get":{"operationId":"projectsList","summary":"List projects owned by the signed-in individual","tags":["projects"],"description":"Returns all owned records, at most 100. Does not list another organization member’s personal projects.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}},"required":["projects"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"projectsCreate","summary":"Create a personal abtests project record","tags":["projects"],"description":"Metadata only: does not create a Stripe Project, cloud account or resource, or execute procurement. Owner comes from the verified individual identity. New records initialize infrastructure as not_connected and executor as unassigned. The same idempotency key with identical metadata returns the existing record with its current state; a mismatch returns 409. Maximum 100 per user and 30 creates per hour.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"}}}},"responses":{"200":{"description":"Identical idempotency-key replay; no new record","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"duplicate":{"const":true}},"required":["project","duplicate"]}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"duplicate":{"type":"boolean"}},"required":["project","duplicate"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}":{"get":{"operationId":"projectsGet","summary":"Read personal project metadata and revision","tags":["projects"],"x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}},"required":["project"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"projectsUpdate","summary":"Rename or describe an owned project","tags":["projects"],"description":"Requires current expected_revision and at least one metadata change. Owner, credentials, infrastructure and executor state cannot be supplied. After an uncertain response, read the record before retrying.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}},"required":["project"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}/providers/stripe-projects":{"get":{"operationId":"projectProviderStatus","summary":"Read optional Stripe Projects status","tags":["projects"],"description":"Read customer-owned connection state and a verified resource receipt when available. Google sign-in does not authorize Stripe. A connected account alone does not prove project provisioning.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProjectState"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"project_provider_unavailable: read provider status before retrying any mutation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"project_provider_not_configured: the provider runtime is unavailable in this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}/providers/stripe-projects/connect":{"post":{"operationId":"projectProviderConnect","summary":"Start manual Stripe account connection","tags":["projects"],"description":"Runs native Stripe CLI login in a private Modal profile scoped to the verified user and owned project. Show the returned official URL and pairing code for the user to approve directly; never automate approval. Read status after uncertain responses.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProjectState"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"project_provider_unavailable: read provider status before retrying any mutation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"project_provider_not_configured: the provider runtime is unavailable in this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}/providers/stripe-projects/provision":{"post":{"operationId":"projectProviderProvision","summary":"Explicitly create an empty Stripe project","tags":["projects"],"description":"Creates only an empty project shell in the customer’s own connected account. No services or purchases. Eligibility, CLI access and terms can require an owner handoff; no automatic acceptance. An uncertain response may follow an external effect: read status and resolve reconciliation before retrying.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProjectState"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"project_provider_unavailable: read provider status before retrying any mutation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"project_provider_not_configured: the provider runtime is unavailable in this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}/providers/stripe-projects/disconnect":{"post":{"operationId":"projectProviderDisconnect","summary":"Forget the project provider authorization","tags":["projects"],"description":"Removes private authorization without deleting external resources or undoing prior actions. Read status after an uncertain response before retrying.","x-required-auth":"manage + verified individual user; active organization does not change ownership. Older organization device tokens without an immutable owner must reconnect.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProjectState"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"project_provider_unavailable: read provider status before retrying any mutation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"project_provider_not_configured: the provider runtime is unavailable in this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows":{"get":{"operationId":"workflowsList","summary":"Search operator-assisted setup recipes","tags":["workflows"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"query","in":"query","schema":{"type":"string","maxLength":120,"default":""}},{"name":"provider","in":"query","schema":{"type":"string","maxLength":80,"default":"","description":"Exact provider name from the catalog"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"$ref":"#/components/schemas/Workflow"}},"policy":{"$ref":"#/components/schemas/WorkflowPolicy"}},"required":["workflows","policy"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}":{"get":{"operationId":"workflowsGet","summary":"Read a setup recipe and its required inputs","tags":["workflows"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"$ref":"#/components/schemas/Workflow"}},"required":["workflow"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflow-runs":{"get":{"operationId":"workflowRunsList","summary":"Read latest 200 tenant workflow records","tags":["workflow-runs"],"x-required-auth":"manage: Clerk session or approved device token","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunSummary"}},"has_more":{"type":"boolean"}},"required":["runs","has_more"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"workflowsStart","summary":"Create an operator-assisted run record","tags":["workflow-runs"],"description":"Validated inputs and an immutable recipe snapshot are stored. Reuse an idempotency key only with identical workflow, catalog version and inputs. This does not execute cloud changes, dispatch provisioning or establish external verification.","x-required-auth":"manage: Clerk session or approved device token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunCreate"}}}},"responses":{"200":{"description":"Identical idempotency-key replay; no new record is created","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/WorkflowRun"},"duplicate":{"const":true}},"required":["run","duplicate"]}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/WorkflowRun"},"duplicate":{"type":"boolean"}},"required":["run","duplicate"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflow-runs/{id}":{"get":{"operationId":"workflowRunsGet","summary":"Read step reports, recipe snapshot and current revision","tags":["workflow-runs"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/WorkflowRun"}},"required":["run"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflow-runs/{id}/steps/{step_id}":{"patch":{"operationId":"workflowStepsRecord","summary":"Record a step observation or blocker","tags":["workflow-runs"],"description":"Use the latest expected_revision. Required dependencies must be recorded. Recorded steps require evidence references; credential-transfer steps also require a private credential reference. Recorded API/CLI/MCP steps require ready access; blocked reports may describe missing access; browser reports require missing_access or unsupported and a meaningful fallback_reason. This records operator claims, never independent external verification. Read the run after an uncertain response; recorded steps are immutable.","x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"step_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStepUpdate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/WorkflowRun"}},"required":["run"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflow-runs/{id}/cancel":{"post":{"operationId":"workflowRunsCancel","summary":"Cancel an active or blocked workflow record","tags":["workflow-runs"],"description":"Requires current expected_revision. Does not undo external changes. Read after ambiguous responses; terminal records cannot be changed.","x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunCancel"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/WorkflowRun"}},"required":["run"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/vendors":{"get":{"operationId":"vendorsList","summary":"Search tenant inventory with stable ID cursor","tags":["vendors"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"query","in":"query","schema":{"type":"string","maxLength":120}},{"name":"status","in":"query","schema":{"type":"string","maxLength":40}},{"name":"category","in":"query","schema":{"type":"string","maxLength":80}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"vendors":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["vendors","next_cursor"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"vendorsCreate","summary":"Register a vendor definition; does not create a SaaS account","tags":["vendors"],"description":"Not idempotent. If the response is lost, search existing inventory before retrying. Maximum 1000 vendors per tenant.","x-required-auth":"manage: Clerk session or approved device token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCreate"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"vendor":{"$ref":"#/components/schemas/Vendor"}},"required":["vendor"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/vendors/seed":{"post":{"operationId":"vendorsSeed","summary":"Explicitly add the three starter GTM definitions","tags":["vendors"],"description":"Existing seeded definitions are retained; no sessions or outcomes are fabricated.","x-required-auth":"manage: Clerk session or approved device token","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"vendors":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}}},"required":["vendors"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/vendors/{id}":{"get":{"operationId":"vendorsGet","summary":"Read vendor and recent related records","tags":["vendors"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"vendor":{"$ref":"#/components/schemas/Vendor"},"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"handoffs":{"type":"array","items":{"$ref":"#/components/schemas/Handoff"}}},"required":["vendor","runs","handoffs"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"vendorsUpdate","summary":"Update metadata using compare-and-swap revision","tags":["vendors"],"description":"Use expected_revision from the latest read. Credential references only; no raw secrets. Session state is operator-reported metadata.","x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorUpdate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"vendor":{"$ref":"#/components/schemas/Vendor"}},"required":["vendor"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/accounts":{"get":{"operationId":"accountsList","summary":"Read vendor credential references and session metadata","tags":["accounts"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"query","in":"query","schema":{"type":"string","maxLength":120}},{"name":"status","in":"query","schema":{"type":"string","maxLength":40}},{"name":"category","in":"query","schema":{"type":"string","maxLength":80}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"vendor_id":{"type":"string"},"credential_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"session_state":{"type":"string"}},"required":["id","vendor_id","credential_ref","session_state"]}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["accounts","next_cursor"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runs":{"get":{"operationId":"runsList","summary":"Read latest 200 runs","tags":["runs"],"x-required-auth":"manage: Clerk session or approved device token","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"has_more":{"type":"boolean"}},"required":["runs","has_more"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"runsStart","summary":"Queue a bounded task with stable retry identity","tags":["runs"],"description":"Same idempotency_key + vendor + intent returns the same run. Model and effort fixed. No purchases, outreach or arbitrary computer commands. Login/implement can end in human handoff.","x-required-auth":"manage: Clerk session or approved device token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/Run"},"duplicate":{"type":"boolean"}},"required":["run","duplicate"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runs/{id}":{"get":{"operationId":"runsGet","summary":"Read run and private event evidence","tags":["runs"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/Run"},"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["run","events"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runs/{id}/cancel":{"post":{"operationId":"runsCancel","summary":"Cancel run and invalidate active lease","tags":["runs"],"description":"Terminal states return run_terminal; a repeat is not automatically successful. Cannot undo observations already made.","x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"boolean"}},"required":["cancelled"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/handoffs":{"get":{"operationId":"handoffsList","summary":"List tenant human handoffs","tags":["handoffs"],"x-required-auth":"manage: Clerk session or approved device token","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"handoffs":{"type":"array","items":{"$ref":"#/components/schemas/Handoff"}}},"required":["handoffs"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/handoffs/{id}":{"patch":{"operationId":"handoffsResolve","summary":"Record resolution without restarting execution","tags":["handoffs"],"x-required-auth":"manage: Clerk session or approved device token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffUpdate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"handoff":{"$ref":"#/components/schemas/Handoff"}},"required":["handoff"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/device/start":{"post":{"operationId":"deviceStart","summary":"Start verifier-bound device approval","tags":["device"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["challenge"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string","pattern":"^[a-f0-9]{64}$"},"user_code":{"type":"string"},"verification_uri_complete":{"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}},"required":["device_code","user_code","verification_uri_complete","expires_in","interval"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/device/poll":{"post":{"operationId":"devicePoll","summary":"Poll and consume approval once","tags":["device"],"description":"Never log device_code, verifier or returned token. Pending returns202. Approved device bearer expires after30days.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string","pattern":"^[a-f0-9]{64}$"},"verifier":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["device_code","verifier"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"token":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"login":{"type":"string"}},"required":["id","login"]}},"required":["status","token","account"]}}}},"202":{"description":"Approval pending","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"pending"}},"required":["status"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/device/approve":{"post":{"operationId":"deviceApprove","summary":"Approve a device using a verified browser session","tags":["device"],"x-required-auth":"Clerk session only; matching Origin required","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_code":{"type":"string","pattern":"^[A-Z]{8}$"}},"required":["user_code"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"boolean"}},"required":["approved"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/device/logout":{"post":{"operationId":"deviceLogout","summary":"Revoke the current device or runtime token","tags":["device"],"x-required-auth":"Approved device or runtime bearer only","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/model-auth":{"get":{"operationId":"modelAuthStatus","summary":"Read this workspace’s ChatGPT connection status","tags":["model-auth"],"description":"Returns no credential or provider logs. Connected confirms stored authentication, not model entitlement or a successful vendor run.","x-required-auth":"manage: Clerk session or approved device token","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelAuth"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/model-auth/start":{"post":{"operationId":"modelAuthStart","summary":"Start official Codex device authentication on Modal","tags":["model-auth"],"description":"User manually completes the returned official OpenAI verification URL and code. Subscription limits and model availability apply. Poll modelAuthStatus for completion.","x-required-auth":"manage: Clerk session or approved device token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelAuth"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/model-auth/logout":{"post":{"operationId":"modelAuthLogout","summary":"Disconnect this workspace’s ChatGPT credential on Modal","tags":["model-auth"],"description":"Revokes this product connection and removes its stored credential. This is separate from signing out of abtests.dev.","x-required-auth":"manage: Clerk session or approved device token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelAuth"}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runtime-tokens":{"get":{"operationId":"tokensList","summary":"List device/runtime token metadata, never secrets","tags":["runtime-tokens"],"x-required-auth":"Clerk session only","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["tokens"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"runtimeTokenCreate","summary":"Issue a narrow runtime token once","tags":["runtime-tokens"],"x-required-auth":"Clerk session only; matching Origin required","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimeTokenCreate"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"expires_at":{"type":"string"}},"required":["token","id","expires_at"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runtime-tokens/{id}":{"delete":{"operationId":"tokenRevoke","summary":"Revoke a device or runtime token","tags":["runtime-tokens"],"x-required-auth":"Clerk session only; matching Origin required","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runtime/claim":{"post":{"operationId":"runtimeClaim","summary":"Lease a queued run for bounded execution","tags":["runtime"],"description":"Leased payload includes private credential reference and one-time lease_token. Never expose these to models or logs.","x-required-auth":"runtime scope","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimeClaim"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}},"required":["run"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runtime/runs/{id}/heartbeat":{"post":{"operationId":"runtimeHeartbeat","summary":"Renew owned lease for120seconds","tags":["runtime"],"x-required-auth":"runtime scope + active owned lease","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimeHeartbeat"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"lease_expires_at":{"type":"string","format":"date-time"}},"required":["lease_expires_at"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runtime/runs/{id}/events":{"post":{"operationId":"runtimeEvent","summary":"Append idempotent event or terminal report","tags":["runtime"],"description":"Stable external_id retries require identical payload. At most100events and10screenshots/run. Tenant, token and lease checked transactionally.","x-required-auth":"runtime scope + active owned lease","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimeEvent"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"event":{"$ref":"#/components/schemas/Event"},"duplicate":{"type":"boolean"}},"required":["event","duplicate"]}}}},"400":{"description":"Invalid request. Raw secrets and unsupported fields are rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Bearer credential missing, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope or origin does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No record in the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Revision, idempotency, lease, status or capacity conflict; inspect state before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 262144 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; wait before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Persistence binding unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Verified Clerk JWT, approved abdev_ device token, or narrowly scoped abrt_ runtime token. Each route enforces its own scope."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"ProjectCreate":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"description":{"default":"","type":"string","maxLength":1000},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}},"required":["name","idempotency_key"],"additionalProperties":false},"ProjectUpdate":{"type":"object","properties":{"expected_revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"name":{"type":"string","minLength":2,"maxLength":120},"description":{"type":"string","maxLength":1000}},"required":["expected_revision"],"additionalProperties":false},"StripeProjectState":{"type":"object","properties":{"provider":{"type":"string","const":"stripe_projects"},"connection_status":{"type":"string","enum":["not_connected","pending","connected","expired","error"]},"provisioning_status":{"type":"string","enum":["not_started","pending","provisioned","blocked","failed"]},"authenticated":{"type":"boolean"},"account_id":{"type":"string","pattern":"^acct_[A-Za-z0-9]{1,100}$"},"external_project_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,120}$"},"verification_url":{"type":"string","maxLength":2048,"format":"uri"},"verification_code":{"type":"string","pattern":"^[A-Za-z0-9 -]{4,120}$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"blocking_reason":{"type":"string","enum":["connection_required","cli_access_required","account_not_eligible","terms_required","credentials_unavailable","provider_unavailable","reconciliation_required"]},"verified_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["provider","connection_status","provisioning_status","authenticated"],"additionalProperties":false},"Project":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"name":{"type":"string"},"description":{"type":"string"},"owner_user_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"infrastructure":{"type":"object","properties":{"provider":{"anyOf":[{"type":"string","enum":["stripe_projects"]},{"type":"null"}]},"status":{"type":"string","enum":["not_connected","awaiting_authorization","connected","provisioning","provisioned","blocked","error"]},"externally_verified":{"type":"boolean"},"account_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9_-]+$"},"external_project_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9_-]+$"},"verified_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"blocking_reason":{"type":"string","enum":["connection_required","cli_access_required","account_not_eligible","terms_required","credentials_unavailable","provider_unavailable","reconciliation_required"]}},"required":["provider","status","externally_verified"],"additionalProperties":false},"executor":{"type":"object","properties":{"status":{"const":"unassigned"}},"required":["status"]}},"required":["id","name","description","owner_user_id","revision","idempotency_key","created_at","updated_at","infrastructure","executor"]},"WorkflowRunCreate":{"type":"object","properties":{"workflow_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"inputs":{"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"string","maxLength":2000}}},"required":["workflow_id","idempotency_key","inputs"],"additionalProperties":false},"WorkflowStepUpdate":{"type":"object","properties":{"expected_revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["recorded","blocked"]},"method":{"type":"string","enum":["api","cli","mcp","browser","human"]},"access":{"type":"string","enum":["ready","missing_access","unsupported"]},"summary":{"type":"string","maxLength":2000},"evidence_ref":{"anyOf":[{"type":"string","maxLength":1000,"format":"uri"},{"type":"string","maxLength":300,"pattern":"^(?:artifact|receipt|run):\\/\\/[a-zA-Z0-9][a-zA-Z0-9/_-]*$"}]},"credential_ref":{"type":"string","maxLength":200,"pattern":"^(?:vault|executor|modal|profile):\\/\\/[a-zA-Z0-9][a-zA-Z0-9/_-]*$"},"fallback_reason":{"type":"string","maxLength":2000}},"required":["expected_revision","status","method","access","summary"],"additionalProperties":false},"WorkflowRunCancel":{"type":"object","properties":{"expected_revision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["expected_revision"],"additionalProperties":false},"WorkflowPolicy":{"type":"object","properties":{"version":{"type":"string"},"preferred_interfaces":{"type":"array","items":{"enum":["api","cli","mcp"]}},"principle":{"type":"string"},"browser_scope":{"type":"string"},"browser_execution":{"const":"modal"},"bootstrap_execution":{"const":"operator_assisted"},"automated_browser_writes_available":{"const":false},"runtime_note":{"type":"string"},"credentials":{"type":"string"},"verification":{"type":"string"},"purchase_allowed":{"const":false}},"required":["version","preferred_interfaces","principle","browser_scope","browser_execution","bootstrap_execution","automated_browser_writes_available","runtime_note","credentials","verification","purchase_allowed"]},"WorkflowStep":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"title":{"type":"string"},"purpose":{"type":"string"},"depends_on":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}},"methods":{"type":"array","items":{"type":"string","enum":["api","cli","mcp","browser","human"]}},"browser_bootstrap":{"type":"boolean"},"browser_reason":{"type":"string"},"entry_url":{"type":"string","format":"uri"},"instructions":{"type":"array","items":{"type":"string"}},"checks":{"type":"array","items":{"type":"string"}},"handoffs":{"type":"array","items":{"type":"string"}},"commands":{"type":"array","items":{"type":"object","properties":{"method":{"enum":["api","cli","mcp"]},"description":{"type":"string"},"template":{"type":"string"}},"required":["method","description","template"]}},"requires_evidence":{"type":"boolean"},"requires_credential_ref":{"type":"boolean"}},"required":["id","title","purpose","depends_on","methods","browser_bootstrap","instructions","checks","handoffs","commands","requires_evidence"]},"Workflow":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"version":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"category":{"type":"string"},"summary":{"type":"string"},"execution":{"const":"operator_assisted"},"policy":{"$ref":"#/components/schemas/WorkflowPolicy"},"inputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"default":{"type":"string"},"options":{"type":"array","items":{"type":"string"}}},"required":["key","label","description","required"]}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]}},"provenance":{"type":"object","properties":{"kind":{"type":"string"},"observed_on":{"type":"string"},"summary":{"type":"string"},"limitations":{"type":"array","items":{"type":"string"}}},"required":["kind","observed_on","summary","limitations"]}},"required":["id","version","name","provider","category","summary","execution","policy","inputs","steps","sources","provenance"]},"WorkflowStepState":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"status":{"enum":["pending","blocked","recorded"]},"method":{"type":"string","enum":["api","cli","mcp","browser","human"]},"access":{"type":"string","enum":["ready","missing_access","unsupported"]},"summary":{"type":"string"},"evidence_ref":{"anyOf":[{"type":"string","maxLength":1000,"format":"uri"},{"type":"string","maxLength":300,"pattern":"^(?:artifact|receipt|run):\\/\\/[a-zA-Z0-9][a-zA-Z0-9/_-]*$"}]},"credential_ref":{"type":"string"},"fallback_reason":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status"]},"WorkflowRun":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"workflow_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"workflow_name":{"type":"string"},"workflow_version":{"type":"string"},"definition":{"$ref":"#/components/schemas/Workflow"},"inputs":{"type":"object","additionalProperties":{"type":"string"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStepState"}},"status":{"enum":["active","blocked","recorded","cancelled"]},"revision":{"type":"integer","minimum":1},"execution":{"const":"operator_assisted"},"externally_verified":{"const":false},"purchase_allowed":{"const":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","workflow_id","workflow_name","workflow_version","definition","inputs","steps","status","revision","execution","externally_verified","purchase_allowed","idempotency_key","created_at","updated_at"]},"ModelAuth":{"type":"object","properties":{"provider":{"const":"chatgpt"},"runtime":{"const":"modal"},"model":{"const":"gpt-6-astra"},"reasoning_effort":{"const":"low"},"configured":{"type":"boolean"},"status":{"enum":["disconnected","pending","connected","expired","error"]},"authenticated":{"type":"boolean"},"verification_url":{"const":"https://auth.openai.com/codex/device"},"user_code":{"type":"string","pattern":"^[A-Z0-9]{4,8}(?:-[A-Z0-9]{4,8}){1,2}$"},"expires_at":{"type":"string","format":"date-time"},"poll_interval_seconds":{"type":"integer","minimum":2,"maximum":10}},"required":["provider","runtime","model","reasoning_effort","configured","status","authenticated"]},"VendorCreate":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"homepage_url":{"type":"string","maxLength":1000,"format":"uri"},"login_url":{"type":"string","maxLength":1000,"format":"uri"},"category":{"default":"GTM","type":"string","minLength":1,"maxLength":80},"allowed_domains":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":253,"pattern":"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z][a-z0-9-]{1,62}$"}}},"required":["name","homepage_url","login_url"],"additionalProperties":false},"VendorUpdate":{"type":"object","properties":{"expected_revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["planned","onboarding","ready","blocked","paused"]},"session_state":{"type":"string","enum":["unknown","signed_out","active","expired","needs_human"]},"credential_ref":{"anyOf":[{"type":"string","maxLength":200,"pattern":"^(?:vault|executor|modal|profile):\\/\\/[a-zA-Z0-9][a-zA-Z0-9/_-]*$"},{"type":"null"}]},"notes":{"type":"string","maxLength":4000},"implementation_checks":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"type":"string","minLength":1,"maxLength":160},"status":{"type":"string","enum":["todo","done","blocked"]}},"required":["id","label","status"],"additionalProperties":false}}},"required":["expected_revision"],"additionalProperties":false},"RunCreate":{"type":"object","properties":{"vendor_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"intent":{"type":"string","enum":["inspect","login","implement"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}},"required":["vendor_id","intent","idempotency_key"],"additionalProperties":false},"RuntimeClaim":{"type":"object","properties":{"worker_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"capabilities":{"minItems":1,"maxItems":1,"type":"array","items":{"type":"string","enum":["computer_use"]}}},"required":["worker_id","capabilities"],"additionalProperties":false},"RuntimeHeartbeat":{"type":"object","properties":{"lease_token":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["lease_token"],"additionalProperties":false},"RuntimeEvent":{"type":"object","properties":{"lease_token":{"type":"string","pattern":"^[a-f0-9]{64}$"},"external_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"type":{"type":"string","enum":["progress","artifact","handoff","completed","failed"]},"message":{"type":"string","minLength":1,"maxLength":2000},"artifact_url":{"type":"string","maxLength":1000,"format":"uri"},"artifact_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"artifact_path":{"type":"string","maxLength":500,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_./-]*$"},"handoff_reason":{"type":"string","minLength":1,"maxLength":500},"image_data_url":{"type":"string","maxLength":240000,"pattern":"^data:image\\/jpeg;base64,\\/9j\\/[A-Za-z0-9+/]*={0,2}$"}},"required":["lease_token","external_id","type","message"],"additionalProperties":false},"RuntimeTokenCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"expires_in_days":{"default":30,"type":"integer","minimum":1,"maximum":90}},"required":["label"],"additionalProperties":false},"HandoffUpdate":{"type":"object","properties":{"status":{"type":"string","const":"resolved"},"resolution":{"type":"string","minLength":10,"maxLength":2000}},"required":["status","resolution"],"additionalProperties":false},"Vendor":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"name":{"type":"string"},"homepage_url":{"type":"string","format":"uri"},"login_url":{"type":"string","format":"uri"},"category":{"type":"string"},"allowed_domains":{"type":"array","items":{"type":"string"}},"status":{"enum":["planned","onboarding","ready","blocked","paused"]},"session_state":{"enum":["unknown","signed_out","active","expired","needs_human"]},"credential_ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"type":"string"},"implementation_checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"type":"string","minLength":1,"maxLength":160},"status":{"type":"string","enum":["todo","done","blocked"]}},"required":["id","label","status"],"additionalProperties":false}},"revision":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","homepage_url","login_url","category","allowed_domains","status","session_state","credential_ref","notes","implementation_checks","revision","created_at","updated_at"]},"Run":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"vendor_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"vendor_name":{"type":"string"},"intent":{"enum":["inspect","login","implement"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"status":{"enum":["queued","running","completed","needs_human","failed","cancelled"]},"model":{"const":"gpt-6-astra"},"reasoning_effort":{"const":"low"},"purchase_allowed":{"const":false},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","vendor_id","vendor_name","intent","idempotency_key","status","model","reasoning_effort","purchase_allowed","created_at","updated_at"]},"Event":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"run_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"external_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"type":{"enum":["progress","artifact","handoff","completed","failed"]},"message":{"type":"string"},"created_at":{"type":"string"},"image_data_url":{"type":"string","maxLength":240000,"description":"Private JPEG data URL; returned only to authenticated tenant. Omitted from ordinary MCP results."},"artifact_url":{"type":"string"},"artifact_sha256":{"type":"string"},"artifact_path":{"type":"string"},"handoff_reason":{"type":"string"}},"required":["id","run_id","external_id","type","message","created_at"]},"Handoff":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"vendor_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"run_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"reason":{"type":"string"},"status":{"enum":["open","resolved"]},"resolution":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","vendor_id","run_id","reason","status","created_at","updated_at"]},"Release":{"type":"object","properties":{"environment":{"type":"string"},"version":{"type":"string"},"commit":{"anyOf":[{"type":"string"},{"type":"null"}]},"release_sha":{"anyOf":[{"type":"string"},{"type":"null"}]},"deployed_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"persistence_environment":{"anyOf":[{"type":"string"},{"type":"null"}]},"persistence_configured":{"type":"boolean"}},"required":["environment","version","commit","release_sha","deployed_at","persistence_environment","persistence_configured"]},"WorkflowRunSummary":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"workflow_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"workflow_name":{"type":"string"},"workflow_version":{"type":"string"},"status":{"enum":["active","blocked","recorded","cancelled"]},"revision":{"type":"integer","minimum":1},"execution":{"const":"operator_assisted"},"externally_verified":{"const":false},"purchase_allowed":{"const":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"status":{"enum":["pending","blocked","recorded"]}},"required":["id","status"]}}},"required":["id","workflow_id","workflow_name","workflow_version","status","revision","execution","externally_verified","purchase_allowed","idempotency_key","created_at","updated_at","steps"]}}},"x-mcp":{"url":"/mcp","transport":"streamable_http","authentication":"Approved device bearer; no OAuth discovery or anonymous tools."}}