{"openapi":"3.1.0","info":{"title":"looot API","version":"0.1.0","description":"Discover, inspect, run, and pay for real (or fixture) provider operations through one bearer token."},"servers":[{"url":"https://api.looot.ai","description":"Public API (default)"},{"url":"https://coset-gateway.onrender.com","description":"Legacy host -- still live, for tokens issued before the public domain existed"},{"url":"http://127.0.0.1:8787","description":"Local development"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/discover":{"get":{"summary":"Discover operations","responses":{"200":{"description":"Success"}}}},"/v1/catalog/endpoints":{"get":{"summary":"Paged, filtered, faceted catalog listing","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":5000}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":4096}},{"name":"category","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"provider","in":"query","schema":{"type":"string"}},{"name":"capability","in":"query","schema":{"type":"string"}},{"name":"keyless","in":"query","schema":{"type":"boolean"}},{"name":"verified","in":"query","schema":{"type":"boolean"}},{"name":"maxPriceMicros","in":"query","schema":{"type":"integer","minimum":0}},{"name":"hidden","in":"query","schema":{"type":"boolean"}},{"name":"facets","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Catalog listing page with nextCursor and, when facets=true, category/platform/provider/capability counts for the filtered set"},"304":{"description":"Catalog unchanged since If-None-Match"},"403":{"description":"catalog:read scope required"}}}},"/v1/catalog/search":{"get":{"summary":"Ranked full-text catalog search, with capability expansion and a stemmed-token fallback so a long natural-language query is never empty","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"category","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"provider","in":"query","schema":{"type":"string"}},{"name":"capability","in":"query","schema":{"type":"string"}},{"name":"keyless","in":"query","schema":{"type":"boolean"}},{"name":"verified","in":"query","schema":{"type":"boolean"}},{"name":"mock","in":"query","description":"true/false excludes the other kind; omitted keeps both but real providers still rank above mocks","schema":{"type":"boolean"}},{"name":"maxPriceMicros","in":"query","schema":{"type":"integer","minimum":0}},{"name":"hidden","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Ranked catalog items (each carrying mock, verified, keyless, runnableNow, stats, access, matchedBy), same shape as the listing"},"400":{"description":"q is required"},"403":{"description":"catalog:read scope required"}}}},"/v1/catalog/overlay":{"get":{"summary":"Per-workspace catalog overlay (connected, platformSupply) by provider","description":"catalog-storage-plan.md 'Listing and search' (cutover step 9 tail): the dashboard reads the static catalog from the Supabase RPC coset_catalog_browse and asks the gateway only for this workspace overlay in one batched call.","responses":{"200":{"description":"{ generatedAt, workspaceId, providers: { [providerId]: { connected, platformSupply } } }"},"403":{"description":"catalog:read scope required"}}}},"/v1/catalog/endpoints/{endpointId}/verify":{"post":{"summary":"Run an endpoint's stored testRequest and stamp verifiedAt on success","description":"catalog-storage-plan.md wave-3 addendum. Dispatches through the exact same execute/settle path POST /v1/runs uses, then on success only stamps verifiedAt/verifiedRunId. Requires both runs:execute and provider-registry:write.","responses":{"200":{"description":"{ ok, endpointId, version, runId, latencyMs, error }"},"403":{"description":"runs:execute and provider-registry:write scopes both required"},"404":{"description":"Endpoint not found"},"409":{"description":"Endpoint has no stored testRequest to verify against"}}}},"/v1/operations/{endpointId}":{"get":{"summary":"Inspect an operation","responses":{"200":{"description":"Version-pinned operation contract and safe usage hints","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectOutput"}}}}}}},"/v1/runs":{"get":{"summary":"List runs -- bounded summaries (runId, endpointId, providerId, status, providerResponseStatus, createdAt, completedAt, actualCost, error, resultBytes); the full result payload stays on GET /v1/runs/{runId}; includeResult=true opts back in","responses":{"200":{"description":"Success"}}},"post":{"summary":"Create a run -- idempotencyKey replay returns the existing run (any status) with replayed:true instead of creating a new one","description":"customer-test friction #4 (docs/product/reviews/2026-09-04-customer-test): dispatch is woken immediately for the run's workspace rather than left for the next poll tick, and the run always returns immediately unless `wait` asks otherwise (either as this query parameter or as a body field of the same name -- the query parameter wins if both are given). `wait=true` (or a bare `?wait`) waits up to the default of 20 s; a number is seconds, clamped to [0, 60]. Returns the result inline, in the same run shape this endpoint already returns, once it reaches a terminal status within `wait` seconds. If it is still queued/running when the window ends, returns that queued/running run instead, exactly as with no `wait` at all -- poll it with GET /v1/runs/{runId} or runs_get.","parameters":[{"name":"wait","in":"query","schema":{"oneOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":60}]},"description":"Seconds to wait for a terminal result inline (default 20 when true/bare, max 60). Omit entirely for the pre-existing immediate-return behavior."}],"responses":{"201":{"description":"Run created (or the existing run replayed, any status, with replayed:true)"},"402":{"description":"Out of balance -- the run was blocked before dispatch, never billed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message","requestId"],"properties":{"code":{"type":"string","const":"insufficient_balance"},"message":{"type":"string"},"requestId":{"type":"string"}}},"balanceMicros":{"type":"integer"},"estimatedCostMicros":{"type":"integer"},"topUpUrl":{"type":"string","nullable":true}},"required":["error","balanceMicros","estimatedCostMicros","topUpUrl"]}}}},"409":{"description":"Idempotency-key conflict -- a request already exists for this key that this one does not match"},"429":{"description":"Rate limit exceeded (execute class, too_many_inflight_runs) -- see Retry-After and X-RateLimit-* response headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message","requestId"],"properties":{"code":{"type":"string","const":"too_many_inflight_runs"},"message":{"type":"string"},"requestId":{"type":"string"}}},"inflight":{"type":"integer"},"limit":{"type":"integer"},"retryAfterSeconds":{"type":"integer"}},"required":["error","inflight","limit","retryAfterSeconds"]}}}}}}},"/v1/runs/{runId}":{"get":{"summary":"Get a run -- on a failed run, error carries { code, providerStatus, message, requestId, whoseError, retryable, retryHint }, never secrets or raw provider headers","responses":{"200":{"description":"Success"}}}},"/v1/runs/{runId}/cancel":{"post":{"summary":"Cancel a run","responses":{"200":{"description":"Success"}}}},"/v1/runs/{runId}/attempts":{"get":{"summary":"Inspect durable attempts and receipts","responses":{"200":{"description":"Success"}}}},"/v1/connections":{"get":{"summary":"List connection metadata","responses":{"200":{"description":"Tenant connection metadata"},"403":{"description":"connections:read scope required"}}},"post":{"summary":"Register a write-only API credential","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterConnection"}}}},"responses":{"201":{"description":"Connection metadata; secrets and internal references are excluded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"403":{"description":"connections:write scope required"},"409":{"description":"Connection already exists"}}}},"/v1/connections/{connectionId}/rotate":{"post":{"summary":"Rotate a write-only API credential","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateConnection"}}}},"responses":{"200":{"description":"Connection metadata; secrets and internal references are excluded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found"}}}},"/v1/connections/{connectionId}/revoke":{"post":{"summary":"Revoke a connection and delete its encrypted credential","responses":{"200":{"description":"Connection metadata; secrets and internal references are excluded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found"}}}},"/v1/connections/{connectionId}/test":{"post":{"summary":"Verify local fixture credential access without calling the provider","responses":{"200":{"description":"Safe receipt labelled fixture_tested or not_tested; providerCalled is always false","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionTestReceipt"}}}},"400":{"description":"Credential is revoked, expired, or unavailable"},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found in this tenant"}}}},"/v1/connections/{connectionId}/test-receipts":{"get":{"summary":"List durable successful local fixture-access receipts; never live provider health","parameters":[{"name":"connectionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Newest 100 secret-free fixture receipts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionFixtureReceiptHistory"}}}},"401":{"description":"Bearer authentication required"},"403":{"description":"connections:read scope required"},"404":{"description":"Connection not found in this tenant"},"405":{"description":"Method not allowed"},"503":{"description":"Connection receipt storage unavailable"}}}},"/v1/connections/{connectionId}/probe":{"post":{"summary":"Run a real outbound health probe against the connection's configured provider host","responses":{"200":{"description":"Secret-free health receipt; classifies healthy, invalid_credentials, insufficient_scope, unavailable, rate_limited, or missing_resource, and transitions connection state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionHealthReceipt"}}}},"400":{"description":"Connection is revoked, has no probe configured, or is in cooldown"},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found"}}}},"/v1/connections/{connectionId}/authorize":{"post":{"summary":"Start an authorization-code + PKCE oauth grant for this connection","responses":{"200":{"description":"Authorization URL with state and code_challenge; the state is single-use and expires","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionAuthorization"}}}},"400":{"description":"Connection is not an oauth connection or is revoked"},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found"}}}},"/v1/connections/{connectionId}/callback":{"post":{"summary":"Complete the PKCE authorization-code exchange against the connection's fixed tokenUrl","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionCallback"}}}},"responses":{"200":{"description":"Connection metadata; secrets and internal references are excluded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"Invalid, expired, already-consumed state, or token exchange failed (moves the connection to action_required)"},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found"}}}},"/v1/connections/alerts":{"get":{"summary":"List workspace-scoped connection degradation/expiry/revocation alerts","responses":{"200":{"description":"Alerts newest first","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["alerts"],"properties":{"alerts":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionAlert"}}}}}}},"403":{"description":"connections:read scope required"}}}},"/v1/connections/alerts/{alertId}/acknowledge":{"post":{"summary":"Acknowledge one connection alert","responses":{"200":{"description":"The acknowledged alert","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionAlert"}}}},"403":{"description":"connections:write scope required"},"404":{"description":"Alert not found"}}}},"/v1/connections/{connectionId}/resources":{"get":{"summary":"List provider resources discovered by the connection's most recent probe","responses":{"200":{"description":"Resources for this connection","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["resources"],"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionResource"}}}}}}},"403":{"description":"connections:read scope required"},"404":{"description":"Connection not found"}}},"patch":{"summary":"Select exactly one discovered resource as the connection's default","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectConnectionResource"}}}},"responses":{"200":{"description":"The updated resource list","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["resources"],"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionResource"}}}}}}},"400":{"description":"Invalid resourceId"},"403":{"description":"connections:write scope required"},"404":{"description":"Connection or resource not found"}}}},"/v1/connections/{connectionId}/credentials/{role}":{"post":{"summary":"Supply a declared secondary credential (write-only) after the primary auth is connected","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplySecondaryCredential"}}}},"responses":{"200":{"description":"Connection metadata; secrets and internal references are excluded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"The role was not declared at registration, or the secret was empty"},"403":{"description":"connections:write scope required"},"404":{"description":"Connection not found"}}}},"/v1/platform-keys":{"get":{"summary":"Platform operator: list every registered provider with its platform-key status (hasKey, keyHint, fee, approved, endpoint count); never the secret","responses":{"200":{"description":"Platform key rows","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformKeyList"}}}},"403":{"description":"platform_operator_required, or provider-registry:read scope required"}}}},"/v1/platform-keys/{providerId}":{"put":{"summary":"Platform operator: set (or replace) the platform's own credential for a provider -- stored in the encrypted vault, never echoed back","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPlatformKey"}}}},"responses":{"200":{"description":"The updated platform key row","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformKey"}}}},"400":{"description":"Invalid request"},"403":{"description":"platform_operator_required, or provider-registry:write scope required"},"404":{"description":"Unknown providerId"}}},"patch":{"summary":"Platform operator: update any subset of { approved, platformFeeMicros, authMethod, headerName, paramName, valuePrefix, fields } WITHOUT the secret -- reuses the existing entry's vault ref","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchPlatformKey"}}}},"responses":{"200":{"description":"The updated platform key row","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformKey"}}}},"400":{"description":"Invalid request"},"403":{"description":"platform_operator_required, or provider-registry:write scope required"},"404":{"description":"Unknown providerId, or no platform key set yet for this provider"}}},"delete":{"summary":"Platform operator: revoke a provider's platform key and delete its encrypted secret","responses":{"200":{"description":"{ revoked: boolean }"},"403":{"description":"platform_operator_required, or provider-registry:write scope required"},"404":{"description":"No platform key was set for this provider"}}}},"/v1/platform-operators":{"get":{"summary":"Platform operator: list every organizationId granted platform-operator authority","responses":{"200":{"description":"{ operators: [{ organizationId, addedAt }] }"},"403":{"description":"platform_operator_required, or provider-registry:read scope required"},"503":{"description":"Platform operator control plane unavailable (postgres persistence backend required)"}}},"post":{"summary":"Platform operator: grant another organization platform-operator authority","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"}},"required":["organizationId"],"additionalProperties":false}}}},"responses":{"200":{"description":"{ organizationId, addedAt }"},"400":{"description":"Invalid organizationId"},"403":{"description":"platform_operator_required, or provider-registry:write scope required"},"503":{"description":"Platform operator control plane unavailable"}}}},"/v1/platform-operators/{organizationId}":{"delete":{"summary":"Platform operator: revoke another organization's platform-operator authority; refuses to remove the last remaining operator","responses":{"200":{"description":"{ removed: boolean }"},"403":{"description":"platform_operator_required, or provider-registry:write scope required"},"404":{"description":"organizationId was never a platform operator"},"409":{"description":"Cannot remove the last remaining platform operator"},"503":{"description":"Platform operator control plane unavailable"}}}},"/v1/runs/{runId}/artifacts":{"get":{"summary":"List tenant-scoped run artifact metadata","responses":{"200":{"description":"Success"}}}},"/v1/artifacts/{artifactId}":{"get":{"summary":"Get artifact metadata","responses":{"200":{"description":"Success"}}},"delete":{"summary":"Delete artifact content and retain tombstone metadata","responses":{"200":{"description":"Success"}}}},"/v1/artifacts/{artifactId}/content":{"get":{"summary":"Download integrity-verified artifact content","responses":{"200":{"description":"Binary content","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"410":{"description":"Missing, expired or deleted content"}}}},"/v1/quarantine-reviews":{"get":{"summary":"List tenant-scoped honest malware-review status records; no automated scan runs here","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","approved","rejected"]}}],"responses":{"200":{"description":"Reviews, defaulting to pending until a human decides"},"403":{"description":"artifacts:read scope required"}}},"post":{"summary":"Request a manual quarantine review for a file; starts pending, never auto-approved","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestQuarantineReview"}}}},"responses":{"201":{"description":"New or idempotently replayed pending review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuarantineReview"}}}},"400":{"description":"Invalid file id, digest, or idempotency key"},"403":{"description":"artifacts:write scope required"},"409":{"description":"Idempotency key already used with different inputs"}}}},"/v1/quarantine-reviews/{reviewId}":{"get":{"summary":"Get one quarantine review's honest status","responses":{"200":{"description":"Review record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuarantineReview"}}}},"403":{"description":"artifacts:read scope required"},"404":{"description":"Review not found in this tenant"}}}},"/v1/quarantine-reviews/{reviewId}/decide":{"post":{"summary":"Decide a pending quarantine review; a configured scanner's suspicious verdict overrides an approved decision","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideQuarantineReview"}}}},"responses":{"200":{"description":"Decided review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuarantineReview"}}}},"400":{"description":"Invalid decision or reason"},"403":{"description":"artifacts:write scope required"},"404":{"description":"Review not found in this tenant"},"409":{"description":"Review already decided differently"}}}},"/v1/reconciliations":{"get":{"summary":"List tenant-scoped pending reconciliation cases","responses":{"200":{"description":"Pending cases"},"403":{"description":"reconciliations:read scope required"}}}},"/v1/reconciliations/{attemptId}":{"post":{"summary":"Record an immutable reconciliation decision and close its reservation","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveReconciliation"}}}},"responses":{"200":{"description":"Immutable decision"},"400":{"description":"Invalid cost or evidence"},"403":{"description":"reconciliations:write scope required"},"404":{"description":"Pending case not found"},"409":{"description":"Conflicting decision already exists"}}}},"/v1/operations/reap-stale-holds":{"post":{"summary":"Platform-operator maintenance: release (or settle) every reservation stuck open past its cutoff -- a run whose process died mid-dispatch, or whose provider answer never arrived. Sweeps the caller's own workspace by default; `workspaceId` targets one specific workspace (e.g. a customer agent's), `all` sweeps every workspace with an open reservation. Response is always grouped by workspaceId.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"cutoffMinutes":{"type":"number","minimum":0,"exclusiveMinimum":0,"maximum":10080},"workspaceId":{"type":"string","minLength":1,"maxLength":200},"all":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"What was released, grouped by workspaceId"},"400":{"description":"Invalid cutoffMinutes or workspaceId"},"403":{"description":"platform_operator_required, or ops:write scope required"},"503":{"description":"Stale-hold reaper control plane unavailable"}}}},"/v1/candidates":{"get":{"summary":"List stable bounded pages of quarantined imported candidates","parameters":[{"name":"sourceRef","in":"query","schema":{"type":"string"}},{"name":"candidateKind","in":"query","schema":{"type":"string","enum":["provider","subresource","operation"]}},{"name":"reviewStatus","in":"query","schema":{"type":"string","enum":["unreviewed","reviewing","accepted","rejected"]}},{"name":"providerId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":300}}],"responses":{"200":{"description":"Review-only candidate page"},"400":{"description":"Invalid filter, limit, or stale cursor"},"403":{"description":"candidates:read scope required"}}},"post":{"summary":"Import a bounded OpenAPI JSON document into quarantine","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportCandidates"}}}},"responses":{"200":{"description":"Idempotent digest replay"},"201":{"description":"New candidate version"},"400":{"description":"Invalid or unsupported document"},"403":{"description":"candidates:write scope required"},"409":{"description":"Partial prior import"}}}},"/v1/candidate-metadata-imports":{"post":{"summary":"Import bounded provider catalog metadata as non-executable quarantine candidates","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportMetadataCandidates"}}}},"responses":{"200":{"description":"Idempotent digest replay"},"201":{"description":"New metadata source version"},"400":{"description":"Invalid or oversized metadata seed"},"403":{"description":"candidates:write scope required"},"409":{"description":"Partial prior import"}}}},"/v1/candidate-metadata-bundles":{"post":{"summary":"Atomically import up to 100 provider metadata sources with explicit license provenance","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Exact bundle version, license identity/use status, and up to 10,000 operations across 100 providers."}}}},"responses":{"200":{"description":"Idempotent bundle replay"},"201":{"description":"One or more new immutable provider source versions"},"400":{"description":"Invalid, duplicate, or oversized bundle"},"403":{"description":"candidates:write scope required"},"409":{"description":"Partial prior source state"}}}},"/v1/candidate-sources":{"get":{"summary":"List stable bounded summaries of every quarantined OpenAPI or metadata source version","parameters":[{"name":"sourceRef","in":"query","schema":{"type":"string"}},{"name":"providerId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","pattern":"^css_[a-f0-9]{32}$","maxLength":36}}],"responses":{"200":{"description":"Digest, version, operation, review and unsupported-feature summaries"},"400":{"description":"Invalid filter, limit, or stale cursor"},"403":{"description":"candidates:read scope required"}}}},"/v1/candidate-source-diffs":{"get":{"summary":"Compare added, removed, and structurally changed operations between two immutable source versions","responses":{"200":{"description":"Bounded deterministic non-executable diff"},"400":{"description":"Invalid, mismatched, or stale diff request"},"403":{"description":"candidates:read scope required"},"404":{"description":"Source version not found"}}}},"/v1/candidate-review-plans":{"post":{"summary":"Validate explicitly selected added or changed target candidates for individual review","responses":{"200":{"description":"Non-mutating per-candidate readiness plan"},"400":{"description":"Invalid or mismatched source versions"},"403":{"description":"candidates:read scope required"},"404":{"description":"Source version not found"}}}},"/v1/candidate-review-batches":{"post":{"summary":"Move explicitly selected ready diff candidates from unreviewed to reviewing only","responses":{"200":{"description":"Per-item CAS outcomes; no acceptance"},"400":{"description":"Invalid or mismatched source versions"},"403":{"description":"candidates:write scope required"},"404":{"description":"Source version not found"}}}},"/v1/candidates/{candidateId}/review":{"post":{"summary":"Compare-and-set candidate review status without activation","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCandidate"}}}},"responses":{"200":{"description":"Updated review candidate"},"400":{"description":"Invalid transition"},"403":{"description":"candidates:write scope required"},"404":{"description":"Candidate not found"},"409":{"description":"Expected status mismatch"}}}},"/v1/candidates/{candidateId}/reviewer-summary":{"get":{"summary":"Pure reviewer projection over existing state: discovered/documented/fixture_verified/authenticated_verified/approved/active, host, auth scheme, price/rights evidence, and contradictions","responses":{"200":{"description":"Reviewer summary"},"403":{"description":"candidates:read scope required"},"404":{"description":"Candidate not found or not an operation candidate"}}}},"/v1/candidate-contradictions":{"get":{"summary":"List persisted candidate contradiction findings, optionally filtered by providerSlug","responses":{"200":{"description":"Contradiction findings"},"403":{"description":"candidates:read scope required"}}},"post":{"summary":"Recompute and durably persist contradiction findings for one provider (replaces that provider's prior findings)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectCandidateContradictions"}}}},"responses":{"200":{"description":"Refreshed contradiction findings"},"400":{"description":"Invalid providerSlug"},"403":{"description":"candidates:write scope required"}}}},"/v1/onboarding-jobs":{"get":{"summary":"List this workspace's onboarding jobs","responses":{"200":{"description":"Jobs"},"403":{"description":"onboarding-jobs:read scope required"}}},"post":{"summary":"Start an ADR-005 onboarding job from an OpenAPI document/URL or a provider-kit scaffold","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOnboardingJob"}}}},"responses":{"200":{"description":"Idempotent replay of an already-started job"},"201":{"description":"New job started, stage=import"},"400":{"description":"Invalid input"},"403":{"description":"onboarding-jobs:write scope required"}}}},"/v1/onboarding-jobs/{jobId}":{"get":{"summary":"Get one onboarding job (stage, status, refs, nextAction, history)","responses":{"200":{"description":"Job"},"403":{"description":"onboarding-jobs:read scope required"},"404":{"description":"Job not found"}}}},"/v1/onboarding-jobs/{jobId}/advance":{"post":{"summary":"Run every stage whose prerequisites are met; idempotent, resumable after restart; stops at a human gate or a blocker it cannot resolve","responses":{"200":{"description":"Updated job"},"403":{"description":"onboarding-jobs:write scope required"},"404":{"description":"Job not found"}}}},"/v1/onboarding-jobs/{jobId}/decisions":{"post":{"summary":"Human decision on the rights or production_approval gate (non-self-review enforced by the underlying gate/evidence services)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideOnboardingJob"}}}},"responses":{"200":{"description":"Updated job"},"400":{"description":"No matching pending human gate, or a rights approval missing rightsTarget"},"403":{"description":"onboarding-jobs:write scope required"},"404":{"description":"Job not found"}}}},"/v1/compatibility-drafts":{"get":{"summary":"List non-executable compatibility drafts","responses":{"200":{"description":"Drafts with unresolved gates"},"403":{"description":"candidates:read scope required"}}},"post":{"summary":"Create an idempotent compatibility draft from an accepted candidate","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompatibilityDraft"}}}},"responses":{"200":{"description":"Existing draft"},"201":{"description":"New draft"},"400":{"description":"Candidate not accepted or identity incomplete"},"403":{"description":"candidates:write scope required"},"404":{"description":"Candidate not found"},"409":{"description":"Candidate drift"}}}},"/v1/compatibility-drafts/{draftId}":{"get":{"summary":"Get one non-executable compatibility draft","responses":{"200":{"description":"Compatibility draft"},"403":{"description":"candidates:read scope required"},"404":{"description":"Draft not found"}}}},"/v1/compatibility-drafts/{draftId}/gates":{"get":{"summary":"Get the immutable compatibility gate audit","responses":{"200":{"description":"Gate submissions, decisions and unresolved gates; never activation"},"403":{"description":"compatibility:read scope required"},"404":{"description":"Draft not found"}}},"post":{"summary":"Submit content-addressed evidence for one compatibility gate","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitCompatibilityGate"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable submission created"},"403":{"description":"compatibility:submit scope required"},"404":{"description":"Draft not found"}}}},"/v1/compatibility-gate-submissions/{submissionId}/decision":{"post":{"summary":"Independently approve or reject one immutable gate submission","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideCompatibilityGate"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable decision created"},"400":{"description":"Self-review or unresolved production prerequisites"},"403":{"description":"compatibility:review scope required"},"404":{"description":"Submission not found"},"409":{"description":"Conflicting prior decision"}}}},"/v1/activation-proposals":{"get":{"summary":"List immutable non-executable activation review proposals","responses":{"200":{"description":"Review proposals"},"403":{"description":"activation-proposals:read scope required"}}},"post":{"summary":"Assemble a proposal from a complete current compatibility audit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateActivationProposal"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Non-executable proposal created"},"400":{"description":"Audit incomplete"},"403":{"description":"activation-proposals:write scope required"},"404":{"description":"Draft not found"},"409":{"description":"Source or audit drift"}}}},"/v1/activation-proposals/{proposalId}":{"get":{"summary":"Get one immutable non-executable activation review proposal","responses":{"200":{"description":"Proposal with executable false"},"403":{"description":"activation-proposals:read scope required"},"404":{"description":"Proposal not found"}}}},"/v1/provider-package-drafts":{"get":{"summary":"List disabled provider engineering package drafts","responses":{"200":{"description":"Non-executable package drafts"},"403":{"description":"provider-packages:read scope required"}}},"post":{"summary":"Compile a reviewed proposal into a disabled engineering package","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderPackageDraft"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Disabled package draft created"},"403":{"description":"provider-packages:write scope required"},"404":{"description":"Proposal not found"},"409":{"description":"Source or package drift"}}}},"/v1/provider-package-drafts/{packageId}":{"get":{"summary":"Get one disabled provider engineering package draft","responses":{"200":{"description":"Package with executable false and disabled executor"},"403":{"description":"provider-packages:read scope required"},"404":{"description":"Package not found"}}}},"/v1/provider-package-revisions":{"get":{"summary":"List immutable disabled provider-package mapping revisions","responses":{"200":{"description":"Mapping revisions"},"403":{"description":"provider-packages:read scope required"}}},"post":{"summary":"Create the next typed disabled mapping revision","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderPackageRevision"}}}},"responses":{"201":{"description":"Immutable non-executable revision"},"400":{"description":"Invalid mapping"},"403":{"description":"provider-packages:write scope required"},"404":{"description":"Package not found"},"409":{"description":"Stale revision or contract drift"}}}},"/v1/provider-package-revisions/{revisionId}":{"get":{"summary":"Get one immutable disabled provider-package mapping revision","responses":{"200":{"description":"Revision with executable false"},"403":{"description":"provider-packages:read scope required"},"404":{"description":"Revision not found"}}}},"/v1/provider-package-revisions/{revisionId}/review":{"post":{"summary":"Independently approve or reject the exact current mapping revision","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideProviderMapping"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable digest-pinned review decision"},"400":{"description":"Self-review or stale revision"},"403":{"description":"provider-packages:review scope required"},"404":{"description":"Revision not found"},"409":{"description":"Conflicting decision"}}}},"/v1/provider-mapping-reviews/{packageId}":{"get":{"summary":"Get current mapping revision and independent review status","responses":{"200":{"description":"Review snapshot; activationReady is always false"},"403":{"description":"provider-packages:read scope required"}}}},"/v1/provider-activation-bundles":{"get":{"summary":"List immutable canonical disabled provider activation bundles","responses":{"200":{"description":"Bundles remain planner-ineligible and non-executable"},"403":{"description":"provider-packages:read scope required"}}},"post":{"summary":"Compile an independently approved current mapping into a canonical disabled bundle","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderActivationBundle"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable disabled bundle"},"400":{"description":"Review, revision, base package, or price-source gate failed"},"403":{"description":"provider-packages:write scope required"},"404":{"description":"Revision not found"},"409":{"description":"Bundle drift"}}}},"/v1/provider-activation-bundles/{bundleId}":{"get":{"summary":"Get one canonical disabled provider activation bundle","responses":{"200":{"description":"Canonical provider, operation, version, price, evidence, auth and planner denial"},"403":{"description":"provider-packages:read scope required"},"404":{"description":"Bundle not found"}}}},"/v1/provider-activation-bundles/{bundleId}/readiness":{"get":{"summary":"Get a deterministic non-executable activation-readiness checklist","responses":{"200":{"description":"Explicit owner, evidence and target for every planner denial"},"403":{"description":"provider-packages:read scope required"},"404":{"description":"Bundle not found"},"409":{"description":"Unclassified or contradictory blocker state"}}}},"/v1/provider-activation-bundles/{bundleId}/evidence":{"get":{"summary":"Get immutable evidence and independent decisions for current readiness blockers","responses":{"200":{"description":"Evidence snapshot; activationReady remains false"},"403":{"description":"provider-evidence:read scope required"},"404":{"description":"Bundle not found"},"409":{"description":"Bundle or report drift"}}},"post":{"summary":"Submit content-addressed evidence for one exact readiness blocker","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitProviderActivationEvidence"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable evidence submission"},"400":{"description":"Wrong report, blocker or evidence kind"},"403":{"description":"provider-evidence:submit scope required"},"404":{"description":"Bundle not found"},"409":{"description":"Submission conflict"}}}},"/v1/provider-activation-evidence-submissions/{submissionId}/decision":{"post":{"summary":"Independently approve or reject one immutable provider activation evidence submission","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideProviderActivationEvidence"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable decision"},"400":{"description":"Self-review prohibited"},"403":{"description":"provider-evidence:review scope required"},"404":{"description":"Submission not found"},"409":{"description":"Conflicting decision"}}}},"/v1/provider-activation-change-requests":{"get":{"summary":"List immutable non-executable provider activation change requests","responses":{"200":{"description":"Review requests"},"403":{"description":"provider-activation:read scope required"}}},"post":{"summary":"Assemble six approved blocker decisions into a proposed activation change set","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderActivationChangeRequest"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable non-executable request"},"400":{"description":"Evidence incomplete or report drift"},"403":{"description":"provider-activation:request scope required"},"404":{"description":"Bundle not found"}}}},"/v1/provider-activation-change-requests/{requestId}":{"get":{"summary":"Get one proposed provider activation change set","responses":{"200":{"description":"Digest-pinned request with executable false"},"403":{"description":"provider-activation:read scope required"},"404":{"description":"Request not found"}}}},"/v1/provider-activation-change-requests/{requestId}/decision":{"get":{"summary":"Get the immutable final review decision","responses":{"200":{"description":"Digest-pinned decision"},"403":{"description":"provider-activation:read scope required"},"404":{"description":"Decision not found"}}},"post":{"summary":"Independently approve or reject the exact activation-change request","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideProviderActivationChange"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable final decision"},"400":{"description":"Self-review prohibited"},"403":{"description":"provider-activation:review scope required"},"404":{"description":"Request not found"},"409":{"description":"Conflicting decision"}}}},"/v1/provider-activation-change-requests/{requestId}/dry-run":{"post":{"summary":"Run the real activation planner against actual tenant connection and process driver references without applying changes","responses":{"200":{"description":"Non-mutating planner result; executable and providerCalled remain false"},"400":{"description":"Request not approved or bundle drift"},"403":{"description":"provider-activation:dry-run or onboarding-jobs:write scope required"},"404":{"description":"Request not found"}}}},"/v1/provider-activation-change-requests/{requestId}/apply":{"post":{"summary":"Atomically audit and apply one approved, dry-run-pinned provider activation for the authenticated tenant","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyProviderActivationChange"}}}},"responses":{"200":{"description":"Idempotent replay; no state change"},"201":{"description":"Activation applied and tenant audit record created atomically"},"400":{"description":"Stale dry run, ineligible planner, or publication precondition failed"},"403":{"description":"onboarding-jobs:write scope and stable authenticated principal required"},"404":{"description":"Request not found"},"409":{"description":"Idempotency payload conflict"}}}},"/v1/route-supply":{"get":{"summary":"List fixture route supply and catalog-only imported or reviewed provider operations without activating them","responses":{"200":{"description":"Derived non-mutating supply inventory"},"403":{"description":"routes:read scope required"}}}},"/v1/provider-capability-coverage":{"get":{"summary":"Measure provider or capability coverage without conflating local fixtures with live production","parameters":[{"name":"dimension","in":"query","schema":{"type":"string","enum":["provider","capability"],"default":"provider"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":300}}],"responses":{"200":{"description":"Bounded derived coverage page with honest lifecycle totals"},"400":{"description":"Invalid query"},"403":{"description":"routes:read scope required"}}}},"/v1/provider-breadth-gaps":{"get":{"summary":"List evidence-aware provider integration targets and their exact current gap","parameters":[{"name":"providerId","in":"query","schema":{"type":"string"}},{"name":"capabilityId","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Versioned read-only target gap page"},"400":{"description":"Invalid filter or cursor"},"403":{"description":"candidates:read scope required"}}}},"/v1/provider-breadth-gaps/preview":{"post":{"summary":"Validate and preview up to 100 external provider targets without persistence, fetch, or import","responses":{"200":{"description":"Read-only canonical gap preview"},"400":{"description":"Invalid or duplicate target manifest"},"403":{"description":"candidates:read scope required"}}}},"/v1/provider-target-imports":{"post":{"summary":"Preflight one manifest target against a supplied OpenAPI document, then quarantine its candidates","responses":{"200":{"description":"Idempotent existing quarantine"},"201":{"description":"Unreviewed non-executable candidates created"},"400":{"description":"Blocked evidence, invalid document, or target operation missing"},"403":{"description":"candidates:write scope required"},"404":{"description":"Target not found"},"409":{"description":"Partial prior import state"}}}},"/v1/provider-target-import-receipts":{"get":{"summary":"List immutable catalog-to-candidate import receipts","parameters":[{"name":"catalogId","in":"query","schema":{"type":"string"}},{"name":"targetId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Durable exact catalog, target, source, and candidate lineage"},"400":{"description":"Invalid filter"},"403":{"description":"candidates:read scope required"}}}},"/v1/provider-target-catalogs":{"get":{"summary":"List immutable external provider target catalog versions","responses":{"200":{"description":"Catalog versions"},"403":{"description":"candidates:read scope required"}}},"post":{"summary":"Submit an immutable compare-and-set provider target catalog version","responses":{"200":{"description":"Idempotent existing version"},"201":{"description":"New content-addressed version"},"400":{"description":"Invalid manifest"},"403":{"description":"candidates:write scope required"},"409":{"description":"Stale parent digest"}}}},"/v1/provider-target-catalogs/{catalogId}":{"get":{"summary":"Get the current or digest-selected provider target catalog version","responses":{"200":{"description":"Immutable catalog version"},"403":{"description":"candidates:read scope required"},"404":{"description":"Catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/diff":{"get":{"summary":"Diff added, removed, and structurally changed provider targets","responses":{"200":{"description":"Non-mutating structural diff"},"403":{"description":"candidates:read scope required"},"404":{"description":"Catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/imports":{"post":{"summary":"Quarantine a supplied OpenAPI document against one exact stored catalog digest and target","responses":{"200":{"description":"Idempotent existing quarantine with catalog lineage"},"201":{"description":"Unreviewed candidates with catalog lineage"},"400":{"description":"Blocked evidence, invalid document, or operation mismatch"},"403":{"description":"candidates:write scope required"},"404":{"description":"Exact catalog digest or target not found"},"409":{"description":"Partial prior import state"}}}},"/v1/provider-target-catalogs/{catalogId}/import-plans":{"post":{"summary":"Plan selected added or changed catalog targets without importing","responses":{"200":{"description":"Read-only target import plan"},"400":{"description":"Invalid, duplicate, or unchanged selection"},"403":{"description":"candidates:read scope required"},"404":{"description":"Catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/batch-imports":{"post":{"summary":"Quarantine supplied OpenAPI documents for selected added or changed targets","responses":{"200":{"description":"Per-target created, existing, blocked, or invalid outcomes with exact catalog lineage"},"400":{"description":"Invalid, duplicate, or unchanged selection"},"403":{"description":"candidates:write scope required"},"404":{"description":"Catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/progress":{"get":{"summary":"Page exact-digest catalog targets by durable import and candidate-review stage","parameters":[{"name":"digest","in":"query","required":true,"schema":{"type":"string"}},{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string","pattern":"^target_[a-z0-9_]{1,100}$","maxLength":107}}],"responses":{"200":{"description":"Non-mutating catalog target progress page"},"400":{"description":"Invalid filter, limit, or cursor"},"403":{"description":"candidates:read scope required"},"404":{"description":"Exact catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/review-plans":{"post":{"summary":"Plan individual candidate review for selected added or changed catalog targets","responses":{"200":{"description":"Receipt-pinned non-mutating review plan"},"400":{"description":"Invalid, duplicate, or unchanged selection"},"403":{"description":"candidates:read scope required"},"404":{"description":"Exact catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/review-batches":{"post":{"summary":"Start review for ready selected catalog targets using compare-and-set only","responses":{"200":{"description":"Per-target transitioned, unchanged, blocked, missing, or conflict outcomes"},"400":{"description":"Invalid, duplicate, or unchanged selection"},"403":{"description":"candidates:write scope required"},"404":{"description":"Exact catalog version not found"}}}},"/v1/provider-target-catalogs/{catalogId}/compatibility-batches":{"post":{"summary":"Create fourteen-gate drafts for accepted receipt-pinned catalog operations","responses":{"200":{"description":"Per-target created, existing, blocked, missing, not accepted, or conflict outcomes"},"400":{"description":"Invalid, duplicate, or unchanged selection"},"403":{"description":"candidates:write scope required"},"404":{"description":"Exact catalog version not found"}}}},"/v1/provider-onboarding-queue":{"get":{"summary":"List stable, stage-filtered pages of exact next onboarding actions","parameters":[{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":300}}],"responses":{"200":{"description":"Derived non-mutating page with global stage counts"},"400":{"description":"Invalid stage, limit, or stale cursor"},"403":{"description":"candidates:read scope required"}}}},"/v1/provider-onboarding/batch-compatibility-drafts":{"post":{"summary":"Create drafts for up to 100 explicitly selected accepted operations without automating any decision","responses":{"200":{"description":"Per-item created, existing, missing, or invalid outcomes"},"400":{"description":"Invalid or duplicate batch"},"403":{"description":"candidates:write scope required"}}}},"/v1/route-templates":{"post":{"summary":"Generate a complete non-persisted route input from explicitly compatible fixture supply","responses":{"200":{"description":"Authoring template still requiring verification and independent approval"},"400":{"description":"Capability or supply selection incompatible"},"403":{"description":"routes:read scope required"}}}},"/v1/route-templates/create":{"post":{"summary":"Atomically generate a compatible template and create only its immutable route-review contract","responses":{"200":{"description":"Idempotent route version"},"201":{"description":"New route-review contract; not verified or published"},"400":{"description":"Capability or supply selection incompatible"},"403":{"description":"routes:write scope required"},"409":{"description":"Route version content conflict"}}}},"/v1/normalized-routes":{"get":{"summary":"List versioned non-executable normalized capability route contracts","responses":{"200":{"description":"Route-review contracts"},"403":{"description":"routes:read scope required"}}},"post":{"summary":"Create a digest-pinned canonical contract with at least two distinct provider adapters","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNormalizedRoute"}}}},"responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Immutable non-executable route contract"},"400":{"description":"Invalid endpoints, capability, schema, adapter or miss rule"},"403":{"description":"routes:write scope required"},"409":{"description":"Version content conflict"}}}},"/v1/normalized-routes/{routeId}":{"get":{"summary":"Get one digest-pinned normalized route contract","responses":{"200":{"description":"Canonical schemas, adapters, miss rules and source digests"},"403":{"description":"routes:read scope required"},"404":{"description":"Route not found"}}}},"/v1/normalized-routes/{routeId}/verification":{"get":{"summary":"Get fixture verification, decisions and publication for a route","responses":{"200":{"description":"Digest-pinned verification snapshot"}}},"post":{"summary":"Verify every normalized adapter offline against deterministic fixtures","responses":{"201":{"description":"Immutable verification report"},"400":{"description":"Schema, mapping, miss or cost failure"}}}},"/v1/normalized-route-verifications/{verificationId}/decision":{"post":{"summary":"Independently approve or reject a route verification","responses":{"201":{"description":"Immutable role-separated decision"},"400":{"description":"Self-review prohibited"}}}},"/v1/normalized-route-verifications/{verificationId}/publish":{"post":{"summary":"Publish an approved current route as waterfall-ready but not directly executable","responses":{"201":{"description":"Immutable publication"},"400":{"description":"Not approved or stale"}}}},"/v1/waterfall-runs":{"get":{"summary":"List tenant-scoped durable normalized waterfall runs","responses":{"200":{"description":"Waterfall runs"},"403":{"description":"waterfalls:read scope required"}}},"post":{"summary":"Start one publication-pinned budget-checked normalized waterfall","responses":{"200":{"description":"Idempotent replay"},"201":{"description":"Durable queued waterfall"},"400":{"description":"Schema, publication or budget gate failed"},"403":{"description":"waterfalls:write scope required"}}}},"/v1/waterfall-runs/{waterfallRunId}":{"get":{"summary":"Get one tenant-scoped waterfall with child cost lineage","responses":{"200":{"description":"Waterfall state"},"404":{"description":"Missing or foreign run"}}}},"/v1/waterfall-runs/{waterfallRunId}/advance":{"post":{"summary":"Advance exactly one durable waterfall boundary","responses":{"200":{"description":"Updated waterfall state"},"404":{"description":"Missing or foreign run"}}}},"/v1/provider-authoring/schema":{"get":{"summary":"Get the canonical provider mapping JSON Schema","responses":{"200":{"description":"Draft 2020-12 schema generated from runtime validation"},"403":{"description":"provider-packages:read scope required"}}}},"/v1/provider-authoring/templates/{packageId}":{"get":{"summary":"Get a deterministic non-executable package-derived mapping template","responses":{"200":{"description":"Structural defaults and explicit unresolved fields"},"403":{"description":"provider-packages:read scope required"},"404":{"description":"Package not found"}}}},"/v1/provider-authoring/validate":{"post":{"summary":"Validate a provider mapping without persisting or executing it","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateProviderMapping"}}}},"responses":{"200":{"description":"Normalized mapping or bounded path-aware issues"},"403":{"description":"provider-packages:read scope required"}}}},"/v1/provider-registry-publications":{"post":{"summary":"Publish a finally-reviewed provider activation bundle into the live, durable provider registry that discover/run read from","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishProviderRegistry"}}}},"responses":{"200":{"description":"Idempotent replay of an already-published endpoint version"},"201":{"description":"New provider and/or endpoint version published; visible immediately, no restart"},"400":{"description":"Bundle not finally reviewed, capability unsupported, auth type not injectable, price unknown, stale authenticated-test evidence, or an unacknowledged breaking contract change against the current active version"},"403":{"description":"provider-registry:write scope required"},"404":{"description":"Bundle not found"}}}},"/v1/public-catalog-publications":{"post":{"summary":"Make an already-live, active endpoint version browsable/searchable/comparable in the anonymous public catalog -- a distinct, explicitly authorized step from live-registry publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishPublicCatalog"}}}},"responses":{"200":{"description":"Idempotent replay of an already-published catalog revision"},"201":{"description":"New public catalog revision published"},"400":{"description":"Endpoint's provider missing from the registry"},"403":{"description":"provider-registry:write scope required"},"404":{"description":"No active endpoint version for this endpointId"}}}},"/v1/providers":{"get":{"summary":"List every provider in the live registry (draft, active, deprecated, retired)","responses":{"200":{"description":"Registered providers"},"403":{"description":"provider-registry:read scope required"}}}},"/v1/providers/{providerId}":{"get":{"summary":"Get one registered provider","responses":{"200":{"description":"Provider"},"403":{"description":"provider-registry:read scope required"},"404":{"description":"Provider not found"}}}},"/v1/providers/{providerId}/endpoints":{"get":{"summary":"Get every endpoint version (active, deprecated) published for one provider","responses":{"200":{"description":"Endpoint versions"},"403":{"description":"provider-registry:read scope required"},"404":{"description":"Provider not found"}}},"post":{"summary":"Register one endpoint directly as data -- no candidate/compatibility-gate/activation-bundle review required","description":"TP-CAT-10. Creates the provider if it does not exist yet (provider.displayName required in that case). Idempotent by content digest: registering the identical endpoint again is a no-op (created: false); a changed one appends a new version and supersedes the previous active one. When endpoint.capability is not a known canonical job id or alias, the response's capabilitySuggestions lists the closest canonical jobs by name/description match; pass autoCapability: true to register under the top suggestion automatically once its score clears the confidence threshold (default: register exactly the capability submitted).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDirectEndpoint"}}}},"responses":{"200":{"description":"Idempotent replay of an already-registered endpoint version. { provider, endpointVersion, created: false, capabilitySuggestions, sourceCapability }"},"201":{"description":"New provider and/or endpoint version registered; discoverable immediately. { provider, endpointVersion, created: true, capabilitySuggestions, sourceCapability }"},"400":{"description":"Invalid endpoint definition, or provider missing and no provider.displayName supplied"},"403":{"description":"provider-registry:write scope required"}}}},"/v1/providers/{providerId}/definition":{"get":{"summary":"Get one provider's full definition (docs/product/provider-definition-form.md, sections 1-8) plus computed verification/health (section 9)","responses":{"200":{"description":"{ definition, computed }"},"403":{"description":"provider-registry:read scope required"},"404":{"description":"No definition written for this provider yet"},"503":{"description":"Requires the tables catalog repository (COSET_CATALOG_SOURCE=tables|shadow)"}}},"put":{"summary":"Create or update a provider's definition","description":"Owner/admin only. Upserts the provider row and its `definition` jsonb through the catalog tables repository. The platform secret itself is never in this body -- set it via PUT /v1/platform-keys/{providerId}. Submitting oauth2 as the active authMethod is rejected (\"oauth2 not available yet\"). Body: ProviderDefinitionSchema (src/domain/provider-definition.ts) minus the immutable providerId.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"{ definition, computed }"},"400":{"description":"Invalid definition"},"403":{"description":"provider-registry:write scope required"},"503":{"description":"Requires the tables catalog repository"}}}},"/v1/providers/{providerId}/definition/import-openapi":{"post":{"summary":"Import an OpenAPI document into a provider-patch + endpoint diff preview, optionally applying it","description":"Adapters table (provider-definition-form.md): servers[0] -> baseUrl, securitySchemes -> authMethod (unknown/oauth2 scheme -> left unset with a note, never a crash), one row per operation with a suggested capability, price and inputSchema, and a create/supersede/unchanged action against this provider's current endpoints. `?apply=true` also submits every create/supersede row through the existing direct-endpoint-registration service (never edits an endpoint in place -- a changed operation supersedes with a new version).","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},{"type":"object","additionalProperties":false,"required":["document"],"properties":{"document":{}}}]}}}},"parameters":[{"name":"apply","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"{ providerPatch, operations: [{ operationId, method, path, capabilitySuggestion, price, inputSchema, action }] }"},"400":{"description":"Invalid request body, or the document could not be parsed/fetched"},"403":{"description":"provider-registry:write scope required"}}}},"/v1/provider-registry/import":{"post":{"summary":"Bulk-register direct endpoints as data, up to 500 per call","description":"TP-CAT-10. Same shared contract as POST /v1/providers/{providerId}/endpoints, one item per provider/endpoint pair (providerId inline in each item). Continues past a per-item validation or registration error instead of failing the whole batch -- one transaction per item.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDirectEndpoints"}}}},"responses":{"200":{"description":"Per-item results: { providerId, endpointId, version, created, capabilitySuggestions, error }"},"400":{"description":"Malformed request body (not a { items: [...] } object, or more than 500 items)"},"403":{"description":"provider-registry:write scope required"}}}},"/v1/ops/summary":{"get":{"summary":"Credential-health and operational inventory summary","description":"Connection states and alerts are scoped to the caller's own organization; provider health/readiness and operational alerts reflect the whole platform, matching how the provider registry itself is not tenant-scoped.","responses":{"200":{"description":"Summary"},"403":{"description":"ops:read scope required"},"503":{"description":"Ops summary unavailable"}}}},"/v1/ops/signals":{"get":{"summary":"Six operational signals: provider health, route quality, latency, errors, cost drift, reconciliation backlog","description":"Sourced from Tinybird when COSET_TINYBIRD_HOST/COSET_TINYBIRD_TOKEN are configured, or computed from local durable runtime state otherwise. Not tenant-scoped -- platform-wide operational data.","responses":{"200":{"description":"Signals"},"403":{"description":"ops:read scope required"},"503":{"description":"Ops signals unavailable"}}}},"/v1/capacity":{"get":{"summary":"Current capacity snapshot for a provider/connection/operation dimension","description":"TP-CAP-01. Reports the latest observed capacity snapshot (limit, remaining, freshness) for the caller's workspace; stale snapshots are reported as capacity_stale.","parameters":[{"name":"providerId","in":"query","required":true,"schema":{"type":"string"}},{"name":"connectionId","in":"query","required":true,"schema":{"type":"string"}},{"name":"operationId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Capacity snapshot"},"403":{"description":"capacity:read scope required"},"404":{"description":"No snapshot"}}}},"/v1/capacity/snapshots":{"post":{"summary":"Record a provider-account capacity snapshot","description":"TP-CAP-01. Ingests an observed capacity snapshot with evidence digest and expiry for the caller's workspace.","responses":{"201":{"description":"Snapshot recorded"},"400":{"description":"Invalid snapshot"},"403":{"description":"capacity:write scope required"}}}},"/v1/organizations/{organizationId}/overflow-policy":{"post":{"summary":"Set whether the organization allows same-endpoint overflow relays","description":"TP-CAP-04. Organization opt-in/opt-out for overflow relays evaluated on capacity exhaustion.","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Policy updated"},"403":{"description":"organizations:write scope required"},"404":{"description":"Organization not found"}}}},"/v1/organizations/{organizationId}/alert-settings":{"post":{"summary":"Set the connection-alert email recipient for the organization","description":"Owner/admin-only. null disables alert email entirely.","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Alert settings updated"},"403":{"description":"organizations:write scope required"},"404":{"description":"Organization not found"}}}},"/v1/organizations/{organizationId}/auto-top-up":{"get":{"summary":"Get the organization's auto top-up settings and saved card","description":"Owner/admin-only. Never returns the raw Stripe customer or payment method id -- only display brand/last4.","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Auto top-up settings"},"403":{"description":"organizations:read scope required"},"404":{"description":"Organization not found"}}},"post":{"summary":"Set the organization's auto top-up settings","description":"Owner/admin-only. amountMicros must be between $5 and $500. Triggers when a run settlement leaves the organization's available balance below thresholdMicros and a card is saved; respects monthlyCapMicros and backs off 1 hour after a declined charge.","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled","thresholdMicros","amountMicros","monthlyCapMicros"],"properties":{"enabled":{"type":"boolean"},"thresholdMicros":{"type":"integer","minimum":1},"amountMicros":{"type":"integer","minimum":5000000,"maximum":500000000},"monthlyCapMicros":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Auto top-up settings updated"},"400":{"description":"Invalid request"},"403":{"description":"organizations:write scope required"},"404":{"description":"Organization not found"}}}},"/v1/organizations/{organizationId}/auto-top-up/save-card-session":{"post":{"summary":"Start a Stripe setup-mode Checkout Session to save a card with no charge","description":"Owner/admin-only. Used by the dashboard's \"Save card\" button when the organization has no saved card yet.","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Setup Checkout Session created"},"403":{"description":"organizations:write scope required"},"404":{"description":"Organization not found"},"503":{"description":"Stripe not configured"}}}},"/v1/workspace-file-transfers":{"get":{"summary":"List transfer links for the workspace","description":"MP-FS-02. Lists issued upload/download transfer tokens (never the raw token).","responses":{"200":{"description":"Transfer links"},"403":{"description":"workspace-files:read scope required"}}},"post":{"summary":"Issue a revocable, expiring upload or download link","description":"MP-FS-02. Returns the raw token exactly once; download links require an approved quarantine review.","responses":{"201":{"description":"Transfer link issued"},"400":{"description":"Invalid request"},"403":{"description":"workspace-files:write scope required"}}}},"/v1/workspace-file-transfers/consume":{"post":{"summary":"Consume a transfer link once","description":"MP-FS-02. Single-use redemption of an upload or download token.","responses":{"200":{"description":"Consumed"},"403":{"description":"workspace-files:write scope required"},"409":{"description":"Token already consumed, revoked or expired"}}}},"/v1/workspace-file-transfers/{tokenHash}/revoke":{"post":{"summary":"Revoke a transfer link","description":"MP-FS-02. Revokes an unconsumed transfer token by its hash.","parameters":[{"name":"tokenHash","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked"},"403":{"description":"workspace-files:write scope required"},"404":{"description":"Token not found"}}}},"/v1/provider-availability-overrides":{"get":{"summary":"List operator-set provider drain/disable overrides","responses":{"200":{"description":"Overrides"},"403":{"description":"provider-registry:read scope required"}}},"post":{"summary":"Set (drain/disable) or clear (active) a provider availability override","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["providerId","status","reason"],"properties":{"providerId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"version":{"type":["integer","null"],"minimum":1},"region":{"type":["string","null"],"pattern":"^[a-z][a-z0-9-]{1,31}$"},"status":{"enum":["active","draining","disabled"]},"reason":{"type":"string","minLength":1,"maxLength":500}}}}}},"responses":{"200":{"description":"Current override (null if cleared)"},"400":{"description":"Invalid request"},"403":{"description":"provider-registry:write scope required"}}}},"/v1/provider-registry/{endpointId}/effect-classification":{"post":{"summary":"Set the effect classification (idempotent/effectful/unknown) for a published endpoint version","parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["version","effectClassification"],"properties":{"version":{"type":"integer","minimum":1},"effectClassification":{"enum":["idempotent","effectful","unknown"]}}}}}},"responses":{"200":{"description":"Updated endpoint version"},"403":{"description":"provider-registry:write scope required"},"404":{"description":"Endpoint version not found"}}}},"/v1/workflows":{"get":{"summary":"List tenant-scoped workflow definitions","responses":{"200":{"description":"Workflow definitions"},"403":{"description":"workflows:read scope required"}}},"post":{"summary":"Create a workflow and its first draft version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflow"}}}},"responses":{"201":{"description":"Workflow snapshot"},"400":{"description":"Invalid workflow"},"403":{"description":"workflows:write scope required"}}}},"/v1/workflows/{workflowId}":{"get":{"summary":"Get a workflow and all immutable versions","responses":{"200":{"description":"Workflow snapshot"},"403":{"description":"workflows:read scope required"},"404":{"description":"Workflow not found"}}}},"/v1/workflows/{workflowId}/revisions":{"post":{"summary":"Create the next draft workflow version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseWorkflow"}}}},"responses":{"201":{"description":"Workflow snapshot"},"403":{"description":"workflows:write scope required"},"404":{"description":"Workflow not found"},"409":{"description":"Draft already exists"}}}},"/v1/workflows/{workflowId}/publish":{"post":{"summary":"Publish an acyclic workflow version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishWorkflow"}}}},"responses":{"200":{"description":"Published workflow snapshot"},"400":{"description":"Invalid dependency graph"},"403":{"description":"workflows:write scope required"},"409":{"description":"Version is not draft"}}}},"/v1/workflows/{workflowId}/runs":{"post":{"summary":"Start one idempotent version-pinned workflow run","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWorkflow"}}}},"responses":{"201":{"description":"Workflow run snapshot"},"403":{"description":"workflows:execute scope required"},"404":{"description":"Published workflow not found"}}}},"/v1/workflow-runs/{workflowRunId}":{"get":{"summary":"Get a tenant-scoped workflow run and step facts","responses":{"200":{"description":"Workflow run snapshot"},"403":{"description":"workflows:read scope required"},"404":{"description":"Workflow run not found"}}}},"/v1/workflow-runs/{workflowRunId}/advance":{"post":{"summary":"Advance at most one ready workflow step","responses":{"200":{"description":"Advanced workflow run snapshot"},"403":{"description":"workflows:execute scope required"},"404":{"description":"Workflow run not found"}}}},"/v1/workflow-runs/{workflowRunId}/cancel":{"post":{"summary":"Request effect-aware workflow cancellation","responses":{"200":{"description":"Workflow run snapshot"},"403":{"description":"workflows:execute scope required"},"404":{"description":"Workflow run not found"}}}},"/v1/workflow-waits":{"get":{"summary":"List tenant-scoped pending workflow waits","responses":{"200":{"description":"Pending waits"},"403":{"description":"workflows:read scope required"}}}},"/v1/workflow-waits/{waitId}/token":{"post":{"summary":"Mint a short-lived wait-bound capability token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintWorkflowToken"}}}},"responses":{"201":{"description":"Signed capability token"},"403":{"description":"workflows:execute scope required"},"404":{"description":"Pending wait not found"}}}},"/v1/workflow-waits/{waitId}/approval":{"post":{"summary":"Resolve an approval using bearer identity and signed capability","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveWorkflowApproval"}}}},"responses":{"200":{"description":"Resolved wait"},"401":{"description":"Invalid capability token"},"403":{"description":"workflows:execute scope required"},"409":{"description":"Wait already resolved"},"410":{"description":"Capability expired"}}}},"/v1/workflow-callbacks/{token}":{"post":{"security":[],"summary":"Resolve an external callback using a signed capability","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveWorkflowCallback"}}}},"responses":{"200":{"description":"Resolved wait"},"401":{"description":"Invalid capability token"},"409":{"description":"Wait already resolved"},"410":{"description":"Capability expired"}}}},"/v1/output-mappings":{"get":{"summary":"List tenant-scoped output mappings","responses":{"200":{"description":"Output mappings"},"403":{"description":"mappings:read scope required"},"503":{"description":"Control plane unavailable"}}},"post":{"summary":"Create an immutable output mapping","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOutputMapping"}}}},"responses":{"201":{"description":"Created output mapping"},"400":{"description":"Invalid mapping"},"403":{"description":"mappings:write scope required"},"409":{"description":"Mapping already exists"},"503":{"description":"Control plane unavailable"}}}},"/v1/output-mappings/{mappingId}":{"get":{"summary":"Get a tenant-scoped output mapping and immutable versions","responses":{"200":{"description":"Output mapping"},"403":{"description":"mappings:read scope required"},"404":{"description":"Mapping not found"},"503":{"description":"Control plane unavailable"}}}},"/v1/output-mappings/{mappingId}/revisions":{"post":{"summary":"Create the next immutable output mapping version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseOutputMapping"}}}},"responses":{"201":{"description":"Revised output mapping"},"400":{"description":"Invalid mapping"},"403":{"description":"mappings:write scope required"},"404":{"description":"Mapping not found"},"409":{"description":"Revision conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/output-mappings/{mappingId}/preview":{"post":{"summary":"Evaluate an output mapping without provider, ledger, or publication effects","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewOutputMapping"}}}},"responses":{"200":{"description":"Mapped output, structured issues, and field provenance"},"400":{"description":"Invalid preview input"},"403":{"description":"mappings:read scope required"},"404":{"description":"Mapping or version not found"},"503":{"description":"Control plane unavailable"}}}},"/v1/output-mappings/{mappingId}/publish":{"post":{"summary":"Publish an immutable output mapping version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOutputMappingPublication"}}}},"responses":{"200":{"description":"Published output mapping"},"400":{"description":"Invalid publication"},"403":{"description":"mappings:publish scope required"},"404":{"description":"Mapping or version not found"},"409":{"description":"Revision conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/output-mappings/{mappingId}/rollback":{"post":{"summary":"Roll back to a previously published output mapping version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOutputMappingPublication"}}}},"responses":{"200":{"description":"Rolled-back output mapping"},"400":{"description":"Invalid rollback target"},"403":{"description":"mappings:publish scope required"},"404":{"description":"Mapping or version not found"},"409":{"description":"Revision conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/run-replays":{"post":{"summary":"Plan or admit a safe read-only run replay","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["sourceRunId","mode","idempotencyKey"],"properties":{"sourceRunId":{"type":"string"},"mode":{"enum":["pinned","latest"]},"idempotencyKey":{"type":"string","maxLength":300},"execute":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Replay plan or admitted replay"},"400":{"description":"Invalid or unsafe replay"},"404":{"description":"Source run not found"},"409":{"description":"Idempotency conflict"}}}},"/v1/workflows/preview":{"post":{"summary":"Validate and preview a workflow without external effects","responses":{"200":{"description":"Success"}}}},"/v1/workflow-products/{workflowId}/actions":{"post":{"summary":"Pause, resume, clone, or roll back a workflow product","responses":{"200":{"description":"Success"}}}},"/v1/workflow-products/{workflowId}/versions/{version}/export":{"get":{"summary":"Export a pinned workflow product version","responses":{"200":{"description":"Success"}}}},"/v1/workflow-runs/{workflowRunId}/retry":{"post":{"summary":"Request a proven no-effect failed-step retry","responses":{"200":{"description":"Success"}}}},"/v1/workflow-triggers":{"get":{"summary":"List tenant workflow triggers","responses":{"200":{"description":"Success"}}},"post":{"summary":"Create a schedule, event, or webhook trigger","responses":{"200":{"description":"Success"}}}},"/v1/workflow-triggers/{triggerId}/status":{"post":{"summary":"Pause, resume, or revoke a workflow trigger","responses":{"200":{"description":"Success"}}}},"/v1/workflow-triggers/{triggerId}/deliver":{"post":{"summary":"Accept an idempotent trigger delivery","responses":{"200":{"description":"Success"}}}},"/v1/tenant-tools":{"get":{"summary":"List tenant tool metadata","responses":{"200":{"description":"Tenant-scoped tool identities and lifecycle state; no credential references or request paths"},"403":{"description":"local-product:read scope required"},"503":{"description":"Control plane unavailable"}}},"post":{"summary":"Create a tenant tool draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["toolId","bundleId","definition"],"properties":{"toolId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"bundleId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"definition":{"type":"object","description":"Strict bounded fixed-origin request policy; tenant and actor are server-derived"}}}}}},"responses":{"201":{"description":"Redacted draft metadata"},"400":{"description":"Invalid definition"},"403":{"description":"local-product:manage scope required"},"409":{"description":"Tool already exists or dependency conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}":{"get":{"summary":"Get redacted tenant tool lifecycle metadata","responses":{"200":{"description":"Revisions (including the reviewed fixed-host request policy and opaque credential binding references) and grants. Never includes secret values or raw header/cookie content."},"403":{"description":"local-product:read scope required"},"404":{"description":"Tool not found in this tenant"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/revisions":{"post":{"summary":"Create the next tenant tool revision","responses":{"201":{"description":"Redacted draft revision"},"400":{"description":"Invalid definition"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool not found"},"409":{"description":"Revision conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/publish":{"post":{"summary":"Publish a tenant tool revision","responses":{"200":{"description":"Redacted published revision"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool not found"},"409":{"description":"Draft or revision conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/revoke":{"post":{"summary":"Revoke a published tenant tool","responses":{"200":{"description":"Redacted revoked revision"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool not found"},"409":{"description":"Lifecycle conflict"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/delete":{"post":{"summary":"Delete an unused initial tenant tool draft","responses":{"200":{"description":"Deletion acknowledged"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool not found"},"409":{"description":"Tool has references or is not an initial draft"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/tombstone":{"post":{"summary":"Tombstone a revoked unreferenced tenant tool","responses":{"200":{"description":"Redacted tombstone metadata"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool not found"},"409":{"description":"Tool has references or is not revoked"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/grants":{"post":{"summary":"Grant scoped tenant tool access","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["grantId","principalId","permission"],"properties":{"grantId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"principalId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"permission":{"enum":["invoke","manage"]}}}}}},"responses":{"201":{"description":"Tenant-scoped grant metadata"},"400":{"description":"Invalid grant"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool not found"},"409":{"description":"Grant already exists"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/grants/{grantId}/revoke":{"post":{"summary":"Revoke one tenant-scoped tool grant","responses":{"200":{"description":"Revocation acknowledged"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Tool or grant not found"},"503":{"description":"Control plane unavailable"}}}},"/v1/tenant-tools/{toolId}/invoke":{"post":{"summary":"Invoke a published tenant tool","description":"The caller must hold an active invoke or manage grant on this tool; the outbound call is constrained to the tool's reviewed request policy (origin, method, path prefix, header allowlist). The default LOCAL_ALPHA token intentionally lacks local-product:execute.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["method","path"],"properties":{"method":{"enum":["GET","POST","PUT","PATCH","DELETE"]},"path":{"type":"string","minLength":1,"maxLength":1024},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{}}}}}},"responses":{"200":{"description":"Downstream status, headers and body text"},"401":{"description":"Authentication required"},"403":{"description":"local-product:execute scope required, or the caller holds no active grant on this tool (tool_grant_required)"},"404":{"description":"Tool not found"},"503":{"description":"Control plane unavailable"}}}},"/v1/whoami":{"get":{"summary":"Current principal's membership, organization, tool grants and machine sessions","responses":{"200":{"description":"Organization, membership, active tool grants and active machine sessions; never includes a tokenHash"},"403":{"description":"organizations:read scope required"},"404":{"description":"No membership in the token's organization"},"503":{"description":"Control plane unavailable"}}}},"/v1/monid-trace":{"get":{"summary":"Reviewer-facing trace of every Monid-derived story: public source, looot evidence, dependency, and freshness","responses":{"200":{"description":"The verified trace joined with the story ledger"},"403":{"description":"local-product:read scope required"},"503":{"description":"The trace failed its own verify-beyond-treg honesty checks and is refused"}}}},"/v1/invitations/redeem":{"post":{"summary":"Redeem an organization invitation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token","email"],"properties":{"token":{"type":"string","minLength":1,"maxLength":512,"writeOnly":true},"email":{"type":"string","format":"email","maxLength":320}}}}}},"responses":{"200":{"description":"New membership"},"400":{"description":"Invalid, expired, wrong-email or already-consumed invitation"},"403":{"description":"organizations:write scope required"},"409":{"description":"Already a member of this organization"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations":{"get":{"summary":"List organizations the caller belongs to","responses":{"200":{"description":"Active organizations with an active membership for the caller"},"403":{"description":"organizations:read scope required"},"503":{"description":"Control plane unavailable"}}},"post":{"summary":"Create an organization; the caller becomes its owner","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["slug","displayName"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":63},"displayName":{"type":"string","minLength":1,"maxLength":120}}}}}},"responses":{"201":{"description":"Created organization"},"400":{"description":"Invalid slug or display name"},"403":{"description":"organizations:write scope required"},"409":{"description":"Slug already in use"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}":{"get":{"summary":"Get an organization the caller belongs to","responses":{"200":{"description":"Organization"},"403":{"description":"organizations:read scope required"},"404":{"description":"Not found or caller is not a member"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}/members":{"get":{"summary":"List an organization's memberships","responses":{"200":{"description":"Memberships, principal identifiers, role and status"},"403":{"description":"organizations:read scope required"},"404":{"description":"Not found or caller is not a member"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}/members/{membershipId}/role":{"post":{"summary":"Change a member's role","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["role"],"properties":{"role":{"enum":["owner","admin","member","viewer"]}}}}}},"responses":{"200":{"description":"Updated membership"},"403":{"description":"owner/admin role required, or a forbidden self-escalation or cross-role change"},"404":{"description":"Membership not found"},"409":{"description":"Would remove the organization's last owner"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}/members/{membershipId}/remove":{"post":{"summary":"Remove a member; revokes their tool grants and machine sessions","responses":{"200":{"description":"Removal acknowledged"},"403":{"description":"owner/admin role required"},"404":{"description":"Membership not found"},"409":{"description":"Would remove the organization's last owner"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}/invitations":{"get":{"summary":"List an organization's invitations","responses":{"200":{"description":"Invitations without their token or token hash"},"403":{"description":"owner/admin role required"},"404":{"description":"Not found or caller is not a member"},"503":{"description":"Control plane unavailable"}}},"post":{"summary":"Invite a member with a role","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","role"],"properties":{"email":{"type":"string","format":"email","maxLength":320},"role":{"enum":["admin","member","viewer"]},"expiresInSeconds":{"type":"integer","minimum":3600,"maximum":2592000,"default":604800}}}}}},"responses":{"201":{"description":"The minted invitation token, returned exactly once, and its redacted invitation record"},"400":{"description":"Invalid input"},"403":{"description":"owner/admin role required"},"409":{"description":"A pending invitation for this email already exists"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}/invitations/{invitationId}/revoke":{"post":{"summary":"Revoke a pending invitation","responses":{"200":{"description":"Revoked invitation"},"403":{"description":"owner/admin role required"},"404":{"description":"Invitation not found"},"409":{"description":"Invitation is not pending"},"503":{"description":"Control plane unavailable"}}}},"/v1/organizations/{organizationId}/machine-sessions":{"get":{"summary":"Org-wide machine session inventory","description":"Owner/admin only: every member's non-interactive agent tokens in this organization, not only the caller's.","responses":{"200":{"description":"Machine sessions without their tokenHash"},"403":{"description":"owner/admin role required"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundle-ids":{"get":{"summary":"List distinct skill bundle ids known to the tenant","responses":{"200":{"description":"Sorted, deduplicated bundle ids derived from existing version records"},"403":{"description":"local-product:read scope required"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles":{"post":{"summary":"Quarantine metadata for a skill bundle","description":"This metadata-only route does not upload or distribute file contents. Supplied digests must exactly match server recomputation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["bundleId","manifest","manifestDigest","contentDigest"],"properties":{"bundleId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"manifest":{"type":"object","additionalProperties":false,"required":["name","description","entrypoint","files"],"properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"description":{"type":"string","minLength":1,"maxLength":1000},"entrypoint":{"type":"string","minLength":1,"maxLength":512,"pattern":"^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$)).+(?<!/)$"},"files":{"type":"array","minItems":1,"maxItems":256,"items":{"type":"object","additionalProperties":false,"required":["path","sizeBytes","digest"],"properties":{"path":{"type":"string","minLength":1,"maxLength":512,"pattern":"^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$)).+(?<!/)$"},"sizeBytes":{"type":"integer","minimum":0,"maximum":1048576},"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}}}},"manifestDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"contentDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"replace":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Redacted quarantined version metadata"},"400":{"description":"Invalid manifest or digest mismatch"},"403":{"description":"local-product:manage scope required"},"409":{"description":"Changed bundle requires explicit replacement"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}":{"get":{"summary":"List immutable redacted skill bundle versions","responses":{"200":{"description":"Manifest summary without file paths, signatures, PEM, or secrets"},"403":{"description":"local-product:read scope required"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}/{version}/review":{"post":{"summary":"Submit quarantined metadata for review","responses":{"200":{"description":"Redacted review-state metadata"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Version not found"},"409":{"description":"Invalid lifecycle transition"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}/{version}/publish":{"post":{"summary":"Verify a reviewed version against a registered public key and publish it","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["keyId","signature"],"properties":{"keyId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"signature":{"type":"string","minLength":1,"maxLength":16384,"writeOnly":true}}}}}},"responses":{"200":{"description":"Redacted published metadata; signature omitted"},"400":{"description":"Invalid signature"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Version or trust key not found"},"409":{"description":"Invalid lifecycle transition"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}/{version}/revoke":{"post":{"summary":"Revoke a published skill bundle","responses":{"200":{"description":"Redacted revoked metadata"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Version not found"},"409":{"description":"Invalid lifecycle transition"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}/{version}/rollback":{"post":{"summary":"Stage a new quarantined version derived from a previously published target version","description":"The path {version} names the already-published target to roll back to, not the version being mutated. This never republishes anything instantly: it creates a new quarantined version (with derivedFromVersion set to the target) that must still pass the normal review and signing path before it can be published.","responses":{"201":{"description":"Redacted quarantined version metadata derived from the target"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Target version not found"},"409":{"description":"Target version is not published"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}/{version}/install":{"post":{"summary":"Install explicitly selected manifest entries from a published skill bundle","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["selectedFiles"],"properties":{"selectedFiles":{"type":"array","minItems":1,"maxItems":256,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":512}}}}}}},"responses":{"201":{"description":"Metadata-only shared skill installation"},"400":{"description":"Invalid or unlisted manifest entry"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Bundle version not found"},"409":{"description":"Bundle version is not published"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-bundles/{bundleId}/{version}/delete":{"post":{"summary":"Delete an unreferenced skill bundle version","responses":{"200":{"description":"Deletion acknowledged"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Bundle version not found"},"409":{"description":"Active shared installation references this version"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-installs":{"get":{"summary":"List tenant-scoped shared skill installations","parameters":[{"name":"bundleId","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}],"responses":{"200":{"description":"Installation metadata without bundle contents or secrets"},"400":{"description":"Invalid or repeated query"},"403":{"description":"local-product:read scope required"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-installs/{installId}/remove":{"post":{"summary":"Remove one tenant-scoped shared skill installation","responses":{"200":{"description":"Removed installation metadata"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Installation not found"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-trust-keys":{"get":{"summary":"List redacted tenant trust-key metadata","responses":{"200":{"description":"Key ids and lifecycle timestamps; PEM omitted"},"403":{"description":"local-product:read scope required"},"503":{"description":"Control plane unavailable"}}},"post":{"summary":"Register a bounded public signing key","description":"Accepts public key material only; private signing keys are never accepted or stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["keyId","publicKeyPem"],"properties":{"keyId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"publicKeyPem":{"type":"string","minLength":32,"maxLength":16384}}}}}},"responses":{"201":{"description":"Redacted tenant-scoped trusted-key metadata; PEM omitted"},"400":{"description":"Invalid public key"},"403":{"description":"local-product:manage scope required"},"409":{"description":"Trust key already exists"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-trust-keys/{keyId}/revoke":{"post":{"summary":"Revoke one tenant-scoped public trust key","responses":{"200":{"description":"Redacted revoked-key metadata; PEM omitted"},"403":{"description":"local-product:manage scope required"},"404":{"description":"Trust key not found"},"503":{"description":"Control plane unavailable"}}}},"/v1/skill-uploads":{"get":{"summary":"List tenant-scoped atomic skill upload receipts","responses":{"200":{"description":"Redacted receipts without environment digests, credential references, request digests, file paths, or contents"},"403":{"description":"local-product:read scope required"},"503":{"description":"Control plane unavailable"}}},"post":{"summary":"Atomically quarantine skill metadata and owned tool drafts","description":"The server validates the bounded manifest, recomputes manifest and content-set digests, derives tenant and actor identity, and commits bundle, tools, and receipt in one transaction. This metadata-only route does not receive or distribute raw file contents.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["bundleId","idempotencyKey","manifest","selectedEnvironmentKeyNames","tools"],"properties":{"bundleId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"idempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"},"manifest":{"type":"object","additionalProperties":false,"required":["name","description","entrypoint","files"],"properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"description":{"type":"string","minLength":1,"maxLength":1000},"entrypoint":{"type":"string","minLength":1,"maxLength":512,"pattern":"^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$)).+(?<!/)$"},"files":{"type":"array","minItems":1,"maxItems":256,"items":{"type":"object","additionalProperties":false,"required":["path","sizeBytes","digest"],"properties":{"path":{"type":"string","minLength":1,"maxLength":512,"pattern":"^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$)).+(?<!/)$"},"sizeBytes":{"type":"integer","minimum":0,"maximum":1048576},"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}}}},"selectedEnvironmentKeyNames":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,255}$"}},"tools":{"type":"array","maxItems":100,"items":{"type":"object","description":"Strict tenant tool definition without tenant, actor, or owner identity"}},"replace":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Redacted atomic upload receipt"},"400":{"description":"Invalid, missing environment name, or digest computation failure"},"403":{"description":"local-product:manage scope required; default LOCAL_ALPHA token is intentionally denied"},"409":{"description":"Idempotency, version, dependency, or replacement conflict"},"503":{"description":"Generic retry-unsafe uncertain commit or unavailable control plane"}}}},"/v1/skill-uploads/{uploadId}/removal-plan":{"get":{"summary":"Preview a skill upload's removal plan","responses":{"200":{"description":"Success"}}}},"/v1/skill-uploads/{uploadId}/remove":{"post":{"summary":"Apply a previously previewed skill upload removal plan","responses":{"200":{"description":"Success"}}}},"/v1/audit-records":{"get":{"summary":"Inspect a structurally consistent bounded tenant audit page","description":"Structural consistency covers the currently stored contiguous chain only. It does not prove that a suffix was not truncated or that the complete history was not rewritten.","parameters":[{"name":"action","in":"query","schema":{"type":"string","minLength":2,"maxLength":128}},{"name":"resourceType","in":"query","schema":{"type":"string","minLength":2,"maxLength":64}},{"name":"resourceId","in":"query","schema":{"type":"string","minLength":2,"maxLength":128}},{"name":"outcome","in":"query","schema":{"enum":["succeeded","denied","failed"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"maxLength":2048}}],"responses":{"200":{"description":"Structurally consistent payload-free audit page with the same truncation and rewrite limitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditPage"}}}},"400":{"description":"Invalid, repeated, stale, or unknown cursor/query"},"401":{"description":"Authentication required"},"403":{"description":"audit:read scope required"},"503":{"description":"Audit integrity unavailable; details withheld"}}}},"/v1/public-catalog":{"get":{"security":[],"summary":"Search stable redacted public catalog pages by text, capability, category, or provider","description":"Publicly browsable without a bearer token; the catalog is not tenant-scoped.","parameters":[{"name":"text","in":"query","schema":{"type":"string","minLength":1,"maxLength":200},"description":"At most 800 UTF-8 bytes; control characters rejected"},{"name":"q","in":"query","schema":{"type":"string","minLength":1,"maxLength":200},"description":"Alias for text; cannot be combined with text"},{"name":"capability","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}},{"name":"category","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}},{"name":"provider","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}},{"name":"operationId","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"maxLength":4096}}],"responses":{"200":{"description":"Stable public catalog page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCatalogPage"}}}},"400":{"description":"Invalid, repeated, or malformed query/cursor"},"401":{"description":"Only returned for a malformed request; no bearer token is required"},"403":{"description":"Catalog read scope required"},"409":{"description":"catalog_cursor_stale: cursor no longer matches the query or catalog snapshot"}}}},"/v1/public-catalog/{catalogItemId}":{"get":{"security":[],"summary":"Inspect one public published catalog item; hidden and missing ids share 404","description":"Publicly browsable without a bearer token; the catalog is not tenant-scoped.","parameters":[{"name":"catalogItemId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}],"responses":{"200":{"description":"Public catalog item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCatalogItem"}}}},"401":{"description":"Only returned for a malformed request; no bearer token is required"},"403":{"description":"Catalog read scope required"},"404":{"description":"Catalog item not found"}}}},"/v1/public-catalog/compare":{"post":{"security":[],"summary":"Compare 2 to 20 explicit public catalog items without inferring missing price semantics","description":"Publicly browsable without a bearer token; the catalog is not tenant-scoped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["catalogItemIds"],"properties":{"catalogItemIds":{"type":"array","minItems":2,"maxItems":20,"uniqueItems":true,"items":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}}}}}},"responses":{"200":{"description":"Conservative catalog comparison","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCatalogComparison"}}}},"400":{"description":"Invalid selection"},"401":{"description":"Only returned for a malformed request; no bearer token is required"},"403":{"description":"Catalog read scope required"},"404":{"description":"One or more catalog items not found"}}}},"/v1/capability-requests":{"get":{"summary":"List tenant capability requests","responses":{"200":{"description":"Success"}}},"post":{"summary":"Create an idempotent tenant capability request","responses":{"200":{"description":"Success"}}}},"/v1/vendor-submissions":{"get":{"summary":"List tenant vendor submissions","responses":{"200":{"description":"Success"}}},"post":{"summary":"Quarantine vendor metadata without fetching supplied URLs","responses":{"200":{"description":"Success"}}}},"/v1/taxonomies":{"post":{"summary":"Create an immutable taxonomy version","responses":{"200":{"description":"Success"}}}},"/v1/taxonomies/{taxonomyId}":{"get":{"summary":"Get the latest visible taxonomy version","responses":{"200":{"description":"Success"}}}},"/v1/taxonomies/{taxonomyId}/{version}":{"get":{"summary":"Get an exact visible taxonomy version","responses":{"200":{"description":"Success"}}}},"/v1/workspace-files":{"get":{"summary":"List tenant workspace file metadata with safe revisions","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","maxItems":100000,"items":{"$ref":"#/components/schemas/WorkspaceFile"}}}}},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:read scope required"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}},"post":{"summary":"Create a bounded tenant workspace file","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["path","contentType","contentBase64","retentionSeconds"],"properties":{"path":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"contentType":{"type":"string","minLength":1,"maxLength":200},"contentBase64":{"type":"string","minLength":4,"maxLength":699052,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","description":"Canonical padded base64; decoded body is at most 524288 bytes"},"retentionSeconds":{"type":"integer","minimum":1,"maximum":31536000}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceFile"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"409":{"description":"Path or quota conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/workspace-files/usage":{"get":{"summary":"Get tenant workspace quota usage","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUsage"}}}},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:read scope required"},"503":{"description":"Storage unavailable"}}}},"/v1/workspace-files/{path}":{"get":{"summary":"Read a tenant workspace file as canonical base64","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"responses":{"200":{"description":"Safe metadata revision and content; internal storage identifiers and host paths are excluded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRead"}}}},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:read scope required"},"404":{"description":"File not found"},"503":{"description":"Storage unavailable"}}}},"/v1/workspace-files/{path}/update":{"post":{"summary":"CAS-update a tenant workspace file","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expectedRevision","contentBase64"],"properties":{"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991},"contentBase64":{"type":"string","minLength":4,"maxLength":699052,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"},"contentType":{"type":"string","minLength":1,"maxLength":200},"retentionSeconds":{"type":"integer","minimum":1,"maximum":31536000}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceFile"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"404":{"description":"File not found"},"409":{"description":"Revision or quota conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/workspace-files/{path}/move":{"post":{"summary":"CAS-move a tenant workspace file","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expectedRevision","toPath"],"properties":{"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991},"toPath":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"}}}}}},"responses":{"200":{"description":"Moved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceFile"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"404":{"description":"File not found"},"409":{"description":"Revision or path conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/workspace-files/{path}/delete":{"post":{"summary":"CAS-delete a tenant workspace file","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expectedRevision"],"properties":{"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991}}}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceFile"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"404":{"description":"File not found"},"409":{"description":"Revision conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/workspace-directories":{"get":{"summary":"List the durable root namespace and revision","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDirectoryPage"}}}},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:read scope required"},"503":{"description":"Storage unavailable"}}},"post":{"summary":"CAS-create a durable directory","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["path","expectedNamespaceRevision"],"properties":{"path":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"expectedNamespaceRevision":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDirectoryMutationResult"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"409":{"description":"Namespace or path conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/workspace-directories/{path}":{"get":{"summary":"List a durable directory and safe revisions","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDirectoryPage"}}}},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:read scope required"},"404":{"description":"Directory not found"},"503":{"description":"Storage unavailable"}}}},"/v1/workspace-directories/{path}/move":{"post":{"summary":"CAS-move a durable directory","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["toPath","expectedRevision","expectedNamespaceRevision"],"properties":{"toPath":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"recursive":{"type":"boolean","default":false},"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991},"expectedNamespaceRevision":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}}}},"responses":{"200":{"description":"Moved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDirectoryMutationResult"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"404":{"description":"Directory not found"},"409":{"description":"Directory or namespace revision conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/workspace-directories/{path}/delete":{"post":{"summary":"CAS-delete a durable directory","parameters":[{"name":"path","in":"path","required":true,"description":"Percent-encoded canonical virtual path","schema":{"type":"string","minLength":1,"maxLength":3072}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expectedRevision","expectedNamespaceRevision"],"properties":{"recursive":{"type":"boolean","default":false},"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991},"expectedNamespaceRevision":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDirectoryMutationResult"}}}},"400":{"description":"Invalid body"},"401":{"description":"Authentication required"},"403":{"description":"workspace-files:write scope required"},"404":{"description":"Directory not found"},"409":{"description":"Directory or namespace revision conflict"},"503":{"description":"Storage unavailable or commit outcome uncertain"}}}},"/v1/route-policies":{"get":{"summary":"List route policies","responses":{"200":{"description":"Success"}}},"post":{"summary":"Create a route policy draft","responses":{"200":{"description":"Success"}}}},"/v1/route-policies/{policyId}":{"get":{"summary":"Get a route policy","responses":{"200":{"description":"Success"}}}},"/v1/route-policies/{policyId}/revisions":{"post":{"summary":"Revise a route policy draft","responses":{"200":{"description":"Success"}}}},"/v1/route-policies/{policyId}/publish":{"post":{"summary":"Publish a route policy version","responses":{"200":{"description":"Success"}}}},"/v1/route-policies/{policyId}/rollback":{"post":{"summary":"Roll back to a prior route policy version","responses":{"200":{"description":"Success"}}}},"/v1/route-plans/preview":{"post":{"summary":"Preview a route decision plan against the published route policy","responses":{"200":{"description":"Success"}}}},"/v1/route-plans/shadow":{"post":{"summary":"Shadow-evaluate a route decision plan without committing it","responses":{"200":{"description":"Success"}}}},"/v1/route-decisions":{"get":{"summary":"List persisted route decisions","responses":{"200":{"description":"Success"}}}},"/v1/route-decisions/{decisionId}":{"get":{"summary":"Get a persisted route decision","responses":{"200":{"description":"Success"}}}},"/v1/prices":{"get":{"summary":"List price versions for an operation","responses":{"200":{"description":"Success"}}},"post":{"summary":"Add a price version","responses":{"200":{"description":"Success"}}}},"/v1/price-policies":{"get":{"summary":"List price policies","responses":{"200":{"description":"Success"}}},"post":{"summary":"Add a price policy","responses":{"200":{"description":"Success"}}}},"/v1/quotes":{"get":{"summary":"List quotes","responses":{"200":{"description":"Success"}}},"post":{"summary":"Issue a quote","responses":{"200":{"description":"Success"}}}},"/v1/quotes/{quoteId}":{"get":{"summary":"Get a quote","responses":{"200":{"description":"Success"}}}},"/v1/quotes/preview":{"post":{"summary":"Preview a quote without issuing it","responses":{"200":{"description":"Success"}}}},"/v1/budgets":{"get":{"summary":"List budgets","responses":{"200":{"description":"Success"}}},"post":{"summary":"Create a budget draft","responses":{"200":{"description":"Success"}}}},"/v1/budgets/{budgetId}":{"get":{"summary":"Get a budget","responses":{"200":{"description":"Success"}}}},"/v1/budgets/{budgetId}/revisions":{"post":{"summary":"Revise a budget draft","responses":{"200":{"description":"Success"}}}},"/v1/budgets/{budgetId}/publish":{"post":{"summary":"Publish a budget version","responses":{"200":{"description":"Success"}}}},"/v1/budgets/preview":{"post":{"summary":"Preview budget consumption without committing it","responses":{"200":{"description":"Success"}}}},"/v1/ledger":{"get":{"summary":"List ledger entries","responses":{"200":{"description":"Success"}}}},"/v1/top-ups":{"get":{"summary":"List prepaid top-ups","responses":{"200":{"description":"Success"}}},"post":{"summary":"Request a prepaid top-up (creates a Stripe Checkout Session when Stripe is configured)","responses":{"200":{"description":"Success"}}}},"/v1/billing/stripe/webhook":{"post":{"summary":"Stripe webhook (signature-verified, no bearer token)","responses":{"200":{"description":"Success"}}}},"/v1/email/resend/webhook":{"post":{"summary":"Resend delivery-event webhook (signature-verified, no bearer token)","responses":{"200":{"description":"Success"}}}},"/v1/email-deliveries":{"get":{"summary":"List outbound email deliveries for the workspace","responses":{"200":{"description":"Success"}}},"post":{"summary":"Send an outbound email delivery (dashboard invitation composer)","responses":{"200":{"description":"Success"}}}},"/v1/workflow-product-imports":{"get":{"summary":"List workflow document imports awaiting quarantine review","responses":{"200":{"description":"Success"}}},"post":{"summary":"Import a workflow document into quarantine","responses":{"200":{"description":"Success"}}}},"/v1/session-context":{"get":{"summary":"Get bounded authenticated local session context","description":"Returns only the server-derived local organization, authentication class, canonical granted scopes, and local mode. It never returns tokens, token hashes, principal identifiers, vault references, or session identifiers.","responses":{"200":{"description":"Authenticated local session context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionContext"}}}},"401":{"description":"Authentication required"},"403":{"description":"local-product:read scope required"},"405":{"description":"Method not allowed"},"503":{"description":"Session context unavailable"}}}},"/v1/balance":{"get":{"summary":"Get local fixture balance -- topUpUrl is an absolute URL, never null, whenever top-ups are enabled","responses":{"200":{"description":"Success"}}}},"/v1/openapi.json":{"get":{"summary":"Get this contract","responses":{"200":{"description":"Success"}}}},"/v1/cli-tools":{"get":{"summary":"List CLI tool definitions","responses":{"200":{"description":"Success"}}},"post":{"summary":"Create a draft CLI tool definition","responses":{"201":{"description":"Created"}}}},"/v1/cli-tools/{toolId}":{"get":{"summary":"Get a CLI tool definition and its lifecycle","responses":{"200":{"description":"Success"}}}},"/v1/cli-tools/{toolId}/revisions":{"post":{"summary":"Revise a CLI tool definition's binary allowlist and deny patterns","responses":{"201":{"description":"Revised"}}}},"/v1/cli-tools/{toolId}/publish":{"post":{"summary":"Publish a CLI tool definition","responses":{"200":{"description":"Success"}}}},"/v1/cli-tools/{toolId}/revoke":{"post":{"summary":"Revoke a CLI tool definition","responses":{"200":{"description":"Success"}}}},"/v1/cli-runs":{"get":{"summary":"List CLI runs","responses":{"200":{"description":"Success"}}},"post":{"summary":"Start a CLI run; argv[0] must resolve to an allowlisted binary digest re-checked immediately before spawn","responses":{"201":{"description":"Created (queued, denied, or already completed synchronously)"}}}},"/v1/cli-runs/{cliRunId}":{"get":{"summary":"Get a CLI run's status, exit code and artifact ids","responses":{"200":{"description":"Success"}}}},"/v1/cli-runs/{cliRunId}/artifacts/stdout":{"get":{"summary":"Download a CLI run's captured stdout","responses":{"200":{"description":"Binary content"},"404":{"description":"Not found"}}}},"/v1/cli-runs/{cliRunId}/artifacts/stderr":{"get":{"summary":"Download a CLI run's captured stderr","responses":{"200":{"description":"Binary content"},"404":{"description":"Not found"}}}},"/v1/proxy-sessions":{"get":{"summary":"List local forward-proxy sessions","responses":{"200":{"description":"Success"}}},"post":{"summary":"Start a local forward-proxy session; never performs TLS interception","responses":{"201":{"description":"Created"}}}},"/v1/proxy-sessions/{proxySessionId}":{"get":{"summary":"Get a proxy session's status and cleanup state","responses":{"200":{"description":"Success"}}}},"/v1/proxy-sessions/{proxySessionId}/stop":{"post":{"summary":"Stop a proxy session and clean up its state file","responses":{"200":{"description":"Success"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"SessionContext":{"type":"object","additionalProperties":false,"required":["mode","authenticationClass","organizationId","scopes","deploymentMode","role"],"properties":{"mode":{"const":"local_alpha"},"authenticationClass":{"enum":["local_static_token","machine_session"]},"organizationId":{"oneOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"}]},"scopes":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128,"pattern":"^(?:\\*|[a-z][a-z0-9-]{0,62}(?::(?:\\*|[a-z][a-z0-9-]{0,62}))?)$"}},"deploymentMode":{"description":"Operator-facing deployment mode: fixture_demo/authenticated_sandbox in local_alpha, approved_production in production, degraded whenever live readiness fails regardless of mode.","enum":["fixture_demo","authenticated_sandbox","approved_production","degraded"]},"role":{"description":"The resolved principal's organization role; null for a resolver that never set one.","enum":["owner","admin","member","viewer",null]}}},"WorkspaceFile":{"type":"object","additionalProperties":false,"required":["fileId","tenantId","path","contentType","byteLength","digest","createdAt","updatedAt","expiresAt","revision"],"properties":{"fileId":{"type":"string","pattern":"^wfl_[a-f0-9]{32}$"},"tenantId":{"type":"string","minLength":1,"maxLength":200},"path":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"contentType":{"type":"string","minLength":1,"maxLength":200},"byteLength":{"type":"integer","minimum":0,"maximum":9007199254740991},"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"WorkspaceDirectory":{"type":"object","additionalProperties":false,"required":["tenantId","path","createdAt","updatedAt","revision"],"properties":{"tenantId":{"type":"string","minLength":1,"maxLength":200},"path":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"WorkspaceRead":{"type":"object","additionalProperties":false,"required":["file","contentBase64"],"properties":{"file":{"$ref":"#/components/schemas/WorkspaceFile"},"contentBase64":{"type":"string","minLength":4,"maxLength":699052,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"}}},"WorkspaceUsage":{"type":"object","additionalProperties":false,"required":["files","bytes","maxFiles","maxBytes"],"properties":{"files":{"type":"integer","minimum":0,"maximum":100000},"bytes":{"type":"integer","minimum":0,"maximum":1073741824},"maxFiles":{"type":"integer","minimum":1,"maximum":100000},"maxBytes":{"type":"integer","minimum":1,"maximum":1073741824}}},"WorkspaceDirectoryEntry":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","path","revision"],"properties":{"kind":{"const":"directory"},"path":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}}},{"type":"object","additionalProperties":false,"required":["kind","path","file"],"properties":{"kind":{"const":"file"},"path":{"type":"string","minLength":2,"maxLength":1024,"pattern":"^/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*//)(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]{1,255}(?:/[^/]{1,255})*$"},"file":{"$ref":"#/components/schemas/WorkspaceFile"}}}]},"WorkspaceDirectoryPage":{"type":"object","additionalProperties":false,"required":["entries","namespaceRevision","directoryRevision"],"properties":{"entries":{"type":"array","maxItems":100000,"items":{"$ref":"#/components/schemas/WorkspaceDirectoryEntry"}},"namespaceRevision":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"directoryRevision":{"oneOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}}},"WorkspaceDirectoryMutationResult":{"type":"object","additionalProperties":false,"required":["directory","namespaceRevision"],"properties":{"directory":{"$ref":"#/components/schemas/WorkspaceDirectory"},"namespaceRevision":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}},"AuditRecord":{"type":"object","additionalProperties":false,"required":["auditRecordId","organizationId","sequence","actor","action","resourceType","resourceId","outcome","payloadDigest","previousRecordHash","recordHash","occurredAt"],"properties":{"auditRecordId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"organizationId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"sequence":{"type":"integer","minimum":1,"maximum":9007199254740991},"actor":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","principalId"],"properties":{"kind":{"const":"principal"},"principalId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}},{"type":"object","additionalProperties":false,"required":["kind","principalId","sessionId"],"properties":{"kind":{"const":"machine_session"},"principalId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"sessionId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}},{"type":"object","additionalProperties":false,"required":["kind","service"],"properties":{"kind":{"const":"system"},"service":{"type":"string","pattern":"^[a-z][a-z0-9_-]{1,63}$"}}}]},"action":{"type":"string","pattern":"^[a-z][a-z0-9_.:-]{2,127}$"},"resourceType":{"type":"string","pattern":"^[a-z][a-z0-9_-]{1,63}$"},"resourceId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"outcome":{"enum":["succeeded","denied","failed"]},"payloadDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"previousRecordHash":{"type":["string","null"],"pattern":"^sha256:[a-f0-9]{64}$"},"recordHash":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"occurredAt":{"type":"string","format":"date-time"}}},"AuditPage":{"type":"object","additionalProperties":false,"required":["records","nextCursor","chain"],"properties":{"records":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/AuditRecord"}},"nextCursor":{"type":["string","null"],"minLength":1,"maxLength":2048},"chain":{"type":"object","description":"Self-consistency of the currently stored contiguous chain only; not proof against suffix truncation or complete-history rewrite.","additionalProperties":false,"required":["structurallyConsistent","terminalHash"],"properties":{"structurallyConsistent":{"const":true},"terminalHash":{"type":["string","null"],"pattern":"^sha256:[a-f0-9]{64}$"}}}}},"PublicCatalogPrice":{"oneOf":[{"type":"object","additionalProperties":false,"required":["state","amountMicros","currency","unit","effectiveAt"],"properties":{"state":{"const":"known"},"amountMicros":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"unit":{"type":"string","minLength":1,"maxLength":80},"effectiveAt":{"type":"string","format":"date-time"},"comparisonBasis":{"type":"object","additionalProperties":false,"required":["canonicalMeter","billingBasis","tier","minimumMicros","rounding"],"properties":{"canonicalMeter":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"billingBasis":{"enum":["per_call","per_result","per_unit"]},"tier":{"type":"string","minLength":1,"maxLength":80},"minimumMicros":{"type":"integer","minimum":0,"maximum":9007199254740991},"rounding":{"enum":["exact","ceil","floor"]}}}}},{"type":"object","additionalProperties":false,"required":["state","reason"],"properties":{"state":{"enum":["unknown","uncomputable"]},"reason":{"type":"string","minLength":1,"maxLength":300}}}]},"PublicCatalogItem":{"type":"object","additionalProperties":false,"required":["catalogItemId","revision","providerId","operationId","title","description","categories","capabilities","inputSchemaDigest","outputSchemaDigest","method","pathTemplate","parameters","verification","references","price","publishedAt","itemDigest","provenanceTier"],"properties":{"catalogItemId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"providerId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"operationId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":2000},"categories":{"type":"array","minItems":1,"maxItems":30,"items":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}},"capabilities":{"type":"array","maxItems":30,"items":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}},"inputSchemaDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"outputSchemaDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"method":{"type":["string","null"],"enum":["GET","POST","PUT","PATCH","DELETE",null]},"pathTemplate":{"type":["string","null"],"minLength":1,"maxLength":1024},"parameters":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","location","required"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"location":{"enum":["query","path","header","body"]},"required":{"type":"boolean"},"description":{"type":"string","minLength":1,"maxLength":500},"schemaDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}},"verification":{"type":"object","additionalProperties":false,"required":["state","verifiedAt","responseCapture"],"properties":{"state":{"enum":["unverified","fixture_verified","authenticated_verified","stale"]},"verifiedAt":{"type":["string","null"],"format":"date-time"},"responseCapture":{"type":"object","additionalProperties":false,"required":["available","digest"],"properties":{"available":{"type":"boolean"},"digest":{"type":["string","null"],"pattern":"^sha256:[a-f0-9]{64}$"}}}}},"references":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","url"],"properties":{"kind":{"enum":["documentation","pricing"]},"url":{"type":"string","format":"uri","maxLength":2048}}}},"price":{"$ref":"#/components/schemas/PublicCatalogPrice"},"publishedAt":{"type":"string","format":"date-time"},"itemDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"provenanceTier":{"enum":["official","verified_partner","community","private","unverified"]}}},"PublicCatalogPage":{"type":"object","additionalProperties":false,"required":["items","catalogDigest","nextCursor"],"properties":{"items":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/PublicCatalogItem"}},"catalogDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"nextCursor":{"type":["string","null"],"minLength":1,"maxLength":2000}}},"PublicCatalogComparison":{"type":"object","additionalProperties":false,"required":["items","priceComparison","comparisonDigest"],"properties":{"items":{"type":"array","minItems":2,"maxItems":20,"items":{"$ref":"#/components/schemas/PublicCatalogItem"}},"priceComparison":{"oneOf":[{"type":"object","additionalProperties":false,"required":["state","currency","unit","amounts","lowestAmountMicros","lowestCatalogItemIds"],"properties":{"state":{"const":"comparable"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"unit":{"type":"string","minLength":1,"maxLength":80},"amounts":{"type":"array","minItems":2,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["catalogItemId","amountMicros"],"properties":{"catalogItemId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"amountMicros":{"type":"integer","minimum":0,"maximum":9007199254740991}}}},"lowestAmountMicros":{"type":"integer","minimum":0,"maximum":9007199254740991},"lowestCatalogItemIds":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}}},{"type":"object","additionalProperties":false,"required":["state","reason"],"properties":{"state":{"const":"not_comparable"},"reason":{"enum":["price_state_unknown_or_uncomputable","capability_or_contract_mismatch","price_semantics_unverified","currency_or_unit_mismatch"]}}}]},"comparisonDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}},"InspectOutput":{"type":"object","additionalProperties":false,"required":["endpoint","estimatedMaxCost","usageHints"],"properties":{"endpoint":{"type":"object","description":"Exact registered endpoint metadata"},"estimatedMaxCost":{"type":"number","minimum":0,"description":"Provider price + the platform key's fee -- the TOTAL a run through the platform key would charge"},"platformFeeMicros":{"type":"integer","minimum":0,"description":"The platform key's fee for this endpoint's provider, in micros"},"providerPrice":{"type":"number","minimum":0,"description":"The provider's own price alone, with no platform fee added"},"inputSchema":{"type":["object","null"],"description":"Draft 2020-12 input schema resolved from fixture, activation bundle, or direct registration; null when the endpoint declares none"},"requestBinding":{"type":["object","null"],"description":"How validated input fields become the HTTP request (path/query/header/body); null for a fixture or bundle-published endpoint that declares none"},"uiSchema":{"type":["object","null"],"description":"Presentation hints for a generated form; never validation"},"usageHints":{"type":"object","additionalProperties":false,"required":["endpointId","operationVersion","contractDigest","authentication","requiredInputFields","outputSchema","examples"],"properties":{"endpointId":{"type":"string"},"operationVersion":{"type":"string"},"contractDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"authentication":{"type":"object","description":"Bearer placeholder only; never contains a credential"},"requiredInputFields":{"type":"array","items":{"type":"string"}},"outputSchema":{"type":"object","description":"Pinned Draft 2020-12 output schema"},"examples":{"type":"object","description":"Equivalent REST, MCP, and CLI requests using placeholders only"}}}}},"Connection":{"type":"object","additionalProperties":false,"required":["id","providerId","label","status","auth","scopes","lastProbe","cooldownUntil","credentialExpiresAt","consent","pendingCredentialRoles","createdAt","updatedAt","testState"],"properties":{"id":{"type":"string"},"providerId":{"type":"string"},"label":{"type":"string"},"status":{"enum":["draft","authorization_pending","connected","degraded","expired","action_required","revoked"]},"auth":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["none","api_key","oauth","service_account","credential_file","signed_request","cli_auth"]},"placement":{"enum":["header","query"]},"name":{"type":"string"},"authorizationUrl":{"type":"string"},"tokenUrl":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"tokenPlacement":{"enum":["header","query"]},"algorithm":{"const":"hmac-sha256"},"signedHeaders":{"type":"array","items":{"type":"string"}}}},"scopes":{"type":"array","items":{"type":"string"},"description":"Granted scopes, populated after oauth callback or a probe that reports scopes"},"lastProbe":{"anyOf":[{"$ref":"#/components/schemas/ConnectionHealthReceipt"},{"type":"null"}]},"cooldownUntil":{"type":["string","null"],"format":"date-time"},"credentialExpiresAt":{"type":["string","null"],"format":"date-time"},"consent":{"type":"object","additionalProperties":false,"required":["expiresAt","warning"],"properties":{"expiresAt":{"type":["string","null"],"format":"date-time"},"warning":{"enum":["expiring_soon","expired",null]}}},"pendingCredentialRoles":{"type":"array","items":{"type":"string"},"description":"Declared secondary credential roles not yet supplied; non-empty implies status action_required"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"testState":{"enum":["not_tested","verified"],"description":"verified requires at least one persisted fixture_tested receipt; never set from CRUD alone"}}},"RegisterConnection":{"type":"object","description":"One of api_key (default when kind is omitted), oauth, service_account, credential_file, signed_request, or cli_auth, discriminated by kind","additionalProperties":true,"required":["id","providerId","label"],"properties":{"kind":{"enum":["api_key","oauth","service_account","credential_file","signed_request","cli_auth"]},"id":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"providerId":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"label":{"type":"string"},"placement":{"enum":["header","query"]},"name":{"type":"string"},"format":{"type":"string","description":"e.g. \"Bearer {secret}\""},"secret":{"type":"string","writeOnly":true},"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"scopes":{"type":"array","items":{"type":"string"}},"tokenPlacement":{"enum":["header","query"]},"clientId":{"type":"string","writeOnly":true},"keyFile":{"type":"string","writeOnly":true},"file":{"type":"string","writeOnly":true},"keyId":{"type":"string"},"algorithm":{"const":"hmac-sha256"},"signedHeaders":{"type":"array","items":{"type":"string"}},"blob":{"type":"string","writeOnly":true},"credentialExpiresAt":{"type":["string","null"],"format":"date-time"},"probe":{"anyOf":[{"$ref":"#/components/schemas/ConnectionProbeDefinition"},{"type":"null"}]},"secondaryCredentialRoles":{"type":"array","items":{"type":"string"},"description":"Secondary credential roles this provider requires beyond the primary auth"}}},"ConnectionProbeDefinition":{"type":"object","additionalProperties":false,"required":["host","method","path","expectedStatuses"],"properties":{"host":{"type":"string"},"method":{"enum":["GET","POST"]},"path":{"type":"string"},"expectedStatuses":{"type":"array","items":{"type":"integer"}},"identityPointer":{"type":"string"},"scopesPointer":{"type":"string"},"resourcesPointer":{"type":"string"}}},"ConnectionHealthReceipt":{"type":"object","additionalProperties":false,"required":["receiptId","connectionId","providerId","outcome","status","identity","scopes","resources","providerRequestId","remediation","checkedAt"],"properties":{"receiptId":{"type":"string","pattern":"^chr_[a-f0-9]{32}$"},"connectionId":{"type":"string"},"providerId":{"type":"string"},"outcome":{"enum":["healthy","invalid_credentials","insufficient_scope","unavailable","rate_limited","missing_resource"]},"status":{"type":["integer","null"]},"identity":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"type":"string"},"description":"Accessible provider resource ids discovered by this probe (CA-CONN-03)"},"providerRequestId":{"type":["string","null"]},"remediation":{"type":["string","null"],"description":"Safe human-readable next step; never credential material"},"checkedAt":{"type":"string","format":"date-time"}}},"ConnectionResource":{"type":"object","additionalProperties":false,"required":["resourceId","connectionId","providerResourceId","kind","displayName","selected","discoveredAt"],"properties":{"resourceId":{"type":"string","pattern":"^cres_[a-f0-9]{32}$"},"connectionId":{"type":"string"},"providerResourceId":{"type":"string"},"kind":{"type":"string"},"displayName":{"type":"string"},"selected":{"type":"boolean"},"discoveredAt":{"type":"string","format":"date-time"}}},"SelectConnectionResource":{"type":"object","additionalProperties":false,"required":["resourceId"],"properties":{"resourceId":{"type":"string","pattern":"^cres_[a-f0-9]{32}$"}}},"SupplySecondaryCredential":{"type":"object","additionalProperties":false,"required":["secret"],"properties":{"secret":{"type":"string","writeOnly":true}}},"PlatformAuthConfig":{"oneOf":[{"type":"object","additionalProperties":false,"required":["authMethod"],"properties":{"authMethod":{"const":"bearer"},"headerName":{"type":"string"},"valuePrefix":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["authMethod","headerName"],"properties":{"authMethod":{"const":"header"},"headerName":{"type":"string"},"valuePrefix":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["authMethod","paramName"],"properties":{"authMethod":{"const":"query"},"paramName":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["authMethod"],"properties":{"authMethod":{"const":"basic"},"headerName":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["authMethod","fields"],"properties":{"authMethod":{"const":"multi"},"fields":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["field","placement","name"],"properties":{"field":{"type":"string"},"placement":{"enum":["header","query"]},"name":{"type":"string"},"valuePrefix":{"type":"string"}}}}}}]},"PlatformKey":{"type":"object","additionalProperties":false,"required":["providerId","displayName","hasKey","keyHint","authConfig","platformFeeMicros","approved","updatedAt","endpointCount","runnable"],"properties":{"providerId":{"type":"string"},"displayName":{"type":"string"},"hasKey":{"type":"boolean"},"keyHint":{"type":["string","null"],"description":"The secret's last 4 characters only; never the secret itself"},"authConfig":{"oneOf":[{"$ref":"#/components/schemas/PlatformAuthConfig"},{"type":"null"}],"description":"How the credential is injected at run time; null falls back to a header/query default derived from the endpoint's own authPlacement"},"platformFeeMicros":{"type":["integer","null"],"minimum":0},"approved":{"type":"boolean"},"updatedAt":{"type":["string","null"],"format":"date-time"},"endpointCount":{"type":"integer","minimum":0},"runnable":{"type":"boolean","description":"True when a run with no customer connection would actually use this key right now: approved, priced, a secret is stored, and the config can be applied to the provider's endpoints"}}},"PlatformKeyList":{"type":"object","additionalProperties":false,"required":["platformKeys"],"properties":{"platformKeys":{"type":"array","items":{"$ref":"#/components/schemas/PlatformKey"}}}},"SetPlatformKey":{"type":"object","additionalProperties":false,"required":["secret"],"properties":{"secret":{"type":"string","writeOnly":true,"minLength":1,"maxLength":4000},"authMethod":{"enum":["bearer","header","query","basic","multi"],"description":"Selects which of headerName/paramName/valuePrefix/fields apply; omitted falls back to the endpoint's own authPlacement default"},"headerName":{"type":"string","minLength":1,"maxLength":120,"description":"Required when authMethod is \"header\""},"paramName":{"type":"string","minLength":1,"maxLength":120,"description":"Required when authMethod is \"query\""},"valuePrefix":{"type":"string","maxLength":60},"fields":{"type":"array","maxItems":20,"description":"Required (at least one) when authMethod is \"multi\" -- the secret is a JSON object of named fields, each independently placed","items":{"type":"object","additionalProperties":false,"required":["field","placement","name"],"properties":{"field":{"type":"string","minLength":1,"maxLength":120},"placement":{"enum":["header","query"]},"name":{"type":"string","minLength":1,"maxLength":120},"valuePrefix":{"type":"string","maxLength":60}}}},"platformFeeMicros":{"type":"integer","minimum":0},"approved":{"type":"boolean"}}},"PatchPlatformKey":{"type":"object","additionalProperties":false,"description":"Same fields as SetPlatformKey minus secret -- every field optional, only the ones present are changed. Requires an existing platform key for this provider (nothing to reuse a vault ref from otherwise).","properties":{"authMethod":{"enum":["bearer","header","query","basic","multi"],"description":"Selects which of headerName/paramName/valuePrefix/fields apply; omitted keeps the existing authConfig"},"headerName":{"type":"string","minLength":1,"maxLength":120,"description":"Required when authMethod is \"header\""},"paramName":{"type":"string","minLength":1,"maxLength":120,"description":"Required when authMethod is \"query\""},"valuePrefix":{"type":"string","maxLength":60},"fields":{"type":"array","maxItems":20,"description":"Required (at least one) when authMethod is \"multi\"","items":{"type":"object","additionalProperties":false,"required":["field","placement","name"],"properties":{"field":{"type":"string","minLength":1,"maxLength":120},"placement":{"enum":["header","query"]},"name":{"type":"string","minLength":1,"maxLength":120},"valuePrefix":{"type":"string","maxLength":60}}}},"platformFeeMicros":{"type":"integer","minimum":0},"approved":{"type":"boolean"}}},"ConnectionAlert":{"type":"object","additionalProperties":false,"required":["alertId","connectionId","providerId","state","message","createdAt","acknowledgedAt"],"properties":{"alertId":{"type":"string","pattern":"^cal_[a-f0-9]{32}$"},"connectionId":{"type":"string"},"providerId":{"type":"string"},"state":{"enum":["degraded","expired","action_required","revoked"]},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"acknowledgedAt":{"type":["string","null"],"format":"date-time"}}},"ConnectionAuthorization":{"type":"object","additionalProperties":false,"required":["authorizationUrl","state","expiresAt"],"properties":{"authorizationUrl":{"type":"string","format":"uri"},"state":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}}},"ConnectionCallback":{"type":"object","additionalProperties":false,"required":["state","code"],"properties":{"state":{"type":"string"},"code":{"type":"string"}}},"RotateConnection":{"type":"object","additionalProperties":false,"required":["secret"],"properties":{"secret":{"type":"string","writeOnly":true}}},"ConnectionTestReceipt":{"type":"object","additionalProperties":false,"required":["receiptId","connectionId","providerId","verification","providerCalled","credentialState","message","testedAt"],"properties":{"receiptId":{"type":"string","pattern":"^ctr_[a-f0-9]{32}$"},"connectionId":{"type":"string"},"providerId":{"type":"string"},"verification":{"enum":["fixture_tested","not_tested"]},"providerCalled":{"type":"boolean","description":"Always false for this local-fixture-only endpoint; a real provider call happens only through /probe"},"credentialState":{"enum":["available","unavailable"]},"message":{"type":"string","description":"Safe status text without credential or provider response material"},"testedAt":{"type":"string","format":"date-time"}}},"ConnectionFixtureReceipt":{"type":"object","additionalProperties":false,"required":["receiptId","connectionId","verification","providerCalled","credentialState","evidence","testedAt"],"properties":{"receiptId":{"type":"string","pattern":"^cfr_[a-f0-9]{32}$"},"connectionId":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"verification":{"const":"fixture_tested"},"providerCalled":{"type":"boolean"},"credentialState":{"const":"available"},"evidence":{"const":"local_fixture_credential_access"},"testedAt":{"type":"string","format":"date-time"}}},"ConnectionFixtureReceiptHistory":{"type":"object","additionalProperties":false,"required":["latest","receipts"],"properties":{"latest":{"anyOf":[{"$ref":"#/components/schemas/ConnectionFixtureReceipt"},{"type":"null"}]},"receipts":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/ConnectionFixtureReceipt"}}}},"Artifact":{"type":"object","additionalProperties":false,"required":["artifactId","runId","attemptId","kind","contentType","byteLength","sha256","status","createdAt","expiresAt","deletedAt"],"properties":{"artifactId":{"type":"string"},"runId":{"type":"string"},"attemptId":{"type":"string"},"kind":{"enum":["provider_output","provider_evidence"]},"contentType":{"type":"string"},"byteLength":{"type":"integer","minimum":0},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"status":{"enum":["available","deleted"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}}},"RequestQuarantineReview":{"type":"object","additionalProperties":false,"required":["fileId","contentDigest","idempotencyKey"],"properties":{"fileId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"},"contentDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":300}}},"DecideQuarantineReview":{"type":"object","additionalProperties":false,"required":["decision","reason"],"properties":{"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":1000}}},"QuarantineReview":{"type":"object","additionalProperties":false,"required":["reviewId","fileId","contentDigest","status","decisionReason","reviewerPrincipalId","createdAt","decidedAt"],"properties":{"reviewId":{"type":"string"},"fileId":{"type":"string"},"contentDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"status":{"enum":["pending","approved","rejected"]},"decisionReason":{"type":["string","null"]},"reviewerPrincipalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"decidedAt":{"type":["string","null"],"format":"date-time"}}},"ResolveReconciliation":{"type":"object","additionalProperties":false,"required":["action","reason","evidenceRefs"],"properties":{"action":{"enum":["charge","release"]},"resolvedProviderCost":{"type":"number","minimum":0},"reason":{"type":"string","minLength":1,"maxLength":1000},"evidenceRefs":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","minLength":1}}}},"ImportCandidates":{"type":"object","additionalProperties":false,"required":["sourceRef","providerSlug","document"],"properties":{"sourceRef":{"type":"string","minLength":1,"maxLength":2000},"providerSlug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"document":{"type":"object"}}},"ImportMetadataCandidates":{"type":"object","additionalProperties":false,"required":["sourceRef","providerSlug","providerName","catalogKind","operations"],"properties":{"sourceRef":{"type":"string","minLength":1,"maxLength":2000},"providerSlug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"providerName":{"type":"string","minLength":1,"maxLength":300},"catalogKind":{"enum":["api_catalog","automation_catalog","mcp_registry","manual"]},"catalogVersion":{"type":"string","minLength":1,"maxLength":200},"operations":{"type":"array","minItems":1,"maxItems":10000,"items":{"type":"object","additionalProperties":false,"required":["operationId","displayName"],"properties":{"operationId":{"type":"string","minLength":1,"maxLength":300},"displayName":{"type":"string","minLength":1,"maxLength":300},"description":{"type":"string","minLength":1,"maxLength":1000},"capabilityHint":{"type":"string"},"documentationUrl":{"type":"string","format":"uri"},"openApiUrl":{"type":"string","format":"uri"},"authHint":{"enum":["unknown","api_key","bearer","oauth2","basic","custom"],"default":"unknown"},"pricingHint":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"enum":["unknown","listed","custom"]},"sourceUrl":{"type":"string","format":"uri"},"summary":{"type":"string","minLength":1,"maxLength":500}}},"tags":{"type":"array","maxItems":30,"items":{"type":"string"},"default":[]}}}}}},"ReviewCandidate":{"type":"object","additionalProperties":false,"required":["expectedStatus","nextStatus"],"properties":{"expectedStatus":{"enum":["unreviewed","reviewing","accepted","rejected"]},"nextStatus":{"enum":["unreviewed","reviewing","accepted","rejected"]}}},"CreateCompatibilityDraft":{"type":"object","additionalProperties":false,"required":["candidateId"],"properties":{"candidateId":{"type":"string","minLength":1,"maxLength":300}}},"DetectCandidateContradictions":{"type":"object","additionalProperties":false,"required":["providerSlug"],"properties":{"providerSlug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}},"CreateOnboardingJob":{"type":"object","additionalProperties":false,"required":["providerSlug","input"],"properties":{"providerSlug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"input":{"type":"object"},"hints":{"type":"object"}}},"DecideOnboardingJob":{"type":"object","additionalProperties":false,"required":["gate","decision","reason"],"properties":{"gate":{"enum":["rights","production_approval"]},"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":2000},"rightsTarget":{"enum":["byok_approved","partner_approved"]}}},"CompatibilityEvidenceRef":{"type":"object","additionalProperties":false,"required":["url","digest","observedAt","kind"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"observedAt":{"type":"string","format":"date-time"},"kind":{"enum":["official_docs","openapi","terms","pricing","authenticated_test","internal_review"]}}},"SubmitCompatibilityGate":{"type":"object","additionalProperties":false,"required":["gate","claim","evidenceRefs"],"properties":{"gate":{"enum":["provider_identity","capability_mapping","official_evidence","rights","auth","base_url","effect_classification","price","executor","error_contract","rate_limits","retention","authenticated_test","production_approval"]},"claim":{"type":"string","minLength":1,"maxLength":2000},"evidenceRefs":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"#/components/schemas/CompatibilityEvidenceRef"}}}},"DecideCompatibilityGate":{"type":"object","additionalProperties":false,"required":["decision","reason"],"properties":{"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":2000}}},"CreateActivationProposal":{"type":"object","additionalProperties":false,"required":["draftId"],"properties":{"draftId":{"type":"string","minLength":1,"maxLength":300}}},"CreateProviderPackageDraft":{"type":"object","additionalProperties":false,"required":["proposalId"],"properties":{"proposalId":{"type":"string","minLength":1,"maxLength":300}}},"CreateProviderPackageRevision":{"type":"object","additionalProperties":false,"required":["packageId","expectedPreviousRevisionId","mapping"],"properties":{"packageId":{"type":"string","minLength":1,"maxLength":300},"expectedPreviousRevisionId":{"type":["string","null"]},"mapping":{"type":"object","description":"Strict typed provider mapping; validated for identity, capability, auth, JSON Schemas, effect, price, retry, errors, limits, retention and a disabled fixed-host executor."}}},"ValidateProviderMapping":{"type":"object","additionalProperties":false,"required":["mapping"],"properties":{"mapping":{"type":"object"}}},"DecideProviderMapping":{"type":"object","additionalProperties":false,"required":["decision","reason","evidenceRefs"],"properties":{"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":2000},"evidenceRefs":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"#/components/schemas/CompatibilityEvidenceRef"}}}},"CreateProviderActivationBundle":{"type":"object","additionalProperties":false,"required":["revisionId"],"properties":{"revisionId":{"type":"string","pattern":"^ppr_[a-f0-9]{32}$"}}},"PublishProviderRegistry":{"type":"object","additionalProperties":false,"required":["bundleId"],"properties":{"bundleId":{"type":"string","pattern":"^pab_[a-f0-9]{32}$"},"acknowledgeBreakingChange":{"type":"boolean"}}},"PublishPublicCatalog":{"type":"object","additionalProperties":false,"required":["endpointId"],"properties":{"endpointId":{"type":"string","pattern":"^[a-z][a-z0-9_-]{2,127}$"}}},"RegisterDirectEndpoint":{"type":"object","additionalProperties":false,"required":["endpoint"],"description":"provider is optional when :providerId already exists; required (displayName at minimum) when it does not. See DirectEndpointRegistrationInputSchema in src/import/direct-endpoint-registration-service.ts for the full endpoint shape (capability, name, description, executionMode, eligibility, authType, price, and optionally inputSchema/requestBinding/uiSchema/httpContract).","properties":{"provider":{"type":"object","description":"{ displayName, categoryId?, homepageUrl?, docsUrl?, region? }"},"endpoint":{"type":"object","description":"{ endpointId, capability, name, description, executionMode, eligibility, authType, price, inputSchema?, requestBinding?, uiSchema?, httpContract?, examples?, effectClassification? }"},"publishToPublicCatalog":{"type":"boolean"},"autoCapability":{"type":"boolean","description":"When endpoint.capability is not a known canonical job id or alias, register under the top capabilitySuggestions match once its score clears the confidence threshold, instead of the exact slug submitted. Default false."}}},"ImportDirectEndpoints":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","description":"Same shape as RegisterDirectEndpoint, plus providerId inline."}}}},"SubmitProviderActivationEvidence":{"type":"object","additionalProperties":false,"required":["reportId","blockerCode","claim","evidenceRefs"],"properties":{"reportId":{"type":"string","pattern":"^par_[a-f0-9]{32}$"},"blockerCode":{"enum":["rights_approval_required","adapter_required","authenticated_test_required","connection_required","driver_required","production_approval_required","price_currency_unsupported","price_evidence_required"]},"claim":{"type":"string","minLength":1,"maxLength":2000},"evidenceRefs":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"#/components/schemas/CompatibilityEvidenceRef"}}}},"DecideProviderActivationEvidence":{"type":"object","additionalProperties":false,"required":["decision","reason"],"properties":{"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":2000}}},"CreateProviderActivationChangeRequest":{"type":"object","additionalProperties":false,"required":["bundleId","expectedReportId","rightsTarget","driverId","connectionId"],"properties":{"bundleId":{"type":"string","pattern":"^pab_[a-f0-9]{32}$"},"expectedReportId":{"type":"string","pattern":"^par_[a-f0-9]{32}$"},"rightsTarget":{"enum":["byok_approved","partner_approved"]},"driverId":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"connectionId":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}},"DecideProviderActivationChange":{"type":"object","additionalProperties":false,"required":["decision","reason"],"properties":{"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":2000}}},"ApplyProviderActivationChange":{"type":"object","additionalProperties":false,"required":["expectedDryRunId"],"properties":{"expectedDryRunId":{"type":"string","pattern":"^padr_[a-f0-9]{32}$"},"acknowledgeBreakingChange":{"type":"boolean"}}},"CreateNormalizedRoute":{"type":"object","additionalProperties":false,"required":["routeKey","version","capability","inputSchema","outputSchema","steps"],"properties":{"routeKey":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"version":{"type":"string"},"capability":{"enum":["web.search","company.enrich","media.generate"]},"inputSchema":{"type":"object","description":"Draft 2020-12 object schema without external references"},"outputSchema":{"type":"object","description":"Draft 2020-12 canonical object schema without external references"},"steps":{"type":"array","minItems":2,"maxItems":20,"items":{"type":"object","description":"Distinct-provider endpoint adapter with contiguous priority, USD ceiling, bounded canonical input/output bindings and explicit miss predicate"}}}},"WorkflowValue":{"oneOf":[{"type":"object","additionalProperties":false,"required":["source","value"],"properties":{"source":{"const":"literal"},"value":{}}},{"type":"object","additionalProperties":false,"required":["source","stepId","path"],"properties":{"source":{"const":"step"},"stepId":{"type":"string"},"path":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":120}}}}]},"WorkflowMapping":{"type":"object","maxProperties":64,"additionalProperties":{"$ref":"#/components/schemas/WorkflowValue"}},"WorkflowRunIf":{"type":"object","additionalProperties":false,"required":["stepId","equals"],"properties":{"stepId":{"type":"string"},"equals":{"type":"boolean"}}},"WorkflowComparison":{"type":"object","additionalProperties":false,"required":["left","operator"],"properties":{"left":{"$ref":"#/components/schemas/WorkflowValue"},"operator":{"enum":["eq","neq","exists","gt","gte","lt","lte"]},"right":{"$ref":"#/components/schemas/WorkflowValue"}}},"WorkflowStep":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","stepId","endpointId","input","dependsOn","failurePolicy","maxChargeUsd"],"properties":{"kind":{"const":"operation"},"stepId":{"type":"string"},"endpointId":{"type":"string"},"input":{"type":"object"},"inputBindings":{"$ref":"#/components/schemas/WorkflowMapping"},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"},"maxChargeUsd":{"type":"number","minimum":0}}},{"type":"object","additionalProperties":false,"required":["kind","stepId","delaySeconds","dependsOn","failurePolicy"],"properties":{"kind":{"const":"delay"},"stepId":{"type":"string"},"delaySeconds":{"type":"integer","minimum":1,"maximum":604800},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"}}},{"type":"object","additionalProperties":false,"required":["kind","stepId","prompt","expiresInSeconds","dependsOn","failurePolicy"],"properties":{"kind":{"const":"approval"},"stepId":{"type":"string"},"prompt":{"type":"string"},"expiresInSeconds":{"type":"integer","minimum":60},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"}}},{"type":"object","additionalProperties":false,"required":["kind","stepId","label","expiresInSeconds","dependsOn","failurePolicy"],"properties":{"kind":{"const":"callback"},"stepId":{"type":"string"},"label":{"type":"string"},"expiresInSeconds":{"type":"integer","minimum":60},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"}}},{"type":"object","additionalProperties":false,"required":["kind","stepId","mappings","dependsOn","failurePolicy"],"properties":{"kind":{"const":"transform"},"stepId":{"type":"string"},"mappings":{"$ref":"#/components/schemas/WorkflowMapping"},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"}}},{"type":"object","additionalProperties":false,"required":["kind","stepId","condition","dependsOn","failurePolicy"],"properties":{"kind":{"const":"branch"},"stepId":{"type":"string"},"condition":{"$ref":"#/components/schemas/WorkflowComparison"},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"}}},{"type":"object","additionalProperties":false,"required":["kind","stepId","workflowId","workflowVersion","maxChargeUsd","dependsOn","failurePolicy"],"properties":{"kind":{"const":"subworkflow"},"stepId":{"type":"string"},"workflowId":{"type":"string"},"workflowVersion":{"type":"integer","minimum":1},"maxChargeUsd":{"type":"number","minimum":0},"dependsOn":{"type":"array","items":{"type":"string"}},"failurePolicy":{"enum":["stop","continue"]},"runIf":{"$ref":"#/components/schemas/WorkflowRunIf"}}}]},"CreateWorkflow":{"type":"object","additionalProperties":false,"required":["name","steps"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"steps":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/WorkflowStep"}}}},"ReviseWorkflow":{"type":"object","additionalProperties":false,"required":["steps"],"properties":{"steps":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/WorkflowStep"}}}},"PublishWorkflow":{"type":"object","additionalProperties":false,"required":["version"],"properties":{"version":{"type":"integer","minimum":1}}},"StartWorkflow":{"type":"object","additionalProperties":false,"required":["idempotencyKey"],"properties":{"idempotencyKey":{"type":"string","minLength":1,"maxLength":200}}},"MintWorkflowToken":{"type":"object","additionalProperties":false,"properties":{"ttlSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":900}}},"ResolveWorkflowApproval":{"type":"object","additionalProperties":false,"required":["token","decision"],"properties":{"token":{"type":"string","writeOnly":true},"decision":{"enum":["approved","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":1000}}},"ResolveWorkflowCallback":{"type":"object","additionalProperties":false,"required":["payload"],"properties":{"payload":{}}},"OutputMappingExpression":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","value"],"properties":{"kind":{"const":"literal"},"value":{}}},{"type":"object","additionalProperties":false,"required":["kind","source","path"],"properties":{"kind":{"const":"select"},"source":{"enum":["raw","canonical"]},"path":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1,"maxLength":128}},"required":{"type":"boolean","default":true}}},{"type":"object","additionalProperties":false,"required":["kind","fields"],"properties":{"kind":{"const":"object"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/OutputMappingExpression"}}}},{"type":"object","additionalProperties":false,"required":["kind","items"],"properties":{"kind":{"const":"array"},"items":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/OutputMappingExpression"}}}},{"type":"object","additionalProperties":false,"required":["kind","values"],"properties":{"kind":{"const":"coalesce"},"values":{"type":"array","minItems":1,"maxItems":64,"items":{"$ref":"#/components/schemas/OutputMappingExpression"}}}},{"type":"object","additionalProperties":false,"required":["kind","objects","policy"],"properties":{"kind":{"const":"merge"},"objects":{"type":"array","minItems":1,"maxItems":64,"items":{"$ref":"#/components/schemas/OutputMappingExpression"}},"policy":{"enum":["error","prefer_first","prefer_last"]}}}]},"OutputMappingDefinition":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"enum":["raw","canonical","mapped"]},"expression":{"$ref":"#/components/schemas/OutputMappingExpression"}}},"CreateOutputMapping":{"type":"object","additionalProperties":false,"required":["mappingId","name","definition"],"properties":{"mappingId":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"},"name":{"type":"string","minLength":1,"maxLength":200},"definition":{"$ref":"#/components/schemas/OutputMappingDefinition"},"targetSchema":{}}},"ReviseOutputMapping":{"type":"object","additionalProperties":false,"required":["expectedRevision","definition"],"properties":{"expectedRevision":{"type":"integer","minimum":1},"definition":{"$ref":"#/components/schemas/OutputMappingDefinition"},"targetSchema":{}}},"PreviewOutputMapping":{"type":"object","additionalProperties":false,"required":["raw"],"properties":{"version":{"type":"integer","minimum":1},"raw":{},"canonical":{}}},"ChangeOutputMappingPublication":{"type":"object","additionalProperties":false,"required":["expectedRevision","version"],"properties":{"expectedRevision":{"type":"integer","minimum":1},"version":{"type":"integer","minimum":1}}}}}}