{"components":{"schemas":{"AddSubdomainPlan":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"apexAlias":{"type":"object","properties":{"dnsName":{"type":"string","minLength":1},"evaluateTargetHealth":{"type":"boolean"},"hostedZoneId":{"type":"string","minLength":1}},"required":["dnsName","evaluateTargetHealth","hostedZoneId"],"additionalProperties":false},"executionId":{"type":"string","minLength":1},"hostedZoneId":{"type":"string","minLength":1},"items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"current":{"type":"object","properties":{"aliasTarget":{"type":"object","properties":{"dnsName":{"type":"string","minLength":1},"evaluateTargetHealth":{"type":"boolean"},"hostedZoneId":{"type":"string","minLength":1}},"required":["dnsName","evaluateTargetHealth","hostedZoneId"],"additionalProperties":false},"name":{"type":"string","minLength":1},"ttl":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"type":{"type":"string","enum":["A","CNAME"]},"values":{"default":[],"type":"array","items":{"type":"string","minLength":1}}},"required":["name","type","values"],"additionalProperties":false},"disposition":{"type":"string","enum":["already-correct","create","replace"]},"hostname":{"type":"string","minLength":1}},"required":["disposition","hostname"],"additionalProperties":false}},"planHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"replacementRequired":{"type":"boolean"},"rootDomain":{}},"required":["apexAlias","executionId","hostedZoneId","items","planHash","replacementRequired","rootDomain"],"additionalProperties":false},"AddSubdomainPlanApprovalRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"planHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["planHash"],"additionalProperties":false},"ApiKeyMetadata":{"additionalProperties":false,"properties":{"apiKeyId":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pepperVersion":{"type":"integer"},"prefix":{"type":"string"},"principalId":{"type":"string"},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["apiKeyId","createdAt","expiresAt","lastUsedAt","pepperVersion","prefix","principalId","revokedAt"],"type":"object"},"ArchiveEventVersionRequest":{"additionalProperties":true,"properties":{"confirm":{"const":true,"type":"boolean"}},"type":"object"},"AuditLog":{"additionalProperties":false,"properties":{"action":{"type":"string"},"at":{"type":"string"},"executionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"method":{"type":"string"},"principalId":{"type":"string"},"resource":{"type":"string"},"result":{"enum":["allowed","denied"],"type":"string"},"route":{"type":"string"},"userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["action","at","executionId","id","ip","method","principalId","resource","result","route","userAgent"],"type":"object"},"CreateSubscriptionRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"active":{"default":true,"type":"boolean"},"events":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"secret":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"}},"required":["events","secret","url"]},"DomainOnboardingOutcome":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"assistance":{"type":"object","properties":{"reasons":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","minLength":1},"audience":{"type":"string","enum":["platform","requester"]},"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"resources":{"type":"array","items":{"type":"string","minLength":1}}},"required":["action","audience","code","message"],"additionalProperties":false}},"required":{"type":"boolean"}},"required":["reasons","required"],"additionalProperties":false},"certificate":{"type":"object","properties":{"arn":{"type":"string","minLength":1},"id":{"type":"string","minLength":1},"primaryDomain":{"type":"string","minLength":1},"state":{"type":"string","enum":["created","adopted","not-created","unknown"]}},"required":["primaryDomain","state"],"additionalProperties":false},"cleanup":{"type":"object","properties":{"action":{"type":"string","minLength":1},"certificateArn":{"type":"string","minLength":1},"remainingAttachments":{"type":"array","items":{"type":"string","minLength":1}},"state":{"type":"string","enum":["completed","already-clean","not-required","manual-required","not-reached","unknown"]}},"required":["state"],"additionalProperties":false},"distributions":{"type":"object","properties":{"kirby":{"type":"object","properties":{"id":{"type":"string","minLength":1},"state":{"type":"string","enum":["created","updated","adopted","not-created","unknown"]}},"required":["state"],"additionalProperties":false},"nginx":{"type":"object","properties":{"id":{"type":"string","minLength":1},"state":{"type":"string","enum":["created","updated","adopted","not-created","unknown"]}},"required":["state"],"additionalProperties":false}},"required":["kirby","nginx"],"additionalProperties":false},"domain":{"type":"object","properties":{"name":{"type":"string","minLength":1},"state":{"type":"string","enum":["registered","already-registered","not-registered","unknown"]}},"required":["name","state"],"additionalProperties":false},"executionId":{"type":"string","minLength":1},"googleMaps":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"displayName":{"type":"string","minLength":1},"state":{"type":"string","enum":["updated","already-present","capacity-exhausted","failed"]}},"required":["displayName","state"],"additionalProperties":false}},"outcome":{"type":"string","enum":["updated","already-present","manual-required","not-reached"]},"remainingRootDomains":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["keys","outcome"],"additionalProperties":false},"status":{"type":"string","minLength":1},"workflowRunId":{"type":"string","minLength":1},"zendesk":{"type":"object","properties":{"intendedAction":{"type":"string","minLength":1},"state":{"type":"string","enum":["updated","manual-required","not-requested","not-reached"]},"ticketId":{"type":"string","minLength":1}},"required":["state"],"additionalProperties":false}},"required":["assistance","certificate","cleanup","distributions","domain","executionId","googleMaps","status","zendesk"],"additionalProperties":false},"Error":{"additionalProperties":false,"properties":{"error":{"type":"string"},"issues":{"items":{},"type":"array"},"message":{"type":"string"},"reason":{"type":"string"}},"required":["error"],"type":"object"},"EventCatalog":{"additionalProperties":false,"properties":{"events":{"items":{},"type":"array"}},"required":["events"],"type":"object"},"EventVersionUsage":{"additionalProperties":false,"properties":{"eventType":{"type":"string"},"eventVersion":{"type":"string"},"lifecycle":{},"subscriberCount":{"type":"integer"},"subscribers":{"items":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"health":{"type":"string"},"ownerPrincipalId":{"type":"string"},"subscriptionId":{"type":"string"}},"required":["active","health","ownerPrincipalId","subscriptionId"],"type":"object"},"type":"array"}},"required":["eventType","eventVersion","lifecycle","subscriberCount","subscribers"],"type":"object"},"Execution":{"additionalProperties":false,"properties":{"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"currentStage":{"anyOf":[{"type":"string"},{"type":"null"}]},"executionId":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"principalId":{"type":"string"},"status":{"enum":["canceled","failed","paused","queued","rolled_back","running","succeeded","waiting"],"type":"string"},"workflow":{"type":"string"},"inputJson":{},"outcome":{"$ref":"#/components/schemas/DomainOnboardingOutcome"},"stages":{"items":{"$ref":"#/components/schemas/ExecutionStage"},"type":"array"}},"required":["createdAt","currentStage","executionId","finishedAt","principalId","status","workflow","inputJson","stages"],"type":"object"},"ExecutionStage":{"additionalProperties":false,"properties":{"errorJson":{},"executionId":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"outputJson":{},"stageName":{"type":"string"},"startedAt":{"type":"string"},"status":{"enum":["failed","running","succeeded","waiting"],"type":"string"}},"required":["executionId","id","stageName","startedAt","status"],"type":"object"},"ExecutionSummary":{"additionalProperties":false,"properties":{"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"currentStage":{"anyOf":[{"type":"string"},{"type":"null"}]},"executionId":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"principalId":{"type":"string"},"status":{"enum":["canceled","failed","paused","queued","rolled_back","running","succeeded","waiting"],"type":"string"},"workflow":{"type":"string"}},"required":["createdAt","currentStage","executionId","finishedAt","principalId","status","workflow"],"type":"object"},"MintedApiKey":{"additionalProperties":false,"properties":{"apiKeyId":{"type":"string"},"expiresAt":{"type":"string"},"pepperVersion":{"type":"integer"},"plaintextToken":{"type":"string"},"prefix":{"type":"string"},"principalId":{"type":"string"}},"required":["apiKeyId","expiresAt","pepperVersion","plaintextToken","prefix","principalId"],"type":"object"},"OutboxEvent":{"additionalProperties":false,"properties":{"dispatchedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventId":{"type":"string"},"eventType":{"type":"string"},"eventVersion":{"type":"string"},"executionId":{"type":"string"},"occurredAt":{"type":"string"},"payloadJson":{},"principalId":{"type":"string"},"routedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"streamPublishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"traceparent":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["eventId","eventType","eventVersion","executionId","occurredAt","payloadJson","principalId"],"type":"object"},"RotateSubscriptionSecretRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"secret":{"type":"string","minLength":1}},"required":["secret"]},"Subscription":{"additionalProperties":false,"properties":{"active":{"type":"boolean"},"createdAt":{"type":"string"},"events":{"items":{"type":"string"},"type":"array"},"health":{"type":"string"},"id":{"type":"string"},"kmsKeyId":{"type":"string"},"ownerPrincipalId":{"type":"string"},"url":{"type":"string"}},"required":["active","createdAt","events","health","id","kmsKeyId","ownerPrincipalId","url"],"type":"object"},"SubscriptionDelivery":{"additionalProperties":false,"properties":{"attempt":{"type":"integer"},"dispatchedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventId":{"type":"string"},"id":{"type":"string"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"responseCode":{"anyOf":[{"type":"integer"},{"type":"null"}]},"status":{"type":"string"},"subscriptionId":{"type":"string"}},"required":["attempt","dispatchedAt","eventId","id","lastError","nextAttemptAt","responseCode","status","subscriptionId"],"type":"object"},"SubscriptionError":{"additionalProperties":false,"properties":{"error":{"type":"string"},"issues":{"items":{},"type":"array"},"message":{"type":"string"}},"required":["error"],"type":"object"},"UpdateSubscriptionRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"active":{"type":"boolean"},"events":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}}}},"WorkflowTriggerResponse":{"additionalProperties":false,"properties":{"estimatedDurationSeconds":{"type":"integer"},"executionId":{"type":"string"},"links":{"additionalProperties":false,"properties":{"cancel":{"type":"string"},"events":{"type":"string"},"self":{"type":"string"}},"required":["cancel","events","self"],"type":"object"},"stages":{"items":{"type":"string"},"type":"array"},"status":{"enum":["canceled","failed","paused","queued","rolled_back","running","succeeded","waiting"],"type":"string"},"workflow":{"type":"string"},"workflowRunId":{"type":"string"}},"required":["estimatedDurationSeconds","executionId","links","stages","status","workflow","workflowRunId"],"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"Alfred API key","scheme":"bearer","type":"http"},"streamToken":{"description":"Single-use token minted by POST /v1/streams/token.","in":"query","name":"token","type":"apiKey"}}},"info":{"description":"Operational API for Alfred health, observability, auditing, event administration, API keys, and Workflow Admin access.","title":"Alfred Operator API","version":"0.1.0"},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","openapi":"3.1.0","paths":{"/healthz":{"get":{"operationId":"healthz","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Service is alive"}},"summary":"Health check","tags":["Platform"],"description":"Public, read-only liveness probe that returns success whenever the API process can serve the request. It performs no dependency checks, requires no bearer token, and changes no service state."}},"/readyz":{"get":{"operationId":"readyz","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"checks":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string"},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["name","ok"],"type":"object"},"type":"array"},"ok":{"type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Dependencies are ready"},"503":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"checks":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string"},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["name","ok"],"type":"object"},"type":"array"},"ok":{"type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Dependency unavailable"}},"summary":"Readiness check","tags":["Platform"],"description":"Public, read-only readiness probe that runs every configured dependency check. It requires no bearer token, returns 503 when any check fails, and changes no service or workflow state."}},"/metrics":{"get":{"operationId":"metrics","responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Prometheus text exposition format."}},"summary":"Prometheus metrics","tags":["Observability"],"description":"Public, read-only Prometheus text exposition endpoint, registered only when a metrics source is configured. It requires no bearer token and does not mutate application or workflow state."}},"/v1/audit":{"get":{"operationId":"auditLog","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"audit":{"items":{"$ref":"#/components/schemas/AuditLog"},"type":"array"}},"required":["audit"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An audit filter is invalid."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller lacks the required permission."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Audit storage is unavailable."}},"summary":"Read audit log","tags":["Audit"],"description":"Requires audit:read and performs a read-only query of authorization decisions. Optional principal, resource, action, result, since, and limit filters do not alter audit or workflow state; unavailable storage returns 503.","parameters":[{"description":"Filter by authorization action.","in":"query","name":"action","required":false,"schema":{"type":"string"}},{"description":"Maximum records to return. Must be between 1 and 100.","in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Filter by principal ID.","in":"query","name":"principalId","required":false,"schema":{"type":"string"}},{"description":"Filter by protected resource.","in":"query","name":"resource","required":false,"schema":{"type":"string"}},{"description":"Filter by authorization result.","in":"query","name":"result","required":false,"schema":{"enum":["allowed","denied"],"type":"string"}},{"description":"Filter by an ISO date accepted by the runtime.","in":"query","name":"since","required":false,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/v1/admin/version-usage":{"get":{"operationId":"eventVersionUsage","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"usage":{"items":{"$ref":"#/components/schemas/EventVersionUsage"},"type":"array"}},"required":["usage"],"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller lacks the required permission."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Event version usage storage is unavailable."}},"summary":"Read event version usage","tags":["Admin"],"description":"Requires admin:read and returns read-only event-version lifecycle and active subscriber usage used to assess migration safety. It is valid regardless of workflow state, changes nothing, and returns 503 when its usage store is unavailable.","security":[{"bearerAuth":[]}]}},"/v1/admin/event-versions/{eventType}/archive":{"post":{"operationId":"archiveEventVersion","responses":{"202":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"archived":{"type":"boolean"}},"required":["archived"],"type":"object"}}},"description":"Event version archived."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The confirmation body must set confirm to true."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller lacks the required permission."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Archival guard failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Event version archival storage is unavailable."}},"summary":"Archive deprecated event version","tags":["Admin"],"description":"Requires admin:write and confirm=true in the JSON body. This mutating action archives the named deprecated event version only when the archival store's lifecycle guard allows it; guarded versions return a conflict and unavailable storage returns 503.","parameters":[{"description":"Event type, for example CertificateIssued.v1.","in":"path","name":"eventType","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"examples":{"default":{"value":{"confirm":true}}},"schema":{"$ref":"#/components/schemas/ArchiveEventVersionRequest"}}},"required":true},"security":[{"bearerAuth":[]}]}},"/v1/principals/{id}/api-keys":{"get":{"operationId":"listApiKeys","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"apiKeys":{"items":{"$ref":"#/components/schemas/ApiKeyMetadata"},"type":"array"}},"required":["apiKeys"],"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller lacks the required permission."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"API-key metadata store is unavailable."}},"summary":"List API keys","tags":["API Keys"],"description":"Reads API-key metadata without plaintext tokens. An authenticated principal may inspect its own keys in any key state; reading another principal requires principals:manage, and the operation does not mutate keys or workflows.","parameters":[{"description":"Principal ID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]},"post":{"operationId":"mintApiKey","responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"apiKey":{"$ref":"#/components/schemas/MintedApiKey"}},"required":["apiKey"],"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller lacks the required permission."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"API-key metadata store is unavailable."}},"summary":"Mint API key","tags":["API Keys"],"description":"Mints an API key and returns its plaintext token in this response only. An authenticated principal may mint for itself; minting for another principal requires principals:manage. The action creates credential state but does not affect workflow state.","parameters":[{"description":"Principal ID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/v1/api-keys/{id}":{"delete":{"operationId":"revokeApiKey","responses":{"204":{"description":"API key revoked."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The caller lacks the required permission."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"API key not found."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"API-key metadata store is unavailable."}},"summary":"Revoke API key","tags":["API Keys"],"description":"Requires principals:manage and immediately revokes the identified API key, so later bearer authentication with it fails. This mutates credential state but no workflow state; an unknown key returns 404.","parameters":[{"description":"API key ID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}}},"tags":[{"name":"Platform"},{"name":"Observability"},{"name":"Audit"},{"name":"Admin"},{"name":"API Keys"}],"x-workflowAdminProxy":{"description":"Authenticated pass-through to the configured Workflow Admin service. The upstream RPC surface is intentionally not modeled as fixed OpenAPI operations.","paths":["/admin/workflow","/admin/workflow/*","/api/rpc"],"permission":"admin:read"},"servers":[{"url":"https://api-production-da844.up.railway.app"}]}