{"openapi":"3.1.0","info":{"title":"AgentConnect API","description":"The C2 BFF REST surface (Web UI ⇄ Control Plane). Every resource is org-scoped under `/api/v1/orgs/:orgId` behind bearer auth; a cross-org id reads as 404. The Control Plane stores only control-plane metadata — message bodies and workspace bytes stay daemon-local.","version":"1","x-agentconnect-release":"v2.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{}},"paths":{"/v1/runtime-config":{"get":{"operationId":"getRuntimeConfig","summary":"Get public runtime configuration","tags":["Deployment"],"description":"Returns the secret-free browser configuration loaded for this process: authentication plus the GitLab instance the deployment talks to. A deployment change takes effect after restart.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"type":"string","enum":["1"]},"revision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"config":{"anyOf":[{"type":"object","properties":{"auth":{"anyOf":[{"type":"object","properties":{"endpoint":{"type":"string","format":"uri"},"issuer":{"type":"string","format":"uri"},"appId":{"type":"string","minLength":1},"apiResource":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"socialProviders":{"type":"array","items":{"type":"string","minLength":1}}},"required":["endpoint","issuer","appId","apiResource","socialProviders"],"additionalProperties":false},{"type":"null"}]},"gitlab":{"anyOf":[{"type":"object","properties":{"instanceUrl":{"type":"string","format":"uri"}},"required":["instanceUrl"],"additionalProperties":false},{"type":"null"}]}},"required":["auth","gitlab"],"additionalProperties":false},{"type":"null"}]}},"required":["schemaVersion","revision","config"],"additionalProperties":false}}}}}}},"/v1/orgs":{"get":{"operationId":"listOrganizations","summary":"List your organizations","tags":["Organizations"],"description":"Every organization the caller belongs to, with their role. An empty list means the caller belongs to none yet and should create or join one.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":"string"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"defaultAgentVisibility":{"type":"string","enum":["all","selected"]},"onboardingCompleted":{"type":"boolean"},"gettingStartedStep":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iconUrl":{"type":["string","null"]},"iconUploadEnabled":{"type":"boolean"},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daemonCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","name","slug","icon","defaultAgentVisibility","onboardingCompleted","gettingStartedStep","iconUrl","iconUploadEnabled","role","memberCount","daemonCount","createdAt"],"additionalProperties":false}}}}}}}},"/v1/me":{"get":{"operationId":"getMyProfile","summary":"Get your profile","tags":["Profile"],"description":"The signed-in user's own profile: identity, display name, and avatar.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"pictureCustom":{"type":"boolean"},"pictureUploadEnabled":{"type":"boolean"}},"required":["userId","email","name","picture","pictureCustom","pictureUploadEnabled"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateMyProfile","summary":"Update your profile","tags":["Profile"],"description":"Edit your display name. Email remains managed by the sign-in provider; profile photos use the dedicated upload endpoint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"pictureCustom":{"type":"boolean"},"pictureUploadEnabled":{"type":"boolean"}},"required":["userId","email","name","picture","pictureCustom","pictureUploadEnabled"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/picture":{"put":{"operationId":"uploadMyProfilePicture","summary":"Upload your profile photo","tags":["Profile"],"description":"Store a PNG, JPEG, or WebP photo for your profile. The image replaces the sign-in provider photo until removed.","requestBody":{"required":true,"content":{"image/png":{"schema":{}},"image/jpeg":{"schema":{}},"image/webp":{"schema":{}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"pictureCustom":{"type":"boolean"},"pictureUploadEnabled":{"type":"boolean"}},"required":["userId","email","name","picture","pictureCustom","pictureUploadEnabled"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"415":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteMyProfilePicture","summary":"Remove your profile photo","tags":["Profile"],"description":"Remove the uploaded photo and restore the avatar from your sign-in provider.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"pictureCustom":{"type":"boolean"},"pictureUploadEnabled":{"type":"boolean"}},"required":["userId","email","name","picture","pictureCustom","pictureUploadEnabled"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/refresh":{"post":{"operationId":"refreshMySocialIdentities","summary":"Refresh your cached sign-in methods","tags":["Profile"],"description":"Discard the cached copy of your sign-in methods, so the next read reflects a link completed directly against the sign-in provider.","responses":{"204":{"description":"Default Response"},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/authorization-uri":{"post":{"operationId":"createMySocialIdentityAuthorization","summary":"Start linking a social sign-in method","tags":["Profile"],"description":"Resolve the provider and report how it must be linked. `direct` returns an authorization URI Logto built, and the link completes server-side. `verified` means the connector cannot be driven without a session, so the browser drives it against the Account API and Logto requires an ownership proof.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9_-]+$"},"state":{"type":"string","minLength":32,"maxLength":256}},"required":["target","state"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["direct"]},"connectorId":{"type":"string","minLength":1,"maxLength":128},"authorizationUri":{"type":"string","format":"uri"}},"required":["mode","connectorId","authorizationUri"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["verified"]},"connectorId":{"type":"string","minLength":1,"maxLength":128}},"required":["mode","connectorId"],"additionalProperties":false}]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities":{"post":{"operationId":"linkMySocialIdentity","summary":"Link a social sign-in method","tags":["Profile"],"description":"Link the identity the provider just authenticated to the signed-in user. Only for providers that reported `direct`; existing accounts are not merged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectorId":{"type":"string","minLength":1,"maxLength":128},"connectorData":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":4096}}},"required":["connectorId","connectorData"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"linked":{"type":"boolean","enum":[true]}},"required":["linked"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"get":{"operationId":"getMySocialIdentities","summary":"Get your sign-in methods","tags":["Profile"],"description":"The social accounts linked to your profile, narrowed to what the console renders, plus whether Logto will require you to re-verify before they can change.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"identities":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"profileUrl":{"type":"string"},"workspace":{"type":"object","properties":{"teamId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"url":{"type":"string"}},"required":["teamId"],"additionalProperties":false}},"required":["target","userId"],"additionalProperties":false}},"githubRepoIdentity":{"type":"object","properties":{"githubUserId":{"type":"string"},"login":{"type":"string"}},"required":["githubUserId","login"],"additionalProperties":false},"githubRepoAccessAvailable":{"type":"boolean"},"hasSecurityVerificationMethod":{"type":"boolean"},"primaryEmail":{"type":"string"}},"required":["identities","hasSecurityVerificationMethod"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/connectors/{target}":{"get":{"operationId":"getMySocialConnectorId","summary":"Resolve a social connector id","tags":["Profile"],"description":"The tenant's connector id for a supported provider target, so the console can start the Account API link flow. Resolution only — the authorization URI is built by the browser, which is the only side with the connector session Logto needs.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9_-]+$"},"in":"path","name":"target","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connectorId":{"type":"string","minLength":1,"maxLength":128}},"required":["connectorId"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/{target}":{"delete":{"operationId":"unlinkMySocialIdentity","summary":"Unlink a social sign-in method","tags":["Profile"],"description":"Remove one social identity from the signed-in user. The last social sign-in method cannot be removed.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"target","required":true}],"responses":{"204":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/github/repo-access/authorization":{"post":{"operationId":"createMyGithubRepoAccessAuthorization","summary":"Connect GitHub for repository access","tags":["Profile"],"description":"Start a user-bound GitHub authorization without adding a sign-in method or replacing an existing identity.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","minLength":32,"maxLength":256},"authorizationUri":{"type":"string","format":"uri"}},"required":["state","authorizationUri"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/github/repo-access":{"post":{"operationId":"linkMyGithubRepoAccess","summary":"Complete GitHub repository authorization","tags":["Profile"],"description":"Consume a single-use authorization for the signed-in user and store only the verified GitHub identity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":4096},"state":{"type":"string","minLength":32,"maxLength":256}},"required":["code","state"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"githubUserId":{"type":"string"},"login":{"type":"string"}},"required":["githubUserId","login"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"unlinkMyGithubRepoAccess","summary":"Disconnect GitHub repository access","tags":["Profile"],"description":"Remove this account's repository-only connection and cancel pending authorizations without changing sign-in methods.","responses":{"204":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/social-identities/slack":{"get":{"operationId":"getMySlackIdentity","summary":"Get your Slack workspace identity","tags":["Profile"],"description":"The Slack workspace id and user id behind your account, as recorded by the sign-in provider. Returns `linked: false` when you have not connected Slack.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"linked":{"type":"boolean","enum":[false]}},"required":["linked"],"additionalProperties":false},{"type":"object","properties":{"linked":{"type":"boolean","enum":[true]},"teamId":{"type":"string"},"userId":{"type":"string"},"teamName":{"type":"string"},"teamDomain":{"type":"string"}},"required":["linked","teamId","userId"],"additionalProperties":false}]}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/me/access":{"get":{"operationId":"getMyAccess","summary":"Get your app-admission state","tags":["Profile"],"description":"Whether the signed-in user may enter the app under closed-beta (waitlist) mode, and their derived status. When waitlist mode is off the status is always \"active\". The email is read from trusted persistence, never from a request header.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"waitlistMode":{"type":"boolean"},"status":{"type":"string","enum":["active","approved","pending","none"]},"activated":{"type":"boolean"},"orgCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"email":{"type":["string","null"]}},"required":["waitlistMode","status","activated","orgCount","email"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/waitlist":{"post":{"operationId":"joinWaitlist","summary":"Join the waitlist","tags":["Profile"],"description":"Add the signed-in user’s own verified email to the waitlist as a pending entry (idempotent — a pre-existing entry is left unchanged). The email is taken from the verified identity, never from the request body. The applicant intake is REQUIRED — name, company/team, at least one platform, and team size (use-case is optional) — and is stored as context. Requires OIDC sign-in with a verified email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"company":{"type":"string","minLength":1,"maxLength":120},"platform":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]}},"teamSize":{"type":"string","minLength":1,"maxLength":40},"useCase":{"type":"string","maxLength":2000}},"required":["name","company","platform","teamSize"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","approved","rejected"]}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/waitlist/redeem":{"post":{"operationId":"redeemWaitlistLink","summary":"Redeem a waitlist activation link","tags":["Profile"],"description":"Redeem an activation link, making the signed-in user a formal (activated) user. Activation grants admission, not an organization — the user creates or joins one afterwards. A link minted for a specific email must be redeemed by that verified email; an email-less bearer link may be redeemed by any verified identity and binds to the first redeemer (one use), except that an already-activated account is admitted without consuming it. Optionally send `expectSubject` to assert which signed-in identity the client meant: if it disagrees with the verified token, the request is refused (409 IDENTITY_CHANGED) instead of activating a different account. Idempotent on repeat by the same user. Requires OIDC sign-in with a verified email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200},"expectSubject":{"type":"string","minLength":1,"maxLength":255}},"required":["token"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"activated":{"type":"boolean","enum":[true]}},"required":["activated"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/invite-links/accept":{"post":{"operationId":"acceptOrganizationInviteLink","summary":"Accept an organization invite link","tags":["Members"],"description":"Redeems a valid link for the signed-in account as collaborator. A removed account cannot redeem the same link again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":256}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["accepted","already_member"]},"org":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","slug","name"],"additionalProperties":false}},"required":["status","org"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/":{"get":{"operationId":"getOrganization","summary":"Get the organization","tags":["Organizations"],"description":"The organization from the caller’s perspective, including its new-agent visibility default.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":"string"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"defaultAgentVisibility":{"type":"string","enum":["all","selected"]},"onboardingCompleted":{"type":"boolean"},"gettingStartedStep":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iconUrl":{"type":["string","null"]},"iconUploadEnabled":{"type":"boolean"},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daemonCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","name","slug","icon","defaultAgentVisibility","onboardingCompleted","gettingStartedStep","iconUrl","iconUploadEnabled","role","memberCount","daemonCount","createdAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateOrganization","summary":"Update the organization","tags":["Organizations"],"description":"Update organization identity or the default visibility policy for newly created agents (owner only). A slug collision returns 409.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"slug":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"]}]},{"type":"null"}]},"defaultAgentVisibility":{"type":"string","enum":["all","selected"]},"onboardingCompleted":{"type":"boolean","enum":[true]},"gettingStartedStep":{"type":"integer","minimum":0,"maximum":100}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":"string"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"defaultAgentVisibility":{"type":"string","enum":["all","selected"]},"onboardingCompleted":{"type":"boolean"},"gettingStartedStep":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iconUrl":{"type":["string","null"]},"iconUploadEnabled":{"type":"boolean"},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"memberCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daemonCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","name","slug","icon","defaultAgentVisibility","onboardingCompleted","gettingStartedStep","iconUrl","iconUploadEnabled","role","memberCount","daemonCount","createdAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/selection":{"put":{"operationId":"selectOrganization","summary":"Select the organization","tags":["Organizations"],"description":"Remember this organization as the signed-in user’s active organization.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"204":{"description":"Default Response"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/daemons":{"get":{"operationId":"listDaemons","summary":"List daemons","tags":["Daemons"],"description":"The org’s available daemon fleet, including install-wide pool members, overlaid with live connection status. Liveness only — what each daemon can run is GET /daemons/capabilities, and a runtime’s per-model catalog is GET /daemons/:id.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"daemonId":{"type":"string"},"host":{"type":["string","null"]},"name":{"type":["string","null"]},"agentVersion":{"type":["string","null"]},"releaseChannel":{"type":"string"},"latestVersion":{"type":["string","null"]},"availableVersions":{"type":"array","items":{"type":"string"}},"lifecycleOp":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"cloud":{"type":"boolean"},"health":{"type":"string"},"load":{"anyOf":[{"type":"object","properties":{"cpu":{"type":"number"},"mem":{"type":"number"},"agents":{"type":"number"}},"required":["cpu","mem","agents"],"additionalProperties":false},{"type":"null"}]},"sessionEpoch":{"type":"number"},"maxAgents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeSessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hostedSessions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastSeenAt":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"sessionRetention":{"type":"string","pattern":"^(?:never|[1-9]\\d{0,3}d)$"},"memberSetId":{"type":["string","null"]},"pinnable":{"type":"boolean"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"canManageLifecycle":{"type":"boolean"}},"required":["daemonId","host","name","agentVersion","releaseChannel","latestVersion","availableVersions","lifecycleOp","status","cloud","health","load","sessionEpoch","maxAgents","activeSessions","hostedSessions","lastSeenAt","createdAt","createdBy","lastModifiedAt","lastModifiedBy","sessionRetention","memberSetId","pinnable","visibility","sharedWith","canEdit","canManageSharing","canManageLifecycle"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/daemons/capabilities":{"get":{"operationId":"listDaemonCapabilities","summary":"List daemon capabilities","tags":["Daemons"],"description":"What each daemon in the fleet can run: platform/feature capabilities, the installed runtime profiles, and the daemon-configured MCP servers. This half of a daemon row changes only when it connects, upgrades, or re-probes, so it is read separately from the liveness poll. Each runtime’s catalog carries its runtime-level answers (default model, permission modes) but an empty models list: that per-model matrix is GET /daemons/:id.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"daemonId":{"type":"string"},"capabilities":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string"}},"runtimes":{"type":"array","items":{"type":"string"}},"acp":{"type":"boolean"},"features":{"type":"array","items":{"type":"string"}},"sandboxUnavailable":{"type":"string"},"executor":{"type":"object","properties":{"enabled":{"type":"boolean"},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},"capacity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["enabled"],"additionalProperties":false},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}}},"required":["platforms","runtimes","acp","features"],"additionalProperties":false},"runtimeProfiles":{"type":"array","items":{"type":"object","properties":{"runtime":{"type":"string"},"aliasOf":{"type":["string","null"]},"version":{"type":"string"},"hostVersion":{"type":["string","null"]},"hostAvailable":{"type":["boolean","null"]},"credentialsConfigured":{"type":["boolean","null"]},"models":{"type":"array","items":{"type":"string"}},"contextWindow":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"acpSupport":{"type":"string"},"acpProtocolVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toolCalling":{"type":"boolean"},"mcpCapabilities":{"anyOf":[{"type":"object","properties":{"http":{"type":"boolean"},"sse":{"type":"boolean"}},"required":["http","sse"],"additionalProperties":false},{"type":"null"}]},"modelCatalog":{"anyOf":[{"type":"object","properties":{"modelSwitching":{"type":"boolean"},"models":{"maxItems":0,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"efforts":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultEffort":{"type":"string"},"fastMode":{"type":"boolean"}},"required":["id"],"additionalProperties":false}},"defaultModel":{"type":"string"},"permissionModes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultPermissionMode":{"type":"string"},"source":{"type":"string","enum":["native","acp"]},"observedAt":{"type":"string"}},"required":["models","source","observedAt"],"additionalProperties":false},{"type":"null"}]},"modelsSource":{"type":["string","null"]},"authRequired":{"type":"boolean"},"unavailableReason":{"anyOf":[{"type":"string","enum":["image-binary-missing","host-binary-missing"]},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"additionalProperties":{"type":"object","properties":{"available":{"type":"boolean"},"unavailableReason":{"type":"string","maxLength":2000},"models":{"type":"array","items":{"type":"string"}},"modelsSource":{"type":"string","enum":["cached","probed"]}},"required":["available"],"additionalProperties":false}},{"type":"null"}]},"observedAt":{"type":["string","null"]}},"required":["runtime","version","models","contextWindow","acpSupport","acpProtocolVersion","toolCalling","mcpCapabilities","modelCatalog","modelsSource","authRequired","observedAt"],"additionalProperties":false}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http","sse"]}},"required":["name","transport"],"additionalProperties":false}}},"required":["daemonId","capabilities","runtimeProfiles","mcpServers"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/daemons/pool/runtime-probe":{"post":{"operationId":"probePoolRuntimes","summary":"Refresh the pool’s runtimes","tags":["Daemons"],"description":"Ask every live install-wide pool member that takes requests to re-probe its runtime image now, so a model a provider added since the last probe appears without a restart. The members elect one to claim a probe sandbox and the rest adopt its answer; the refreshed runtimes arrive through GET /daemons/capabilities once it finishes, typically within a few minutes. 202 with the members that accepted; 200 unsupported when no member takes requests (a managed pool refreshes on its own schedule). Requests within 30 s of the last one join it. Organization owners only; 503 when no member can be reached.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["probing","unsupported"]},"members":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","members"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["probing","unsupported"]},"members":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","members"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/daemons/{id}":{"get":{"operationId":"getDaemon","summary":"Get a daemon","tags":["Daemons"],"description":"One daemon in full: its liveness row plus its capabilities and complete runtime profiles, including each runtime’s discovered model × configuration catalog. This is the only read carrying the per-model matrix — its readers all configure a single daemon at a time.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"daemonId":{"type":"string"},"host":{"type":["string","null"]},"name":{"type":["string","null"]},"agentVersion":{"type":["string","null"]},"releaseChannel":{"type":"string"},"latestVersion":{"type":["string","null"]},"availableVersions":{"type":"array","items":{"type":"string"}},"lifecycleOp":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"cloud":{"type":"boolean"},"health":{"type":"string"},"capabilities":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string"}},"runtimes":{"type":"array","items":{"type":"string"}},"acp":{"type":"boolean"},"features":{"type":"array","items":{"type":"string"}},"sandboxUnavailable":{"type":"string"},"executor":{"type":"object","properties":{"enabled":{"type":"boolean"},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},"capacity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["enabled"],"additionalProperties":false},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}}},"required":["platforms","runtimes","acp","features"],"additionalProperties":false},"runtimeProfiles":{"type":"array","items":{"type":"object","properties":{"runtime":{"type":"string"},"aliasOf":{"type":["string","null"]},"version":{"type":"string"},"hostVersion":{"type":["string","null"]},"hostAvailable":{"type":["boolean","null"]},"credentialsConfigured":{"type":["boolean","null"]},"models":{"type":"array","items":{"type":"string"}},"contextWindow":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"acpSupport":{"type":"string"},"acpProtocolVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toolCalling":{"type":"boolean"},"mcpCapabilities":{"anyOf":[{"type":"object","properties":{"http":{"type":"boolean"},"sse":{"type":"boolean"}},"required":["http","sse"],"additionalProperties":false},{"type":"null"}]},"modelCatalog":{"anyOf":[{"type":"object","properties":{"modelSwitching":{"type":"boolean"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"efforts":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultEffort":{"type":"string"},"fastMode":{"type":"boolean"}},"required":["id"],"additionalProperties":false}},"defaultModel":{"type":"string"},"permissionModes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultPermissionMode":{"type":"string"},"source":{"type":"string","enum":["native","acp"]},"observedAt":{"type":"string"}},"required":["models","source","observedAt"],"additionalProperties":false},{"type":"null"}]},"modelsSource":{"type":["string","null"]},"authRequired":{"type":"boolean"},"unavailableReason":{"anyOf":[{"type":"string","enum":["image-binary-missing","host-binary-missing"]},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"additionalProperties":{"type":"object","properties":{"available":{"type":"boolean"},"unavailableReason":{"type":"string","maxLength":2000},"models":{"type":"array","items":{"type":"string"}},"modelsSource":{"type":"string","enum":["cached","probed"]}},"required":["available"],"additionalProperties":false}},{"type":"null"}]},"observedAt":{"type":["string","null"]}},"required":["runtime","version","models","contextWindow","acpSupport","acpProtocolVersion","toolCalling","mcpCapabilities","modelCatalog","modelsSource","authRequired","observedAt"],"additionalProperties":false}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http","sse"]}},"required":["name","transport"],"additionalProperties":false}},"load":{"anyOf":[{"type":"object","properties":{"cpu":{"type":"number"},"mem":{"type":"number"},"agents":{"type":"number"}},"required":["cpu","mem","agents"],"additionalProperties":false},{"type":"null"}]},"sessionEpoch":{"type":"number"},"maxAgents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeSessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hostedSessions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastSeenAt":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"sessionRetention":{"type":"string","pattern":"^(?:never|[1-9]\\d{0,3}d)$"},"memberSetId":{"type":["string","null"]},"pinnable":{"type":"boolean"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"canManageLifecycle":{"type":"boolean"}},"required":["daemonId","host","name","agentVersion","releaseChannel","latestVersion","availableVersions","lifecycleOp","status","cloud","health","capabilities","runtimeProfiles","mcpServers","load","sessionEpoch","maxAgents","activeSessions","hostedSessions","lastSeenAt","createdAt","createdBy","lastModifiedAt","lastModifiedBy","sessionRetention","memberSetId","pinnable","visibility","sharedWith","canEdit","canManageSharing","canManageLifecycle"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateDaemon","summary":"Update a daemon","tags":["Daemons"],"description":"Update console daemon settings: the human-friendly display name and/or the finished-session retention window (\"Expire sessions\"). A retention change is hot-pushed to a connected daemon and re-issued in the register/ok snapshot on reconnect.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"sessionRetention":{"type":"string","pattern":"^(?:never|[1-9]\\d{0,3}d)$"}}}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"daemonId":{"type":"string"},"host":{"type":["string","null"]},"name":{"type":["string","null"]},"agentVersion":{"type":["string","null"]},"releaseChannel":{"type":"string"},"latestVersion":{"type":["string","null"]},"availableVersions":{"type":"array","items":{"type":"string"}},"lifecycleOp":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"cloud":{"type":"boolean"},"health":{"type":"string"},"capabilities":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string"}},"runtimes":{"type":"array","items":{"type":"string"}},"acp":{"type":"boolean"},"features":{"type":"array","items":{"type":"string"}},"sandboxUnavailable":{"type":"string"},"executor":{"type":"object","properties":{"enabled":{"type":"boolean"},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},"capacity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["enabled"],"additionalProperties":false},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}}},"required":["platforms","runtimes","acp","features"],"additionalProperties":false},"runtimeProfiles":{"type":"array","items":{"type":"object","properties":{"runtime":{"type":"string"},"aliasOf":{"type":["string","null"]},"version":{"type":"string"},"hostVersion":{"type":["string","null"]},"hostAvailable":{"type":["boolean","null"]},"credentialsConfigured":{"type":["boolean","null"]},"models":{"type":"array","items":{"type":"string"}},"contextWindow":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"acpSupport":{"type":"string"},"acpProtocolVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toolCalling":{"type":"boolean"},"mcpCapabilities":{"anyOf":[{"type":"object","properties":{"http":{"type":"boolean"},"sse":{"type":"boolean"}},"required":["http","sse"],"additionalProperties":false},{"type":"null"}]},"modelCatalog":{"anyOf":[{"type":"object","properties":{"modelSwitching":{"type":"boolean"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"efforts":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultEffort":{"type":"string"},"fastMode":{"type":"boolean"}},"required":["id"],"additionalProperties":false}},"defaultModel":{"type":"string"},"permissionModes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultPermissionMode":{"type":"string"},"source":{"type":"string","enum":["native","acp"]},"observedAt":{"type":"string"}},"required":["models","source","observedAt"],"additionalProperties":false},{"type":"null"}]},"modelsSource":{"type":["string","null"]},"authRequired":{"type":"boolean"},"unavailableReason":{"anyOf":[{"type":"string","enum":["image-binary-missing","host-binary-missing"]},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"additionalProperties":{"type":"object","properties":{"available":{"type":"boolean"},"unavailableReason":{"type":"string","maxLength":2000},"models":{"type":"array","items":{"type":"string"}},"modelsSource":{"type":"string","enum":["cached","probed"]}},"required":["available"],"additionalProperties":false}},{"type":"null"}]},"observedAt":{"type":["string","null"]}},"required":["runtime","version","models","contextWindow","acpSupport","acpProtocolVersion","toolCalling","mcpCapabilities","modelCatalog","modelsSource","authRequired","observedAt"],"additionalProperties":false}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http","sse"]}},"required":["name","transport"],"additionalProperties":false}},"load":{"anyOf":[{"type":"object","properties":{"cpu":{"type":"number"},"mem":{"type":"number"},"agents":{"type":"number"}},"required":["cpu","mem","agents"],"additionalProperties":false},{"type":"null"}]},"sessionEpoch":{"type":"number"},"maxAgents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeSessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hostedSessions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastSeenAt":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"sessionRetention":{"type":"string","pattern":"^(?:never|[1-9]\\d{0,3}d)$"},"memberSetId":{"type":["string","null"]},"pinnable":{"type":"boolean"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"canManageLifecycle":{"type":"boolean"}},"required":["daemonId","host","name","agentVersion","releaseChannel","latestVersion","availableVersions","lifecycleOp","status","cloud","health","capabilities","runtimeProfiles","mcpServers","load","sessionEpoch","maxAgents","activeSessions","hostedSessions","lastSeenAt","createdAt","createdBy","lastModifiedAt","lastModifiedBy","sessionRetention","memberSetId","pinnable","visibility","sharedWith","canEdit","canManageSharing","canManageLifecycle"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteDaemon","summary":"Detach a daemon","tags":["Daemons"],"description":"Remove a daemon from the fleet, cascading its keys, leases, and launches; refused while it is online and reachable.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/daemons/{id}/sharing":{"put":{"operationId":"setDaemonSharing","summary":"Set daemon sharing","tags":["Daemons"],"description":"Set a daemon’s visibility (Everyone vs Selected) and complete Selected audience. Requires edit rights; Selected must retain at least one current organization member, and sharedWith is intersected with current membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string"}}},"required":["visibility"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"daemonId":{"type":"string"},"host":{"type":["string","null"]},"name":{"type":["string","null"]},"agentVersion":{"type":["string","null"]},"releaseChannel":{"type":"string"},"latestVersion":{"type":["string","null"]},"availableVersions":{"type":"array","items":{"type":"string"}},"lifecycleOp":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"cloud":{"type":"boolean"},"health":{"type":"string"},"capabilities":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string"}},"runtimes":{"type":"array","items":{"type":"string"}},"acp":{"type":"boolean"},"features":{"type":"array","items":{"type":"string"}},"sandboxUnavailable":{"type":"string"},"executor":{"type":"object","properties":{"enabled":{"type":"boolean"},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},"capacity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["enabled"],"additionalProperties":false},"strategies":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}}},"required":["platforms","runtimes","acp","features"],"additionalProperties":false},"runtimeProfiles":{"type":"array","items":{"type":"object","properties":{"runtime":{"type":"string"},"aliasOf":{"type":["string","null"]},"version":{"type":"string"},"hostVersion":{"type":["string","null"]},"hostAvailable":{"type":["boolean","null"]},"credentialsConfigured":{"type":["boolean","null"]},"models":{"type":"array","items":{"type":"string"}},"contextWindow":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"acpSupport":{"type":"string"},"acpProtocolVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toolCalling":{"type":"boolean"},"mcpCapabilities":{"anyOf":[{"type":"object","properties":{"http":{"type":"boolean"},"sse":{"type":"boolean"}},"required":["http","sse"],"additionalProperties":false},{"type":"null"}]},"modelCatalog":{"anyOf":[{"type":"object","properties":{"modelSwitching":{"type":"boolean"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"efforts":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultEffort":{"type":"string"},"fastMode":{"type":"boolean"}},"required":["id"],"additionalProperties":false}},"defaultModel":{"type":"string"},"permissionModes":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["value"],"additionalProperties":false}},"defaultPermissionMode":{"type":"string"},"source":{"type":"string","enum":["native","acp"]},"observedAt":{"type":"string"}},"required":["models","source","observedAt"],"additionalProperties":false},{"type":"null"}]},"modelsSource":{"type":["string","null"]},"authRequired":{"type":"boolean"},"unavailableReason":{"anyOf":[{"type":"string","enum":["image-binary-missing","host-binary-missing"]},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"additionalProperties":{"type":"object","properties":{"available":{"type":"boolean"},"unavailableReason":{"type":"string","maxLength":2000},"models":{"type":"array","items":{"type":"string"}},"modelsSource":{"type":"string","enum":["cached","probed"]}},"required":["available"],"additionalProperties":false}},{"type":"null"}]},"observedAt":{"type":["string","null"]}},"required":["runtime","version","models","contextWindow","acpSupport","acpProtocolVersion","toolCalling","mcpCapabilities","modelCatalog","modelsSource","authRequired","observedAt"],"additionalProperties":false}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["stdio","http","sse"]}},"required":["name","transport"],"additionalProperties":false}},"load":{"anyOf":[{"type":"object","properties":{"cpu":{"type":"number"},"mem":{"type":"number"},"agents":{"type":"number"}},"required":["cpu","mem","agents"],"additionalProperties":false},{"type":"null"}]},"sessionEpoch":{"type":"number"},"maxAgents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeSessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hostedSessions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastSeenAt":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"sessionRetention":{"type":"string","pattern":"^(?:never|[1-9]\\d{0,3}d)$"},"memberSetId":{"type":["string","null"]},"pinnable":{"type":"boolean"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"canManageLifecycle":{"type":"boolean"}},"required":["daemonId","host","name","agentVersion","releaseChannel","latestVersion","availableVersions","lifecycleOp","status","cloud","health","capabilities","runtimeProfiles","mcpServers","load","sessionEpoch","maxAgents","activeSessions","hostedSessions","lastSeenAt","createdAt","createdBy","lastModifiedAt","lastModifiedBy","sessionRetention","memberSetId","pinnable","visibility","sharedWith","canEdit","canManageSharing","canManageLifecycle"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/daemons/{id}/upgrade":{"post":{"operationId":"upgradeDaemon","summary":"Upgrade a daemon","tags":["Daemons"],"description":"Open an upgrade op for a daemon. A ready daemon receives it immediately; an offline daemon that previously advertised bootstrap recovery consumes it during its next auth. The 202 means accepted or durably queued, while success requires READY on the target version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9._+-]*$"}},"required":["version"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/daemons/{id}/restart":{"post":{"operationId":"restartDaemon","summary":"Restart a daemon","tags":["Daemons"],"description":"Command a daemon to drain and exit so its supervisor relaunches it (same version). The 202 returns the opened lifecycle op (with its id) and only means the daemon accepted the command; success is confirmed when it re-registers — track the op by id via the fleet read model’s lifecycleOp.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/daemons/{id}/lifecycle/{opId}":{"get":{"operationId":"getDaemonLifecycleOp","summary":"Get a daemon lifecycle op","tags":["Daemons"],"description":"Fetch a single CP-commanded restart/upgrade op by id (status expiry-projected). The console polls this to track the command it issued.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"opId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"op":{"type":"string","enum":["restart","upgrade"]},"status":{"type":"string","enum":["pending","succeeded","failed"]},"phase":{"anyOf":[{"type":"string","enum":["preparing","restarting"]},{"type":"null"}]},"targetVersion":{"type":["string","null"]},"outcome":{"type":["string","null"]}},"required":["id","op","status","phase","targetVersion","outcome"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/member-sets":{"get":{"operationId":"listMemberSets","summary":"List member sets","tags":["Member sets"],"description":"The organization’s member sets — named sets of its daemons within which an agent’s duty may be claimed. The install-wide pool is not among them.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"memberDaemonIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"agentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spreadSessions":{"type":"boolean"}},"required":["setId","name","memberDaemonIds","agentCount","spreadSessions"],"additionalProperties":false}}}}}}},"post":{"operationId":"createMemberSet","summary":"Create a member set","tags":["Member sets"],"description":"Create an empty member set. Daemons join it afterwards, one set per daemon.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"memberDaemonIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"agentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spreadSessions":{"type":"boolean"}},"required":["setId","name","memberDaemonIds","agentCount","spreadSessions"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/member-sets/{id}":{"patch":{"operationId":"renameMemberSet","summary":"Rename a member set","tags":["Member sets"],"description":"Change a member set’s display name. Membership and placements are untouched.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"memberDaemonIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"agentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spreadSessions":{"type":"boolean"}},"required":["setId","name","memberDaemonIds","agentCount","spreadSessions"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteMemberSet","summary":"Delete a member set","tags":["Member sets"],"description":"Delete an EMPTY member set. A set that still has members, or agents placed on it, returns 409 — dropping it would silently unplace them.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/member-sets/{id}/spread-sessions":{"put":{"operationId":"setMemberSetSpreadSessions","summary":"Spread sessions across a member set","tags":["Member sets"],"description":"Turn the set’s session spreading on or off. On, an agent placed on the set may run its isolated sessions — with its repositories, provider credentials and agent secrets — on members other than the one holding it, provided that machine’s owner has opted it in with `sandbox.share`. Off (the default), every session runs on its holder. Every member-set response carries the current value as `spreadSessions`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"memberDaemonIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"agentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spreadSessions":{"type":"boolean"}},"required":["setId","name","memberDaemonIds","agentCount","spreadSessions"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/member-sets/{id}/members/{daemonId}":{"put":{"operationId":"enrollDaemonInMemberSet","summary":"Enroll a daemon in a member set","tags":["Member sets"],"description":"Add one of the organization’s daemons to the set. Agents pinned to that machine stay pinned to it and keep running: a `daemon` placement is eligible for exactly that machine, so joining changes how it holds them (a duty lease) rather than who serves them. Refused (409) only if it is already in another set.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"daemonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"memberDaemonIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"agentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spreadSessions":{"type":"boolean"}},"required":["setId","name","memberDaemonIds","agentCount","spreadSessions"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"withdrawDaemonFromMemberSet","summary":"Withdraw a daemon from a member set","tags":["Member sets"],"description":"Remove one daemon from the set. Refused (409) while it still holds a live duty lease: drain it first (or wait for its leases to lapse, which is strictly later than its own self-fence) so it has provably stopped serving before the duties re-grant elsewhere. The set’s agents stay placed on the set and re-grant to its remaining members.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"daemonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"memberDaemonIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"agentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spreadSessions":{"type":"boolean"}},"required":["setId","name","memberDaemonIds","agentCount","spreadSessions"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/capabilities":{"get":{"operationId":"getAgentMemoryEntryCapabilities","summary":"Describe unified memory entry capabilities","tags":["Agents"],"description":"Reads current authorized provider capabilities through a daemon supporting memory-entries-v1.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"operations":{"type":"array","items":{"type":"string","enum":["list","get","search","create","update","delete","history"]}},"searchKind":{"type":"string","enum":["lexical","semantic","hybrid"]},"supportedScopes":{"type":"array","items":{"type":"string","enum":["agent","channel"]}},"writeConsistency":{"type":"string","enum":["conditional","last-write-wins"]},"exactEdit":{"type":"boolean"},"exactCreate":{"type":"boolean"},"enumeration":{"type":"string","enum":["snapshot","live","unavailable"]},"graph":{"type":"boolean"},"limits":{"type":"object","properties":{"maxMutationRequestBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"maxItemBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"maxPageItems":{"type":"integer","minimum":1,"maximum":100}},"required":["maxItemBytes","maxPageItems"],"additionalProperties":false}},"required":["version","operations","supportedScopes","writeConsistency","exactEdit","exactCreate","enumeration","graph","limits"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/entries":{"get":{"operationId":"listAgentMemoryEntries","summary":"List unified memory entries","tags":["Agents"],"description":"Returns bounded summaries and an opaque continuation. Partial pages do not imply absence.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"label":{"type":"string","maxLength":512},"description":{"type":"string","maxLength":1024},"format":{"type":"string","enum":["markdown","text"]},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revision":{"type":"string","maxLength":512},"origin":{"type":"string","enum":["active","inherited"]},"editable":{"type":"boolean"}},"required":["ref","label","format","byteSize","origin","editable"],"additionalProperties":false}},"nextCursor":{"type":"string","minLength":1,"maxLength":2048},"consistency":{"type":"string","enum":["snapshot","live"]},"order":{"type":"string","enum":["topic","backend"]},"catalogRevision":{"type":"string","maxLength":512}},"required":["entries","consistency","order"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createAgentMemoryEntry","summary":"Create a unified memory entry","tags":["Agents"],"description":"Applies a scoped conditional mutation through the serving daemon. JSON requests are bounded by capabilities.limits.maxMutationRequestBytes; oversized requests return 413. An ambiguous outcome must be reconciled by reading before retrying.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","maxLength":256000},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["text"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"state":{"type":"string","enum":["completed"]},"entry":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"label":{"type":"string","maxLength":512},"description":{"type":"string","maxLength":1024},"format":{"type":"string","enum":["markdown","text"]},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revision":{"type":"string","maxLength":512},"origin":{"type":"string","enum":["active","inherited"]},"editable":{"type":"boolean"}},"required":["ref","label","format","byteSize","origin","editable"],"additionalProperties":false},"deletedRef":{"type":"string","minLength":1,"maxLength":4096},"catalogRevision":{"type":"string","maxLength":512}},"required":["operationId","state"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateAgentMemoryEntry","summary":"Update a unified memory entry","tags":["Agents"],"description":"Applies a scoped conditional mutation through the serving daemon. JSON requests are bounded by capabilities.limits.maxMutationRequestBytes; oversized requests return 413. An ambiguous outcome must be reconciled by reading before retrying.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"revision":{"type":"string","minLength":1,"maxLength":512},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"text":{"type":"string","maxLength":256000}},"required":["ref","text"],"additionalProperties":false},{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"revision":{"type":"string","minLength":1,"maxLength":512},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"edit":{"type":"object","properties":{"oldText":{"type":"string","minLength":1,"maxLength":256000},"newText":{"type":"string","maxLength":256000}},"required":["oldText","newText"],"additionalProperties":false}},"required":["ref","edit"],"additionalProperties":false}]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"state":{"type":"string","enum":["completed"]},"entry":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"label":{"type":"string","maxLength":512},"description":{"type":"string","maxLength":1024},"format":{"type":"string","enum":["markdown","text"]},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revision":{"type":"string","maxLength":512},"origin":{"type":"string","enum":["active","inherited"]},"editable":{"type":"boolean"}},"required":["ref","label","format","byteSize","origin","editable"],"additionalProperties":false},"deletedRef":{"type":"string","minLength":1,"maxLength":4096},"catalogRevision":{"type":"string","maxLength":512}},"required":["operationId","state"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentMemoryEntry","summary":"Delete a unified memory entry","tags":["Agents"],"description":"Applies a scoped conditional mutation through the serving daemon. JSON requests are bounded by capabilities.limits.maxMutationRequestBytes; oversized requests return 413. An ambiguous outcome must be reconciled by reading before retrying.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"revision":{"type":"string","minLength":1,"maxLength":512}},"required":["ref"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"state":{"type":"string","enum":["completed"]},"entry":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"label":{"type":"string","maxLength":512},"description":{"type":"string","maxLength":1024},"format":{"type":"string","enum":["markdown","text"]},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revision":{"type":"string","maxLength":512},"origin":{"type":"string","enum":["active","inherited"]},"editable":{"type":"boolean"}},"required":["ref","label","format","byteSize","origin","editable"],"additionalProperties":false},"deletedRef":{"type":"string","minLength":1,"maxLength":4096},"catalogRevision":{"type":"string","maxLength":512}},"required":["operationId","state"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/entries/{ref}":{"get":{"operationId":"getAgentMemoryEntry","summary":"Read unified memory entry content","tags":["Agents"],"description":"Reads one bounded content slice by an opaque entry ref. Missing content returns null; changes between slices conflict.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false},{"schema":{"default":32768,"type":"integer","minimum":4,"maximum":32768},"in":"query","name":"maxBytes","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":4096},"in":"path","name":"ref","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"entry":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"label":{"type":"string","maxLength":512},"description":{"type":"string","maxLength":1024},"format":{"type":"string","enum":["markdown","text"]},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revision":{"type":"string","maxLength":512},"origin":{"type":"string","enum":["active","inherited"]},"editable":{"type":"boolean"}},"required":["ref","label","format","byteSize","origin","editable"],"additionalProperties":false},"text":{"type":"string"},"complete":{"type":"boolean"},"nextContentCursor":{"type":"string","minLength":1,"maxLength":2048},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"links":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":512},"ref":{"type":"string","minLength":1,"maxLength":4096},"exists":{"type":"boolean"}},"required":["label","exists"],"additionalProperties":false}},"backlinks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":512},"ref":{"type":"string","minLength":1,"maxLength":4096},"exists":{"type":"boolean"}},"required":["label","exists"],"additionalProperties":false}}},"required":["entry","text","complete"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/entries/{ref}/history":{"get":{"operationId":"listAgentMemoryEntryHistory","summary":"List unified memory entry history","tags":["Agents"],"description":"Returns one bounded page of change events for an entry, newest first where the home orders them, through a daemon supporting memory-entries-history-v1. A Control-Plane home pages its own change log back through the daemon.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false},{"schema":{"default":5,"type":"integer","minimum":1,"maximum":5},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":4096},"in":"path","name":"ref","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":512},"kind":{"type":"string","enum":["create","update","delete"]},"at":{"type":"string"},"source":{"type":"string","enum":["tool","console","distill","dream"]},"before":{"type":"string","maxLength":4001},"after":{"type":"string","maxLength":4001},"truncated":{"type":"boolean"}},"required":["kind"],"additionalProperties":false}},"nextCursor":{"type":"string","minLength":1,"maxLength":2048},"order":{"type":"string","enum":["newest-first","backend"]}},"required":["events","order"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/entries/search":{"post":{"operationId":"searchAgentMemoryEntries","summary":"Search unified memory entries","tags":["Agents"],"description":"Returns bounded hits with snippets for a query through a daemon supporting memory-entries-search-v1. The result names the search kind and coverage; it is never an enumeration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":2048},"limit":{"default":5,"type":"integer","minimum":1,"maximum":20}},"required":["query"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"hits":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":4096},"label":{"type":"string","maxLength":512},"description":{"type":"string","maxLength":1024},"format":{"type":"string","enum":["markdown","text"]},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revision":{"type":"string","maxLength":512},"origin":{"type":"string","enum":["active","inherited"]},"editable":{"type":"boolean"}},"required":["ref","label","format","byteSize","origin","editable"],"additionalProperties":false},"snippet":{"type":"string","maxLength":1024}},"required":["entry","snippet"],"additionalProperties":false}},"kind":{"type":"string","enum":["lexical","semantic","hybrid","unknown"]},"coverage":{"type":"string","enum":["complete","partial","unknown"]}},"required":["hits","kind","coverage"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"501":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"currentRevision":{"type":"string","maxLength":512}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents":{"post":{"operationId":"createAgent","summary":"Create an agent","tags":["Agents"],"description":"Mint a new agent definition scoped to the caller’s org; the CP assigns its UUID. With ?connect=true, also provisions a daemon connect token and start command for onboarding; a request authenticated by an API key cannot use it. A managed memory binding is stored with its resolved home: an agent placed on a group or the managed pool keeps its memory in the Control Plane (an explicit daemon home there is refused with 409); anywhere else the given home or daemon. `execution` names the strategy sessions run in and is checked against the strategies the placement reports: one it does not offer, or offers but cannot run now, is refused with 409 and the reason. The legacy `runInSandbox` maps to `host` or the placement’s sandbox, and a request naming both must agree (400). `repositorySelector` names the Decision provider and model the per-session repository selector asks; one that does not answer Choice questions is refused with 400.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":63,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"displayName":{"type":"string","minLength":1},"icon":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"]}]},"description":{"type":"string"},"runtime":{"type":"string","minLength":1},"model":{"type":"string"},"reasoningEffort":{"type":"string","minLength":1},"outputMode":{"type":"string","enum":["none","minimal","low","medium","high"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":"boolean"},"permissionMode":{"type":"string","minLength":1},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":"boolean"},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"env":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string","maxLength":65536}},"secrets":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string","maxLength":65536}},"mcpServers":{"type":"array","items":{"type":"string","minLength":1}},"skills":{"maxItems":64,"type":"array","items":{"type":"string","maxLength":193,"pattern":"^[A-Za-z0-9._-]+(\\/([a-z0-9](?:[a-z0-9._-]{0,126}[a-z0-9_])?|\\*))?$"}},"managedSkills":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},"repositorySelector":{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},"memory":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"type":"string","enum":["daemon","control-plane"]}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"additionalProperties":false}},"required":["provider","connectionId"],"additionalProperties":false}]},"placementKind":{"type":"string","enum":["daemon","pool","set"]},"daemonId":{"type":"string"},"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"gitRepo":{"type":"string","minLength":1,"maxLength":512},"gitBranch":{"type":"string","minLength":1},"agentDir":{"type":"string"},"worktree":{"type":"boolean"},"access":{"type":"string","enum":["read","write"]}},"required":["mode","gitRepo"],"additionalProperties":false}]},"capabilities":{"default":[],"type":"array","items":{"type":"string"}},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["name","runtime"]}}}},"parameters":[{"schema":{"type":"string"},"in":"query","name":"connect","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}},"connect":{"type":"object","properties":{"daemonId":{"type":"string"},"apiKey":{"type":"string"},"displayTail":{"type":"string"},"command":{"type":"string"}},"required":["daemonId","apiKey","displayTail","command"],"additionalProperties":false}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"get":{"operationId":"listAgents","summary":"List agents","tags":["Agents"],"description":"Every agent definition in the caller’s active org.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/agents/{id}":{"get":{"operationId":"getAgent","summary":"Get an agent","tags":["Agents"],"description":"Fetch one agent by id; a cross-org id reads as absent (404).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateAgent","summary":"Update an agent","tags":["Agents"],"description":"Edit the agent spec or widen an existing GitHub workspace from read to write access; the change hot-syncs the owning daemon’s replica and rides the next register/launch. A managed memory binding without a home keeps the current one. Switching the home from daemon to control-plane is accepted and flags a migration the owning daemon completes; the reverse is refused with 409 unless force is set, and then drops every memory file and change-log record the Control Plane holds for the agent. An agent placed on a group or the managed pool cannot name the daemon home. A new `execution` (or the legacy `runInSandbox`) is checked against the strategies the placement reports and refused with 409 when it cannot run there; it reaches only sessions created afterwards. `repositorySelector` names the Decision provider and model the per-session repository selector asks, must answer Choice questions (400 otherwise), and null clears it (409 while any repository authorization or installation grant is marked `decision`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"]}]},{"type":"null"}]},"description":{"type":["string","null"]},"runtime":{"type":"string","minLength":1},"capabilities":{"type":"array","items":{"type":"string"}},"model":{"type":["string","null"]},"reasoningEffort":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"outputMode":{"anyOf":[{"type":"string","enum":["none","minimal","low","medium","high"]},{"type":"null"}]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"gitAccess":{"type":"string","enum":["write"]},"agentDir":{"type":["string","null"]},"env":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string","maxLength":65536}},{"type":"null"}]},"secrets":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":65536},{"type":"null"}]}},"mcpServers":{"anyOf":[{"type":"array","items":{"type":"string","minLength":1}},{"type":"null"}]},"skills":{"anyOf":[{"maxItems":64,"type":"array","items":{"type":"string","maxLength":193,"pattern":"^[A-Za-z0-9._-]+(\\/([a-z0-9](?:[a-z0-9._-]{0,126}[a-z0-9_])?|\\*))?$"}},{"type":"null"}]},"managedSkills":{"anyOf":[{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"decisionIds":{"anyOf":[{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"type":"string","enum":["daemon","control-plane"]}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"additionalProperties":false}},"required":["provider","connectionId"],"additionalProperties":false}]},{"type":"null"}]},"force":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgent","summary":"Delete an agent","tags":["Agents"],"description":"Remove the agent definition and its hooks, then tell the owning daemon to drop it from its local replica (best-effort).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/decisions":{"get":{"operationId":"listAgentDecisions","summary":"List an agent’s attached Decisions","tags":["Agents"],"description":"Returns metadata for an agent’s MCP Decision attachments, or its model-selection binding when purpose=model_selection. Adding a binding requires access to the Decision; existing bindings remain usable independently of later sharing changes.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["model_selection"]},"in":"query","name":"purpose","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"questionType":{"type":"string","enum":["boolean","choice","score"]}},"required":["id","name","providerId","model","questionType"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/skill-sources":{"get":{"operationId":"listAgentSkillSources","summary":"List an agent’s enabled skill sources","tags":["Agents"],"description":"Resolve the agent’s skill enable-list (\"<source>/<skill>\" refs) into the registry rows it references. Gated on viewing the AGENT, not the source: a source restricted away from the caller still resolves, because its definition is part of what this agent installs. Refs to a source that no longer exists are omitted.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"ref":{"type":["string","null"]},"subDir":{"type":["string","null"]},"skills":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"}},"required":["id","name","source","ref","subDir","skills","private"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/permission-requests":{"get":{"operationId":"listAgentPermissionRequests","summary":"List agent approval requests","tags":["Agents"],"description":"Proxy the owning daemon’s bounded, secret-masked approval queue. Only callers who can edit the agent may read it; the Control Plane does not persist these requests.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sessionId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"requesterId":{"type":["string","null"]},"requesterName":{"type":["string","null"]},"command":{"type":"string","maxLength":240},"status":{"type":"string","enum":["pending","allowed","denied","expired"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolvedBy":{"type":["string","null"]},"resolvedByName":{"type":["string","null"]},"options":{"maxItems":25,"type":"array","items":{"type":"object","properties":{"optionId":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","maxLength":240},"kind":{"type":"string","enum":["allow_once","allow_always","reject_once","reject_always"]}},"required":["optionId","name","kind"],"additionalProperties":false}}},"required":["id","agentId","createdAt","requesterId","requesterName","command","status","resolvedAt"],"additionalProperties":false}}},"required":["requests"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/permission-requests/{requestId}/decision":{"post":{"operationId":"decideAgentPermissionRequest","summary":"Decide an agent approval request","tags":["Agents"],"description":"Allow or deny one pending runtime request on the owning daemon, optionally by one of the options it offers. Only callers who can edit the agent may decide it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["allow","deny"]},"optionId":{"type":"string","minLength":1,"maxLength":256}},"required":["decision"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"requestId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace":{"put":{"operationId":"setAgentWorkspace","summary":"Edit an agent workspace","tags":["Agent workspace"],"description":"Replace a workspace with scratch or a Git repository, or edit its repository, branch, working directory, and read/write access. Who vouches for the repository is derived from the address: a github.com repository covered by an App installation or a managed GitLab project earns managed credentials, a public repository on either host is cloned anonymously (read-only), and any other Git host is cloned anonymously with no preflight. A repository whose owner is covered but which the installation does not grant is refused, since an anonymous clone cannot serve it. An unstated access tier takes the highest the target can carry: write where credentials are minted for it, read for an anonymous checkout. Changing workspace type, repository, or branch discards daemon-local workspace files. The caller must hold the requested host permission. Active work is drained and repository credentials are invalidated before success. Enabled GitHub review or Check actions reject edits that remove their required write authority.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"gitRepo":{"type":"string","minLength":1,"maxLength":512},"gitBranch":{"type":"string","minLength":1},"agentDir":{"type":"string"},"worktree":{"type":"boolean"},"access":{"type":"string","enum":["read","write"]}},"required":["mode","gitRepo"],"additionalProperties":false}]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/daemon":{"put":{"operationId":"moveAgentDaemon","summary":"Move an agent to another daemon","tags":["Agents"],"description":"Hard-cut an agent over to another READY daemon. Active source turns are cancelled without a final reply, and subsequent messages start fresh on the target; force is an explicit disaster-recovery option when the source is unavailable. Daemon-local workspace, memory, and transcript data are not migrated or replayed; managed memory follows the agent only when its home is the Control Plane, and an agent whose memory home is the daemon is refused a move onto a group or the managed pool (409) until the home is switched — except an unplaced agent, which has no tree to lose and is switched to the Control Plane home in the move itself.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"placementKind":{"type":"string","enum":["daemon","pool","set"]},"daemonId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"force":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/sharing":{"put":{"operationId":"setAgentSharing","summary":"Set agent sharing","tags":["Agents"],"description":"Set an agent’s visibility (Everyone vs Selected) and complete Selected audience. Requires edit rights; Selected must retain at least one current organization member, and sharedWith is intersected with current membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string"}}},"required":["visibility"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/call-policy":{"put":{"operationId":"setAgentCallPolicy","summary":"Set directional agent visibility","tags":["Agents"],"description":"Set which peer agents may call this agent and which peers this agent may discover or call. Effective access requires both directions to allow it. Requires edit rights; allow-lists are intersected with visible same-org peer agents.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"default":[],"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["callPolicy"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"displayName":{"type":["string","null"]},"builtin":{"type":"boolean"},"icon":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},{"type":"null"}]},"iconUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"showFooter":{"type":"boolean"},"showStatusBar":{"type":"boolean"},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"allowRuntimeChangesInChat":{"type":"boolean"},"pause":{"type":["boolean","null"]},"env":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"secretKeys":{"type":"array","items":{"type":"string"}},"organizationVariables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"organizationSecretKeys":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"string"}},"managedSkills":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"decisionIds":{"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"modelSelection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"repositorySelector":{"anyOf":[{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["providerId","model"],"additionalProperties":false},{"type":"null"}]},"memory":{"anyOf":[{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["managed"]},"autoDistill":{"type":"boolean"},"dreaming":{"type":"object","properties":{"enabled":{"type":"boolean"},"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"schedule":{"type":"string","minLength":1,"maxLength":128},"timezone":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string","maxLength":4096},"mineSkills":{"type":"boolean"},"autoAdopt":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"scope":{"type":"string","enum":["agent","channel"]},"home":{"default":"daemon","type":"string","enum":["daemon","control-plane"]},"homeMigration":{"type":"string","enum":["pending"]}},"required":["provider","home"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["none","native"]},"autoDistill":{"type":"boolean"}},"required":["provider"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["external"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recall":{"default":{"mode":"auto","topK":5,"maxBytes":8192,"timeoutMs":3000},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","tool-only"]},"topK":{"default":5,"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"default":8192,"type":"integer","exclusiveMinimum":0,"maximum":32768},"timeoutMs":{"default":3000,"type":"integer","exclusiveMinimum":0,"maximum":10000}},"required":["mode","topK","maxBytes","timeoutMs"],"additionalProperties":false},"capture":{"default":{"mode":"manual"},"type":"object","properties":{"mode":{"default":"manual","type":"string","enum":["turn","manual"]}},"required":["mode"],"additionalProperties":false}},"required":["provider","connectionId","recall","capture"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string"},"placementKind":{"type":"string","enum":["daemon","set"]},"daemonId":{"type":["string","null"]},"daemonName":{"type":["string","null"]},"setId":{"type":["string","null"]},"placementReady":{"type":"boolean"},"holderDaemonId":{"type":["string","null"]},"workspace":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scratch"]}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["git"]},"worktree":{"type":"boolean"},"gitRepo":{"type":"string"},"gitBranch":{"type":"string"},"agentDir":{"type":"string"},"credential":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"access":{"type":"string","enum":["read","write"]}},"required":["provider","access"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"access":{"type":"string","enum":["read","write"]},"projectId":{"type":"string"}},"required":["provider","access","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"access":{"type":"string","enum":["read","write"]},"repoId":{"type":"string"}},"required":["provider","access","repoId"],"additionalProperties":false}]}},"required":["mode","worktree","gitRepo"],"additionalProperties":false}]},"workspaceRepoId":{"type":["string","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"callPolicy":{"type":"string","enum":["all","selected"]},"allowedCallerAgentIds":{"type":"array","items":{"type":"string"}},"outboundPolicy":{"type":"string","enum":["all","selected"]},"allowedTargetAgentIds":{"type":"array","items":{"type":"string"}},"introduceOnJoin":{"type":"boolean"},"runInSandbox":{"type":"boolean"},"execution":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},{"type":"null"}]},"strategies":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean","enum":[true]}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","enum":[false]},"reason":{"type":"string"}},"required":["available","reason"],"additionalProperties":false}]}},{"type":"null"}]},"sandboxSupported":{"type":"boolean"},"sandboxRequired":{"type":"boolean"},"sandboxUnavailable":{"type":["string","null"]},"hookKinds":{"type":"array","items":{"type":"string","enum":["webhook","github","gitlab","gitea"]}}},"required":["id","orgId","name","displayName","builtin","icon","iconUrl","description","runtime","model","reasoningEffort","outputMode","showFooter","showStatusBar","fastMode","permissionMode","allowRuntimeChangesInChat","pause","env","secretKeys","organizationVariables","organizationSecretKeys","mcpServers","skills","managedSkills","decisionIds","modelSelection","repositorySelector","memory","status","placementKind","daemonId","daemonName","setId","placementReady","workspace","workspaceRepoId","capabilities","createdAt","createdBy","lastModifiedAt","lastModifiedBy","visibility","sharedWith","canEdit","canManageSharing","callPolicy","allowedCallerAgentIds","outboundPolicy","allowedTargetAgentIds","introduceOnJoin","runInSandbox","execution","strategies","sandboxSupported","sandboxRequired","sandboxUnavailable","hookKinds"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/files":{"get":{"operationId":"listAgentWorkspaceFiles","summary":"List workspace files","tags":["Agent workspace"],"description":"Proxy one directory page live from the owning daemon. Pass sessionId to browse an authorized isolated session worktree; a missing directory is data (exists:false), not an error. 503 when unplaced or the daemon is offline. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"query","name":"path","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"exists":{"type":"boolean"},"entries":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["dir","file","symlink","other"]},"size":{"type":["number","null"]},"mtime":{"type":["string","null"]}},"required":["name","type","size","mtime"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["path","exists","entries","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/skills/local":{"get":{"operationId":"listAgentLocalSkills","summary":"List an agent’s local skills","tags":["Skill sources"],"description":"Proxy the skills the agent’s materialized workspace can load live from the owning daemon, each tagged by origin (dream-accepted, managed, git-source, or repo-committed). `materialized:false` means the workspace has not been prepared yet, so the empty list is \"unknown\", not \"no skills\". 503 when unplaced or the daemon is offline.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"materialized":{"type":"boolean"},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"origin":{"type":"string","enum":["dream-accepted","managed","git-source","repo"]},"path":{"type":"string"}},"required":["name","description","origin","path"],"additionalProperties":false}}},"required":["materialized","skills"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/commands":{"get":{"operationId":"listAgentRuntimeCommands","summary":"List an agent’s runtime slash commands","tags":["Skill sources"],"description":"Proxy the slash commands the agent’s ACP runtime last advertised (`available_commands_update`) live from the owning daemon — skills, plugin skills and the harness’s own built-ins in one list, each with the runtime’s description and optional argument hint. `reported:false` means no session has advertised a list yet, so the empty list is \"unknown\", not \"no commands\". 409 when the daemon predates this read, 503 when unplaced or offline.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"reported":{"type":"boolean"},"updatedAt":{"type":"string"},"sessionId":{"type":"string"},"commands":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"hint":{"type":["string","null"]},"skill":{"type":"boolean"}},"required":["name","description","hint"],"additionalProperties":false}}},"required":["reported","commands"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/file":{"get":{"operationId":"readAgentWorkspaceFile","summary":"Read a workspace file","tags":["Agent workspace"],"description":"Proxy one byte slice of a file live from the owning daemon (64 KiB default; page with offset while truncated). Pass sessionId to read an authorized isolated session worktree. A missing file is data (exists:false); binary files come back encoding:none. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"path","required":true},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":65536},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"exists":{"type":"boolean"},"type":{"anyOf":[{"type":"string","enum":["file","dir"]},{"type":"null"}]},"size":{"type":["number","null"]},"mtime":{"type":["string","null"]},"encoding":{"anyOf":[{"type":"string","enum":["utf8","none"]},{"type":"null"}]},"content":{"type":["string","null"]},"offset":{"type":["number","null"]},"nextOffset":{"type":["number","null"]},"truncated":{"type":["boolean","null"]}},"required":["path","exists","type","size","mtime","encoding","content","offset","nextOffset","truncated"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"putAgentWorkspaceFile","summary":"Create or replace a scratch workspace file","tags":["Agent workspace"],"description":"Atomically create or replace one UTF-8 file in a scratch workspace on the owning daemon. Requires edit access to the agent. Creation never overwrites an existing file; replacement requires the mtime returned by the last read. Conflicts return 409. GitHub workspaces remain read-only. The control plane stores no file content.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","maxLength":180000},"ifMatchMtime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["content"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":4096},"in":"query","name":"path","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"mtime":{"type":"string"}},"required":["path","size","mtime"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentWorkspaceFile","summary":"Delete a scratch workspace file","tags":["Agent workspace"],"description":"Delete one regular file from a scratch workspace on the owning daemon. Requires edit access and the mtime returned by the last read, so a newer agent revision is never removed silently. Conflicts return 409. GitHub workspaces remain read-only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":4096},"in":"query","name":"path","required":true},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"ifMatchMtime","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/wake":{"post":{"operationId":"wakeAgent","summary":"Wake the agent’s sandbox","tags":["Agents"],"description":"Ask the daemon serving this agent to bring its cluster sandbox to Running without starting a turn, so the workspace reads become available again. Pass sessionId to wake that isolated session’s own sandbox instead of the agent’s: it is only ever resumed onto the claim it already has, so a session whose sandbox was removed answers 404 with code WORKSPACE_SANDBOX_REMOVED (its next message creates a new one), and a daemon too old to wake one session wakes the agent’s sandbox as before. A sessionId the caller cannot browse reads 404. Answers with what the daemon observed: 202 with running (reachable now) or starting (resume in flight — poll the workspace read); 200 with unsupported when there is nothing to wake (a machine-placed agent, or a daemon that runs no sandboxes). Wakes are debounced per sandbox: one in flight is joined, and one settled within the last 30 s is answered from its result. For a pool agent nobody currently serves, the wake reaches a live member, which claims the agent the way a turn would. Requires edit access; 503 when no daemon can be reached.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["running","starting","unsupported"]}},"required":["state"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["running","starting","unsupported"]}},"required":["state"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory":{"get":{"operationId":"readAgentMemory","summary":"Read the agent memory index","tags":["Agents"],"description":"Proxy the agent's memory index (<agent-root>/memory/MEMORY.md) live from the owning daemon; a not-yet-created file is data (exists:false). 503 when unplaced or the daemon is offline. 503 also when the memory home of the agent is not reachable right now; `code` says why.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._-]+$"},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"path","required":false},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":65536},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"exists":{"type":"boolean"},"size":{"type":["number","null"]},"mtime":{"type":["string","null"]},"content":{"type":["string","null"]},"offset":{"type":["number","null"]},"nextOffset":{"type":["number","null"]},"truncated":{"type":["boolean","null"]}},"required":["path","exists","size","mtime","content","offset","nextOffset","truncated"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/files":{"get":{"operationId":"listAgentMemoryFiles","summary":"List agent memory files","tags":["Agents"],"description":"List the files in the agent's memory dir (MEMORY.md index + topic files) live from the owning daemon. 503 when unplaced or the daemon is offline. 503 also when the memory home of the agent is not reachable right now; `code` says why.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._-]+$"},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"exists":{"type":"boolean"},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"number"},"mtime":{"type":"string"}},"required":["name","size","mtime"],"additionalProperties":false}}},"required":["exists","files"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/channels":{"get":{"operationId":"listAgentMemoryChannels","summary":"List agent channel memory folders","tags":["Agents"],"description":"List the channels that have their own memory folder for a channel-scoped agent, live from the owning daemon (empty for agent-scoped agents). 503 when unplaced or the daemon is offline. 503 also when the memory home of the agent is not reachable right now; `code` says why.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"channelKey":{"type":"string"},"channel":{"type":["string","null"]},"transportScope":{"type":["string","null"]}},"required":["channelKey","channel","transportScope"],"additionalProperties":false}}},"required":["channels"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/file":{"get":{"operationId":"readAgentMemoryFile","summary":"Read a memory file","tags":["Agents"],"description":"Proxy one byte slice of a memory file (?path defaults to MEMORY.md) live from the owning daemon; a missing file is data (exists:false). 503 when unplaced or the daemon is offline. 503 also when the memory home of the agent is not reachable right now; `code` says why.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._-]+$"},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"path","required":false},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":65536},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"exists":{"type":"boolean"},"size":{"type":["number","null"]},"mtime":{"type":["string","null"]},"content":{"type":["string","null"]},"offset":{"type":["number","null"]},"nextOffset":{"type":["number","null"]},"truncated":{"type":["boolean","null"]}},"required":["path","exists","size","mtime","content","offset","nextOffset","truncated"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"putAgentMemoryFile","summary":"Replace a memory file","tags":["Agents"],"description":"Replace one memory file (?path defaults to MEMORY.md) on the owning daemon; returns the written size/mtime. `ifMatchMtime` (optional) is optimistic concurrency — a 409 if the file changed under you. Requires edit permission. 503 when unplaced or the daemon is offline. 503 also when the memory home of the agent is not reachable right now; `code` says why.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"},"ifMatchMtime":{"type":"string"}},"required":["content"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._-]+$"},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"path","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"size":{"type":"number"},"mtime":{"type":"string"}},"required":["path","size","mtime"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/history":{"get":{"operationId":"listAgentMemoryFileHistory","summary":"List memory file history","tags":["Agents"],"description":"Return one newest-first page of add/update/delete provenance for a managed memory file. For a memory home on the daemon the page is proxied live from the owning daemon and not persisted here; for a home in the Control Plane it is answered from the change log the Control Plane keeps, with no daemon involved. 503 when unplaced, the daemon is offline, or the memory home of the agent is not reachable right now; `code` says why.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._-]+$"},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"query","name":"path","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":5},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"type":"string","minLength":1,"maxLength":255},"event":{"type":"string","enum":["add","update","delete"]},"before":{"type":"string","maxLength":4001},"after":{"type":"string","maxLength":4001},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"scope":{"type":"string","enum":["agent"]},"source":{"type":"string","enum":["tool","console","distill","dream"]},"truncated":{"type":"boolean"}},"required":["path","event","after","at","scope","source"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/surface":{"get":{"operationId":"getAgentMemorySurface","summary":"Get the agent memory administration surface","tags":["Agents"],"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"shape":{"type":"string","enum":["files","records","none"]},"capabilities":{"type":"array","items":{"type":"string","enum":["recall","capture","list","get","create","update","delete","history"]}}},"required":["shape","capabilities"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/records/search":{"post":{"operationId":"searchAgentMemoryRecords","summary":"Search external-memory records","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":32768},"topK":{"type":"integer","exclusiveMinimum":0,"maximum":20},"maxBytes":{"type":"integer","exclusiveMinimum":0,"maximum":32768}},"required":["query"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","minLength":1},"score":{"type":"number"},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","user","session","shared"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","key"],"additionalProperties":false},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"provenance":{"type":"object","properties":{"pluginId":{"type":"string","minLength":1,"maxLength":255},"backendId":{"type":"string","minLength":1,"maxLength":512}},"required":["pluginId"],"additionalProperties":false},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["id","text","scope"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["records","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/records":{"get":{"operationId":"listAgentMemoryRecords","summary":"List external-memory records","tags":["Agents"],"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","minLength":1},"score":{"type":"number"},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","user","session","shared"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","key"],"additionalProperties":false},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"provenance":{"type":"object","properties":{"pluginId":{"type":"string","minLength":1,"maxLength":255},"backendId":{"type":"string","minLength":1,"maxLength":512}},"required":["pluginId"],"additionalProperties":false},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["id","text","scope"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["records","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createAgentMemoryRecord","summary":"Create an external-memory record","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":131072},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["text"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","minLength":1},"score":{"type":"number"},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","user","session","shared"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","key"],"additionalProperties":false},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"provenance":{"type":"object","properties":{"pluginId":{"type":"string","minLength":1,"maxLength":255},"backendId":{"type":"string","minLength":1,"maxLength":512}},"required":["pluginId"],"additionalProperties":false},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["id","text","scope"],"additionalProperties":false}},"required":["record"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/records/{recordId}":{"get":{"operationId":"getAgentMemoryRecord","summary":"Get an external-memory record","tags":["Agents"],"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"recordId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","minLength":1},"score":{"type":"number"},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","user","session","shared"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","key"],"additionalProperties":false},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"provenance":{"type":"object","properties":{"pluginId":{"type":"string","minLength":1,"maxLength":255},"backendId":{"type":"string","minLength":1,"maxLength":512}},"required":["pluginId"],"additionalProperties":false},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["id","text","scope"],"additionalProperties":false},{"type":"null"}]}},"required":["record"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"updateAgentMemoryRecord","summary":"Update an external-memory record","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":131072},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["text"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"recordId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","minLength":1},"score":{"type":"number"},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","user","session","shared"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","key"],"additionalProperties":false},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"provenance":{"type":"object","properties":{"pluginId":{"type":"string","minLength":1,"maxLength":255},"backendId":{"type":"string","minLength":1,"maxLength":512}},"required":["pluginId"],"additionalProperties":false},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["id","text","scope"],"additionalProperties":false}},"required":["record"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentMemoryRecord","summary":"Delete an external-memory record","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","minLength":1,"maxLength":512}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"recordId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/records/{recordId}/history":{"get":{"operationId":"listAgentMemoryRecordHistory","summary":"List external-memory record history","tags":["Agents"],"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"recordId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"event":{"type":"string","enum":["create","update","delete"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"record":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":512},"text":{"type":"string","minLength":1},"score":{"type":"number"},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","user","session","shared"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["kind","key"],"additionalProperties":false},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"provenance":{"type":"object","properties":{"pluginId":{"type":"string","minLength":1,"maxLength":255},"backendId":{"type":"string","minLength":1,"maxLength":512}},"required":["pluginId"],"additionalProperties":false},"version":{"type":"string","minLength":1,"maxLength":512}},"required":["id","text","scope"],"additionalProperties":false}},"required":["id","event","at"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams":{"post":{"operationId":"startAgentMemoryDream","summary":"Start a memory dream","tags":["Agents"],"description":"Kick off an offline consolidation job over the managed store on the owning daemon. Returns the pending job; poll it for status. 400 if dreaming is not enabled, 409 if one is already in flight, 503 when the daemon is offline.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionWindow":{"type":"integer","minimum":1,"maximum":100},"instructions":{"type":"string","maxLength":4096}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"get":{"operationId":"listAgentMemoryDreams","summary":"List memory dreams","tags":["Agents"],"description":"List the agent's memory dream jobs (newest first), proxied from the owning daemon. 409 when the owning daemon is too old to support dreaming (code DAEMON_FEATURE_MISSING).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"boolean"},"in":"query","name":"pendingSkills","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreams":{"type":"array","items":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}},"required":["dreams"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}":{"get":{"operationId":"getAgentMemoryDream","summary":"Get a memory dream","tags":["Agents"],"description":"Fetch one dream job's metadata (never staged bodies), proxied from the owning daemon. 409 when the owning daemon is too old to support dreaming (code DAEMON_FEATURE_MISSING).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/cancel":{"post":{"operationId":"cancelAgentMemoryDream","summary":"Cancel a memory dream","tags":["Agents"],"description":"Cancel a pending or running dream on the owning daemon (cancel-wins; a late extraction result is never staged). 409 if the dream is already terminal.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/adopt":{"post":{"operationId":"adoptAgentMemoryDream","summary":"Adopt a memory dream","tags":["Agents"],"description":"Atomically replace the agent's live managed store with this dream's staged output (with a backup). Fenced against changes since the snapshot unless `force` is set. 409 on a fence conflict or a non-completed dream.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean"},"reviewToken":{"type":"string"}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/discard":{"post":{"operationId":"discardAgentMemoryDream","summary":"Discard a memory dream","tags":["Agents"],"description":"Delete a terminal dream's staged output on the owning daemon, keeping the job record for history. 409 if the dream is not in a terminal state.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/skills/{name}":{"get":{"operationId":"readAgentMemoryDreamSkill","summary":"Read a mined skill candidate","tags":["Agents"],"description":"Proxy the staged SKILL.md and every staged script for one candidate live from the owning daemon, so the reviewer can read exactly what accepting would install. Nothing staged under that name is data (exists:false), not an error.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,62}$"},"in":"path","name":"name","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"exists":{"type":"boolean"},"skill":{"type":["string","null"]},"scripts":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"content":{"type":"string"}},"required":["path","content"],"additionalProperties":false}},"reviewToken":{"type":"string"}},"required":["name","exists","skill","scripts"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/skills/{name}/accept":{"post":{"operationId":"acceptAgentMemoryDreamSkill","summary":"Accept a mined skill","tags":["Agents"],"description":"Install one of this dream's mined skill candidates for the agent. Copies the reviewed skill into the agent's own tree, so discarding the dream later does not uninstall it. 409 if the candidate was already dismissed or the daemon predates dreaming.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewToken":{"type":"string"}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,62}$"},"in":"path","name":"name","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/skills/{name}/dismiss":{"post":{"operationId":"dismissAgentMemoryDreamSkill","summary":"Dismiss a mined skill","tags":["Agents"],"description":"Reject one of this dream's mined skill candidates. Its staging is dropped and the decision recorded, so later dreams are told not to propose it again. 409 if it was already accepted.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,62}$"},"in":"path","name":"name","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dreamId":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","canceled","adopted","discarded","superseded"]},"trigger":{"type":"string","enum":["manual","schedule","auto"]},"sessionIds":{"type":"array","items":{"type":"string"}},"snapshotDigest":{"type":"string"},"executionSessionId":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"stopReason":{"type":["string","null"]},"instructions":{"type":["string","null"]},"skills":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"state":{"type":"string","enum":["proposed","accepted","dismissed"]}},"required":["name","description","state"],"additionalProperties":false}},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"},"inputBytes":{"type":"number"},"outputBytes":{"type":"number"}},"required":["inputBytes","outputBytes"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["dreamId","agentId","status","trigger","sessionIds","snapshotDigest","executionSessionId","runtime","model","stopReason","instructions","skills","usage","error","createdAt","endedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/files":{"get":{"operationId":"listAgentMemoryDreamFiles","summary":"List a dream's staged files","tags":["Agents"],"description":"List the files in this dream's staged output store (index + topics). Nothing staged yet is data (exists:false), not an error.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"exists":{"type":"boolean"},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"number"},"mtime":{"type":"string"}},"required":["name","size","mtime"],"additionalProperties":false}},"reviewToken":{"type":"string"}},"required":["exists","files"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/memory/dreams/{dreamId}/file":{"get":{"operationId":"readAgentMemoryDreamFile","summary":"Read a dream's staged file","tags":["Agents"],"description":"Proxy one byte slice of a staged output file (default the MEMORY.md index) live from the owning daemon. `nextOffset` is authoritative — clients must not recompute it.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._-]+$"},"in":"query","name":"channelKey","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"path","required":false},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":65536},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"path","name":"dreamId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"exists":{"type":"boolean"},"size":{"type":["number","null"]},"mtime":{"type":["string","null"]},"content":{"type":["string","null"]},"offset":{"type":["number","null"]},"nextOffset":{"type":["number","null"]},"truncated":{"type":["boolean","null"]}},"required":["path","exists","size","mtime","content","offset","nextOffset","truncated"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitstatus":{"get":{"operationId":"getAgentWorkspaceGitStatus","summary":"Get workspace git status","tags":["Agent workspace"],"description":"Report whether the owning daemon’s checkout is clean. Pass sessionId for an authorized isolated session worktree; a dirty tree or a from-scratch (non-repo) workspace is data (clean/isRepo), not an error. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"clean":{"type":"boolean"},"repo":{"type":["string","null"]},"agentDir":{"type":["string","null"]},"branch":{"type":["string","null"]},"tracking":{"type":["string","null"]},"ahead":{"type":["number","null"]},"behind":{"type":["number","null"]},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"index":{"type":"string"},"workingDir":{"type":"string"},"additions":{"type":["number","null"]},"deletions":{"type":["number","null"]}},"required":["path","index","workingDir","additions","deletions"],"additionalProperties":false}},"truncated":{"type":"boolean"},"lastCommit":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string"},"shortSha":{"type":"string"},"subject":{"type":"string"},"committedAt":{"type":"string"}},"required":["sha","shortSha","subject","committedAt"],"additionalProperties":false},{"type":"null"}]},"lastFetchAt":{"type":["string","null"]}},"required":["isRepo","clean","repo","agentDir","branch","tracking","ahead","behind","files","truncated","lastCommit","lastFetchAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitdiff":{"get":{"operationId":"getAgentWorkspaceGitDiff","summary":"Get a workspace file diff","tags":["Agent workspace"],"description":"Proxy the unified diff of one workspace path live from the owning daemon. `scope=staged` compares the index against HEAD; the default `unstaged` compares the worktree against the index. Pass sessionId for an authorized isolated session worktree. A binary change (binary:true), a path with no changes (diff:null) and a from-scratch workspace (isRepo:false) are all data, not errors; the daemon bounds the text to the wire frame cap and reports truncated. 503 when unplaced or the daemon is offline. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string","minLength":1,"maxLength":4096},"in":"query","name":"path","required":true},{"schema":{"default":"unstaged","type":"string","enum":["unstaged","staged"]},"in":"query","name":"scope","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"isRepo":{"type":"boolean"},"exists":{"type":"boolean"},"diff":{"type":["string","null"]},"binary":{"type":"boolean"},"truncated":{"type":"boolean"}},"required":["path","isRepo","exists","diff","binary","truncated"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitlog":{"get":{"operationId":"listAgentWorkspaceGitLog","summary":"List workspace commits","tags":["Agent workspace"],"description":"Proxy the newest commits of the owning daemon’s checked-out branch (20 by default, 50 max), newest first. Pass sessionId for an authorized isolated session worktree. Each commit is marked pushed when the branch’s upstream ref already contains it; tracking:null means the branch tracks nothing, so pushed reads false throughout. An empty repo (commits: []) and a from-scratch workspace (isRepo:false) are data, not errors. 503 when unplaced or the daemon is offline. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"commits":{"type":"array","items":{"type":"object","properties":{"sha":{"type":"string"},"shortSha":{"type":"string"},"subject":{"type":"string"},"author":{"type":"string"},"committedAt":{"type":"string"},"pushed":{"type":"boolean"}},"required":["sha","shortSha","subject","author","committedAt","pushed"],"additionalProperties":false}},"truncated":{"type":"boolean"},"tracking":{"type":["string","null"]},"base":{"type":["string","null"]}},"required":["isRepo","commits","truncated","tracking","base"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitpull":{"post":{"operationId":"pullAgentWorkspace","summary":"Sync the workspace","tags":["Agent workspace"],"description":"Sync the checkout to its configured remote branch on the owning daemon: fetch, point the local branch at the remote tip and check it out, carrying uncommitted edits and never merging. A refused sync (a local commit the remote lacks, an edit it would rewrite) is data (ok:false + detail); 409 when the agent is working in the checkout, 503 only when the daemon is offline. Pass repo to sync one of the agent’s authorized additional repositories instead of its primary workspace.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"ok":{"type":"boolean"},"detail":{"type":["string","null"]},"changed":{"type":["number","null"]},"insertions":{"type":["number","null"]},"deletions":{"type":["number","null"]}},"required":["isRepo","ok","detail","changed","insertions","deletions"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitstage":{"post":{"operationId":"stageAgentWorkspacePaths","summary":"Stage workspace paths","tags":["Agent workspace"],"description":"Stage the named paths in the owning daemon’s checkout, or in an authorized isolated session worktree when sessionId is given. Requires edit access to the agent. Answers with the FRESH git status, so the console never re-polls for the result of its own action. An empty list, a path the checkout does not currently report as changed and a from-scratch workspace (isRepo:false) are all data, not errors; 409 when the agent is busy in its workspace, 503 when unplaced or the daemon is offline. The control plane executes no git and stores no workspace state. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paths":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":4096}}},"required":["paths"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"clean":{"type":"boolean"},"repo":{"type":["string","null"]},"agentDir":{"type":["string","null"]},"branch":{"type":["string","null"]},"tracking":{"type":["string","null"]},"ahead":{"type":["number","null"]},"behind":{"type":["number","null"]},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"index":{"type":"string"},"workingDir":{"type":"string"},"additions":{"type":["number","null"]},"deletions":{"type":["number","null"]}},"required":["path","index","workingDir","additions","deletions"],"additionalProperties":false}},"truncated":{"type":"boolean"},"lastCommit":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string"},"shortSha":{"type":"string"},"subject":{"type":"string"},"committedAt":{"type":"string"}},"required":["sha","shortSha","subject","committedAt"],"additionalProperties":false},{"type":"null"}]},"lastFetchAt":{"type":["string","null"]}},"required":["isRepo","clean","repo","agentDir","branch","tracking","ahead","behind","files","truncated","lastCommit","lastFetchAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitunstage":{"post":{"operationId":"unstageAgentWorkspacePaths","summary":"Unstage workspace paths","tags":["Agent workspace"],"description":"Remove the named paths from the index of the owning daemon’s checkout, or of an authorized isolated session worktree when sessionId is given. Requires edit access to the agent. Answers with the FRESH git status. The working tree is never touched, so nothing the agent wrote is lost; an empty list, a path that is not staged and a from-scratch workspace (isRepo:false) are all data. 409 when the agent is busy in its workspace, 503 when unplaced or the daemon is offline. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paths":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":4096}}},"required":["paths"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"clean":{"type":"boolean"},"repo":{"type":["string","null"]},"agentDir":{"type":["string","null"]},"branch":{"type":["string","null"]},"tracking":{"type":["string","null"]},"ahead":{"type":["number","null"]},"behind":{"type":["number","null"]},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"index":{"type":"string"},"workingDir":{"type":"string"},"additions":{"type":["number","null"]},"deletions":{"type":["number","null"]}},"required":["path","index","workingDir","additions","deletions"],"additionalProperties":false}},"truncated":{"type":"boolean"},"lastCommit":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string"},"shortSha":{"type":"string"},"subject":{"type":"string"},"committedAt":{"type":"string"}},"required":["sha","shortSha","subject","committedAt"],"additionalProperties":false},{"type":"null"}]},"lastFetchAt":{"type":["string","null"]}},"required":["isRepo","clean","repo","agentDir","branch","tracking","ahead","behind","files","truncated","lastCommit","lastFetchAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitcommit":{"post":{"operationId":"commitAgentWorkspace","summary":"Commit the staged workspace changes","tags":["Agent workspace"],"description":"Commit whatever is staged in the owning daemon’s checkout, or in an authorized isolated session worktree when sessionId is given. Requires edit access to the agent. The commit is attributed to the identity the daemon registered at handshake, never to the console user. Nothing staged, a blank message, a daemon with no registered identity and a git refusal all come back as ok:false with a machine `reason`, not an HTTP error; 409 when the agent is busy in its workspace, 503 when unplaced or the daemon is offline. The control plane forwards the message and stores neither it nor the diff. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":8000}},"required":["message"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"ok":{"type":"boolean"},"sha":{"type":["string","null"]},"detail":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["not-a-repo","nothing-staged","empty-message","no-identity","detached-head","no-upstream","unsafe-origin","unsafe-config","diverged","rejected","failed"]},{"type":"null"}]}},"required":["isRepo","ok","sha","detail","reason"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitpush":{"post":{"operationId":"pushAgentWorkspace","summary":"Push the workspace branch","tags":["Agent workspace"],"description":"Push the branch checked out in the owning daemon’s workspace, or in an authorized isolated session worktree when sessionId is given, to the remote that daemon authorizes. Requires edit access to the agent. The daemon derives the refspec and never forces: a diverged branch (reason diverged), a detached HEAD (detached-head), a branch tracking nothing (no-upstream) and a remote rejection (rejected) are all ok:false data, and a push with nothing to send is ok:true with ahead:0. 409 when the agent is busy in its workspace, 503 when unplaced or the daemon is offline. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"isRepo":{"type":"boolean"},"ok":{"type":"boolean"},"detail":{"type":["string","null"]},"ahead":{"type":["number","null"]},"reason":{"anyOf":[{"type":"string","enum":["not-a-repo","nothing-staged","empty-message","no-identity","detached-head","no-upstream","unsafe-origin","unsafe-config","diverged","rejected","failed"]},{"type":"null"}]}},"required":["isRepo","ok","detail","ahead","reason"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/workspace/gitmessage":{"post":{"operationId":"draftAgentWorkspaceCommitMessage","summary":"Draft a commit message from the staged diff","tags":["Agent workspace"],"description":"Ask the owning daemon to draft a conventional-commit message from the staged diff of its checkout, or of an authorized isolated session worktree when sessionId is given. The model pass runs on the daemon against the agent’s own runtime — the control plane never calls a model provider, and stores neither the diff nor the message. Requires edit access to the agent, because it spends the agent’s model budget. Nothing staged, a runtime that declines or answers with prose, and a timeout are all ok:false with a detail to render; 503 when unplaced or the daemon is offline. This writes nothing: the reader edits the draft and commits it separately. Pass repo (owner/repo) to address one of the agent’s authorized additional repositories instead of its primary workspace; an unauthorized name reads 404, and a daemon too old to scope by repository yields 409.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"repo","required":false},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":["string","null"]},"detail":{"type":["string","null"]}},"required":["ok","message","detail"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/tasks":{"get":{"operationId":"listAgentSessionTasks","summary":"List a session’s background tasks","tags":["Agents"],"description":"Proxy the background tasks of ONE of the agent’s ACP sessions live from the owning daemon, live ones first and then the daemon’s bounded settled history. sessionId is REQUIRED, unlike the workspace reads: the daemon tracks tasks per (agent, ACP session) and has no per-agent aggregate to answer with. Both the session’s own visibility rule and the agent’s apply, so a session the caller cannot see reads as absent (404) — but the session’s workspace isolation does not, because tasks are not a checkout. tracked:false means the daemon holds no tracking for that session (a runtime that reports no task lifecycle, or one that has not yet), which is data and different from an empty list; a settled task stays listed for a bounded while with its outcome. There is no cancel counterpart: no agent-protocol primitive can address a single background task, so the escape hatch is cancelling the turn. 409 when the daemon is too old to report tasks, 503 when the agent is unplaced or its daemon is offline. The control plane persists none of this.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1},"in":"query","name":"sessionId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"tracked":{"type":"boolean"},"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":["string","null"]},"state":{"type":"string","enum":["running","done","failed"]},"subagent":{"type":"boolean"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"detail":{"type":["string","null"]}},"required":["id","description","state","subagent","startedAt","endedAt","detail"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["sessionId","tracked","tasks","truncated"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/repos":{"get":{"operationId":"listAgentRepoAuthorizations","summary":"List an agent’s repository authorizations","tags":["Agents"],"description":"Explicit code-host repository grants for this agent, each with its access tier and `materialize` choice (`always` clones it as a secondary workspace root, `on-demand` grants credentials only). An App-backed workspace repo is implicit and not listed; scratch workspaces may grant any covered repository, while a manual GitHub workspace may explicitly grant only its own repo for review/check effects. Gated by the agent’s visibility.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"repoFullName":{"type":"string"},"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["always","decision","on-demand"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","repoId","repoFullName","access","materialize","createdBy","createdAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createAgentRepoAuthorization","summary":"Authorize a repository for an agent","tags":["Agents"],"description":"Grant the agent access to one code-host repository. With `provider: github` (the default) the repository is named `owner/repo` and must be covered by one of the organization’s GitHub App installations; App-backed workspaces may add repositories beyond their implicit workspace grant, scratch workspaces may add any covered repository, and a manual GitHub workspace may explicitly authorize only its own repository for control-plane review/check effects. With the per-user gate configured, the caller must hold the matching GitHub permission (`read`/`comment` tiers need read, `write` needs write). With `provider: gitlab` the project is named by its numeric id and must already be a managed GitLab project in this organization; authorizing it provisions the agent’s own GitLab bot account and project membership before the grant lands. With `provider: gitea` the repository is named by its numeric id and must already be a managed Gitea repository in this organization; the organization’s bot token serves every tier, so the tier is a clamp on what the agent may do, never a provider role. `materialize` chooses how sessions stand in the repository: `always` (the default) clones it as a secondary workspace root on every session, `on-demand` grants credentials only and the agent clones during the turn, and `decision` makes it a candidate the per-session repository selector may check out. `decision` needs the agent’s `repositorySelector` (409 `REPOSITORY_SELECTOR_MISSING` otherwise) and daemons serving the agent that advertise `repo-selector-v1` (409 `DAEMON_FEATURE_MISSING` otherwise).","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab"]},"projectId":{"type":"string","pattern":"^[1-9]\\d*$"},"access":{"default":"read","type":"string","enum":["read","comment","write"]},"materialize":{"default":"always","type":"string","enum":["always","decision","on-demand"]}},"required":["provider","projectId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"type":"string","enum":["gitea"]},"repoId":{"type":"string","pattern":"^[1-9]\\d*$"},"access":{"default":"read","type":"string","enum":["read","comment","write"]},"materialize":{"default":"always","type":"string","enum":["always","decision","on-demand"]}},"required":["provider","repoId"],"additionalProperties":false},{"type":"object","properties":{"provider":{"default":"github","type":"string","enum":["github"]},"repoFullName":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"},"access":{"default":"read","type":"string","enum":["read","comment","write"]},"materialize":{"default":"always","type":"string","enum":["always","decision","on-demand"]}},"required":["repoFullName"],"additionalProperties":false}]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"repoFullName":{"type":"string"},"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["always","decision","on-demand"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","repoId","repoFullName","access","materialize","createdBy","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/repos/{repoAuthId}":{"patch":{"operationId":"updateAgentRepoAuthorization","summary":"Update a repository authorization","tags":["Agents"],"description":"Raise an existing repository grant to a stronger access tier after re-checking the caller’s matching GitHub permission, change how the repository is materialized (`materialize`: `always`, `decision` or `on-demand`; `decision` needs the agent’s `repositorySelector` and daemons serving the agent that advertise `repo-selector-v1`, else 409 with `REPOSITORY_SELECTOR_MISSING` or `DAEMON_FEATURE_MISSING`), or both. At least one field is required. Downgrades still require revoke and reauthorize so review-check cleanup remains explicit; `materialize` moves freely and re-projects the agent’s spec.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["always","decision","on-demand"]}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string"},"in":"path","name":"repoAuthId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"repoFullName":{"type":"string"},"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["always","decision","on-demand"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","repoId","repoFullName","access","materialize","createdBy","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentRepoAuthorization","summary":"Revoke a repository authorization","tags":["Agents"],"description":"Atomically retire existing informational Checks to a non-passing cleanup state and remove the grant. A legacy grant that resolves to the still-authorized workspace repository is removed without retiring its Checks. Already-minted tokens live out their ≤1h expiry (the documented revocation window); the next credential request for a genuinely additional repo is denied.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string"},"in":"path","name":"repoAuthId","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/installations":{"get":{"operationId":"listAgentInstallationAuthorizations","summary":"List an agent’s installation grants","tags":["Agents"],"description":"Installation grants on this agent: each authorizes every repository one of the organization’s GitHub App installations covers, including repositories created later, at one access tier. A grant is never expanded into repository authorizations; `materialize` is `on-demand` (credentials only) or `decision`. Gated by the agent’s visibility.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github"]},"installationId":{"type":"number"},"accountLogin":{"type":"string"},"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["decision","on-demand"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","installationId","accountLogin","access","materialize","createdBy","createdAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createAgentInstallationAuthorization","summary":"Authorize an installation for an agent","tags":["Agents"],"description":"Grant the agent every repository a live, unsuspended GitHub App installation claimed by this organization covers, at one tier (`read` by default); an explicit repository authorization on a covered repository keeps its own tier. Only an organization owner may do this, and no per-repository permission check runs. `materialize` defaults to `on-demand`; `decision` feeds the installation’s repositories to the per-session repository selector and needs the agent’s `repositorySelector` and daemons serving the agent that advertise `repo-selector-v1` (409 `REPOSITORY_SELECTOR_MISSING` or `DAEMON_FEATURE_MISSING` otherwise), and `always` is never accepted. An agent holds at most one grant per installation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"access":{"default":"read","type":"string","enum":["read","comment","write"]},"materialize":{"default":"on-demand","type":"string","enum":["decision","on-demand"]}},"required":["installationId"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github"]},"installationId":{"type":"number"},"accountLogin":{"type":"string"},"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["decision","on-demand"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","installationId","accountLogin","access","materialize","createdBy","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/installations/{id}":{"patch":{"operationId":"updateAgentInstallationAuthorization","summary":"Update an installation grant","tags":["Agents"],"description":"Raise an installation grant to a stronger access tier, change how its repositories are materialized (`on-demand` or `decision`; `decision` has the same preconditions as on create, 409 otherwise), or both. At least one field is required. Lowering the tier requires revoking and granting again. Organization owners only; the change re-projects the agent’s spec.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["decision","on-demand"]}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github"]},"installationId":{"type":"number"},"accountLogin":{"type":"string"},"access":{"type":"string","enum":["read","comment","write"]},"materialize":{"type":"string","enum":["decision","on-demand"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","installationId","accountLogin","access","materialize","createdBy","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentInstallationAuthorization","summary":"Revoke an installation grant","tags":["Agents"],"description":"Remove the grant. Repositories it alone covered are denied on their next credential request; already-minted tokens live out their expiry of at most one hour. Refused while an installation-wide trigger of the agent watches the installation. Organization owners only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/webchat/token":{"post":{"operationId":"mintWebchatToken","summary":"Mint a webchat token","tags":["Agents"],"description":"Mints a short-lived token the browser presents to the relay pool to start or resume a playground webchat session with this agent. A resume is allowed for the conversation owner, and for any non-viewer member who may continue every session it currently stands on (org-visible sessions; private ones stay owner-only). A resume answers 409 once an agent’s next turn would reach a machine that does not hold its session. An API key whose permission is `agent:chat` may call this route for the agents in its selection; the token it mints carries that permission and is accepted by the relay’s agent chat API only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"relayUrl":{"type":"string"},"conversationId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["token","relayUrl","conversationId","expiresAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{sessionId}/webchat/token":{"post":{"operationId":"mintWebchatSessionToken","summary":"Mint a session-continuation webchat token","tags":["Sessions"],"description":"Mints a short-lived token the browser presents to the relay pool to continue an existing session from the console composer — a chat thread (the human turn is mirrored back to it) or a hook-origin session such as a GitHub or GitLab event, whose only surface is the console. Requires continuation authorization, un-purged content, a daemon that can still serve the session content (its recorder, or a live member of the shared store it was written to), and continuation-capable daemon and relay pool.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string"},"in":"path","name":"sessionId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"relayUrl":{"type":"string"},"conversationId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["token","relayUrl","conversationId","expiresAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/webchat/conversations/token":{"post":{"operationId":"mintWebchatConversationToken","summary":"Mint a conversation webchat token","tags":["Agents"],"description":"Mints a short-lived token the browser presents to the relay pool. Pass `agentIds` (first entry is the primary) to create a conversation — the roster is fixed at creation — or `conversationId` to resume one — as its owner, or as any non-viewer member who may continue every session it currently stands on (org-visible sessions; private ones stay owner-only). A resume answers 409 once an agent’s next turn would reach a machine that does not hold its session. Creating with more than one agent requires every selected agent to be placed on a daemon that supports multi-agent webchat.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"agentIds":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"relayUrl":{"type":"string"},"conversationId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["token","relayUrl","conversationId","expiresAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/webchat/conversations/{conversationId}/agents":{"post":{"operationId":"addWebchatConversationAgent","summary":"Add an agent to a webchat conversation","tags":["Agents"],"description":"Adds a participant agent to a conversation owned by the authenticated user (mid-conversation join). The agent must be viewable and placed on a daemon that supports multi-agent webchat — as must every existing participant. Idempotent for an agent already in the roster.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["agentId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"conversationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"primary":{"type":"boolean"}},"required":["agentId"],"additionalProperties":false}}},"required":["participants"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/webchat/{conversationId}/mcp-operations":{"get":{"operationId":"listWebchatMcpOperations","summary":"List pending webchat MCP operations","tags":["Agents"],"description":"Lists side-effecting AgentConnect MCP operations awaiting this conversation owner’s approval.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"conversationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toolName":{"type":"string"},"arguments":{},"status":{"type":"string","enum":["awaiting_confirmation","executing","completed","failed","ambiguous","stale"]},"createdAt":{"type":"string"},"confirmationExpiresAt":{"type":"string"},"completedAt":{"type":["string","null"]},"result":{},"nativeUi":{"oneOf":[{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/integration-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["create"]},"provider":{"type":"string","minLength":1,"maxLength":64},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["edit"]},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["integration","codehost-subscription"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"required":["mode","agentId","target"],"additionalProperties":false}]}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/code-host-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"provider":{"type":"string","enum":["github","gitlab","gitea"]}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/agent-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"section":{"type":"string","enum":["basics","runtime","access","secrets"]},"created":{"type":"boolean"},"draft":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":63},"displayName":{"type":"string","minLength":1},"description":{"type":"string"},"runtime":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"reasoningEffort":{"type":"string","minLength":1},"outputMode":{"type":"string","enum":["none","minimal","low","medium","high"]},"fastMode":{"type":"boolean"},"permissionMode":{"type":"string","minLength":1},"placementKind":{"type":"string","enum":["daemon","pool","set"]},"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"daemonId":{"type":"string","minLength":1},"workspace":{"type":"object","properties":{"mode":{"type":"string","enum":["scratch","git"]},"gitRepo":{"type":"string","minLength":1},"gitBranch":{"type":"string","minLength":1},"agentDir":{"type":"string","minLength":1},"worktree":{"type":"boolean"},"access":{"type":"string","enum":["read","write"]}},"required":["mode"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/skill-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"source":{"type":"string","enum":["registry","git"]},"query":{"type":"string","minLength":1,"maxLength":200},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/mcp-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/agent-tools"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"focus":{"type":"string","enum":["mcp","skills"]}},"required":["agentId"],"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false}]}},"required":["operationId","toolName","arguments","status","createdAt","confirmationExpiresAt","completedAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/webchat/{conversationId}/mcp-operations/{operationId}":{"get":{"operationId":"getWebchatMcpOperation","summary":"Get a webchat MCP operation","tags":["Agents"],"description":"Returns the pending, executing, or bounded terminal state of one delegated MCP operation.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"conversationId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"operationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toolName":{"type":"string"},"arguments":{},"status":{"type":"string","enum":["awaiting_confirmation","executing","completed","failed","ambiguous","stale"]},"createdAt":{"type":"string"},"confirmationExpiresAt":{"type":"string"},"completedAt":{"type":["string","null"]},"result":{},"nativeUi":{"oneOf":[{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/integration-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["create"]},"provider":{"type":"string","minLength":1,"maxLength":64},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["edit"]},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["integration","codehost-subscription"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"required":["mode","agentId","target"],"additionalProperties":false}]}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/code-host-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"provider":{"type":"string","enum":["github","gitlab","gitea"]}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/agent-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"section":{"type":"string","enum":["basics","runtime","access","secrets"]},"created":{"type":"boolean"},"draft":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":63},"displayName":{"type":"string","minLength":1},"description":{"type":"string"},"runtime":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"reasoningEffort":{"type":"string","minLength":1},"outputMode":{"type":"string","enum":["none","minimal","low","medium","high"]},"fastMode":{"type":"boolean"},"permissionMode":{"type":"string","minLength":1},"placementKind":{"type":"string","enum":["daemon","pool","set"]},"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"daemonId":{"type":"string","minLength":1},"workspace":{"type":"object","properties":{"mode":{"type":"string","enum":["scratch","git"]},"gitRepo":{"type":"string","minLength":1},"gitBranch":{"type":"string","minLength":1},"agentDir":{"type":"string","minLength":1},"worktree":{"type":"boolean"},"access":{"type":"string","enum":["read","write"]}},"required":["mode"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/skill-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"source":{"type":"string","enum":["registry","git"]},"query":{"type":"string","minLength":1,"maxLength":200},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/mcp-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/agent-tools"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"focus":{"type":"string","enum":["mcp","skills"]}},"required":["agentId"],"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false}]}},"required":["operationId","toolName","arguments","status","createdAt","confirmationExpiresAt","completedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/webchat/{conversationId}/mcp-operations/{operationId}/decision":{"post":{"operationId":"decideWebchatMcpOperation","summary":"Decide a webchat MCP operation","tags":["Agents"],"description":"Approves or denies one exact pending operation. Approval is the sole execution claimant.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","deny"]}},"required":["decision"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"conversationId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"operationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toolName":{"type":"string"},"arguments":{},"status":{"type":"string","enum":["awaiting_confirmation","executing","completed","failed","ambiguous","stale"]},"createdAt":{"type":"string"},"confirmationExpiresAt":{"type":"string"},"completedAt":{"type":["string","null"]},"result":{},"nativeUi":{"oneOf":[{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/integration-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["create"]},"provider":{"type":"string","minLength":1,"maxLength":64},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["edit"]},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["integration","codehost-subscription"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id"],"additionalProperties":false}},"required":["mode","agentId","target"],"additionalProperties":false}]}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/code-host-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"provider":{"type":"string","enum":["github","gitlab","gitea"]}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/agent-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"section":{"type":"string","enum":["basics","runtime","access","secrets"]},"created":{"type":"boolean"},"draft":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":63},"displayName":{"type":"string","minLength":1},"description":{"type":"string"},"runtime":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"reasoningEffort":{"type":"string","minLength":1},"outputMode":{"type":"string","enum":["none","minimal","low","medium","high"]},"fastMode":{"type":"boolean"},"permissionMode":{"type":"string","minLength":1},"placementKind":{"type":"string","enum":["daemon","pool","set"]},"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"daemonId":{"type":"string","minLength":1},"workspace":{"type":"object","properties":{"mode":{"type":"string","enum":["scratch","git"]},"gitRepo":{"type":"string","minLength":1},"gitBranch":{"type":"string","minLength":1},"agentDir":{"type":"string","minLength":1},"worktree":{"type":"boolean"},"access":{"type":"string","enum":["read","write"]}},"required":["mode"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/skill-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"source":{"type":"string","enum":["registry","git"]},"query":{"type":"string","minLength":1,"maxLength":200},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/mcp-setup"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false},{"type":"object","properties":{"resourceUri":{"type":"string","enum":["ui://agentconnect/agent-tools"]},"resourceVersion":{"type":"number","enum":[1]},"orgId":{"type":"string","minLength":1,"maxLength":200},"intent":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"focus":{"type":"string","enum":["mcp","skills"]}},"required":["agentId"],"additionalProperties":false}},"required":["resourceUri","resourceVersion","orgId","intent"],"additionalProperties":false}]}},"required":["operationId","toolName","arguments","status","createdAt","confirmationExpiresAt","completedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations":{"post":{"operationId":"createIntegration","summary":"Add an integration","tags":["Integrations"],"description":"Install a platform integration on a placed agent, reusing a free bot or registering a new one from pasted tokens, then push it live to the owning daemon.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["qq","telegram","discord","slack","feishu","linear","googlechat"]},"agentId":{"type":"string","minLength":1},"botId":{"type":"string","minLength":1},"shareable":{"type":"boolean"},"transport":{"type":"string","enum":["socket","http"]},"qq":{"type":"object","properties":{"appId":{"type":"string","pattern":"^\\d+$"},"appSecret":{"type":"string","minLength":1}},"required":["appId","appSecret"]},"telegram":{"type":"object","properties":{"botToken":{"type":"string","minLength":1}},"required":["botToken"]},"discord":{"type":"object","properties":{"botToken":{"type":"string","minLength":1},"applicationId":{"type":"string","minLength":1}},"required":["botToken"]},"slack":{"type":"object","properties":{"botToken":{"type":"string","minLength":1},"appToken":{"type":"string","minLength":1},"signingSecret":{"type":"string","minLength":1}},"required":["botToken"]},"feishu":{"type":"object","properties":{"appId":{"type":"string","minLength":1},"appSecret":{"type":"string","minLength":1},"region":{"default":"lark","type":"string","enum":["feishu","lark"]},"verificationToken":{"type":"string","minLength":1},"encryptKey":{"type":"string","minLength":1}},"required":["appId","appSecret"]},"linear":{"type":"object","properties":{}},"googlechat":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":100},"projectNumber":{"type":"string","minLength":1,"maxLength":40},"serviceAccountKey":{"type":"string","minLength":1,"maxLength":20000}},"required":["projectId","serviceAccountKey"]}},"required":["platform","agentId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"agentId":{"type":"string"},"botId":{"type":"string"},"status":{"type":"string"},"region":{"type":"string","enum":["feishu","lark"]},"createdAt":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"spaceId":{"type":["string","null"]},"space":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"key":{"type":["string","null"]},"url":{"type":["string","null"]},"isPrivate":{"type":"boolean"},"kind":{"type":"string","enum":["channel","im","mpim"]},"trigger":{"type":"string","enum":["off","mention","any","decision"]},"decisionBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["gate"]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","when","id"],"additionalProperties":false}}},"required":["decisionId","when","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["shared_bot_routing"]}},"required":["type"],"additionalProperties":false}]},{"type":"null"}]},"decision":{"anyOf":[{"type":"object","properties":{"consumer":{"type":"string","enum":["gate","shared_bot_routing"]},"id":{"type":"string"},"name":{"type":["string","null"]},"enabled":{"type":"boolean"},"disabledReason":{"type":"string","enum":["needs_review","access_revoked","paused"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","daemon_offline","unsupported"]},"reason":{"type":"string"}},"required":["status"],"additionalProperties":false}},"required":["id","name","enabled","readiness"],"additionalProperties":false},{"type":"null"}]},"sessionMode":{"type":"string","enum":["createNew","append"]},"agentId":{"type":["string","null"]}},"required":["channelId","name","spaceId","space","icon","color","key","url","isPrivate","kind","trigger","decisionBinding","decision","sessionMode","agentId"],"additionalProperties":false}}},"required":["id","name","platform","agentId","botId","status","createdAt","channels"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"get":{"operationId":"listIntegrations","summary":"List integrations","tags":["Integrations"],"description":"Every platform integration in the active organization, each with its conversation bindings.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"agentId":{"type":"string"},"botId":{"type":"string"},"status":{"type":"string"},"region":{"type":"string","enum":["feishu","lark"]},"createdAt":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"spaceId":{"type":["string","null"]},"space":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"key":{"type":["string","null"]},"url":{"type":["string","null"]},"isPrivate":{"type":"boolean"},"kind":{"type":"string","enum":["channel","im","mpim"]},"trigger":{"type":"string","enum":["off","mention","any","decision"]},"decisionBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["gate"]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","when","id"],"additionalProperties":false}}},"required":["decisionId","when","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["shared_bot_routing"]}},"required":["type"],"additionalProperties":false}]},{"type":"null"}]},"decision":{"anyOf":[{"type":"object","properties":{"consumer":{"type":"string","enum":["gate","shared_bot_routing"]},"id":{"type":"string"},"name":{"type":["string","null"]},"enabled":{"type":"boolean"},"disabledReason":{"type":"string","enum":["needs_review","access_revoked","paused"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","daemon_offline","unsupported"]},"reason":{"type":"string"}},"required":["status"],"additionalProperties":false}},"required":["id","name","enabled","readiness"],"additionalProperties":false},{"type":"null"}]},"sessionMode":{"type":"string","enum":["createNew","append"]},"agentId":{"type":["string","null"]}},"required":["channelId","name","spaceId","space","icon","color","key","url","isPrivate","kind","trigger","decisionBinding","decision","sessionMode","agentId"],"additionalProperties":false}}},"required":["id","name","platform","agentId","botId","status","createdAt","channels"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/integrations/{id}/channels/{channelId}":{"patch":{"operationId":"updateIntegrationChannel","summary":"Update a conversation","tags":["Integrations"],"description":"Set a conversation's trigger (Off, Mention, Any message, or By decision with its complete gate binding), session mode, or default agent, then push the updated routing configuration. Off, Mention, and Any message clear a By decision binding. By decision refusals carry `code` DECISION_NOT_FOUND (404) or DECISION_UNSUPPORTED_CONSUMER (409).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trigger":{"type":"string","enum":["off","mention","any","decision"]},"decisionBinding":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["gate"]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","when","id"],"additionalProperties":false}}},"required":["decisionId","when","type"],"additionalProperties":false},"sessionMode":{"type":"string","enum":["createNew","append"]},"agentId":{"type":"string","minLength":1}}}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1},"in":"path","name":"channelId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"spaceId":{"type":["string","null"]},"space":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"key":{"type":["string","null"]},"url":{"type":["string","null"]},"isPrivate":{"type":"boolean"},"kind":{"type":"string","enum":["channel","im","mpim"]},"trigger":{"type":"string","enum":["off","mention","any","decision"]},"decisionBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["gate"]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","when","id"],"additionalProperties":false}}},"required":["decisionId","when","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["shared_bot_routing"]}},"required":["type"],"additionalProperties":false}]},{"type":"null"}]},"decision":{"anyOf":[{"type":"object","properties":{"consumer":{"type":"string","enum":["gate","shared_bot_routing"]},"id":{"type":"string"},"name":{"type":["string","null"]},"enabled":{"type":"boolean"},"disabledReason":{"type":"string","enum":["needs_review","access_revoked","paused"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","daemon_offline","unsupported"]},"reason":{"type":"string"}},"required":["status"],"additionalProperties":false}},"required":["id","name","enabled","readiness"],"additionalProperties":false},{"type":"null"}]},"sessionMode":{"type":"string","enum":["createNew","append"]},"agentId":{"type":["string","null"]}},"required":["channelId","name","spaceId","space","icon","color","key","url","isPrivate","kind","trigger","decisionBinding","decision","sessionMode","agentId"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteIntegrationChannel","summary":"Forget a conversation","tags":["Integrations"],"description":"Remove a conversation row from AgentConnect without touching the platform. Intended for a conversation the bot has already left where the platform cannot report its own departure. The row returns on the next authoritative listing if the bot is still a member.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1},"in":"path","name":"channelId","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/{id}/leave":{"post":{"operationId":"leaveIntegrationConversation","summary":"Leave a conversation","tags":["Integrations"],"description":"Ask the owning daemon to withdraw the bot from a conversation (Slack, Telegram) or an entire server (Discord) at the platform, then forget the affected rows. Returns 502 with the platform's own message when the platform refuses.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["conversation"]},"channel":{"type":"string","minLength":1}},"required":["kind","channel"]},{"type":"object","properties":{"kind":{"type":"string","enum":["space"]},"spaceId":{"type":"string","minLength":1}},"required":["kind","spaceId"]}]}},"required":["target"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/{id}":{"delete":{"operationId":"deleteIntegration","summary":"Remove an integration","tags":["Integrations"],"description":"Delete the integration metadata (the bot and its tokens survive, freed for the next install), then tell the owning daemon to drop it.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/qq/credentials":{"put":{"operationId":"updateQQBotCredentials","summary":"Update QQ bot credentials","tags":["Bots"],"description":"Verify and replace the AppSecret for the same QQ bot, preserving its conversations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appSecret":{"type":"string","minLength":1}},"required":["appSecret"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/telegram/check":{"post":{"operationId":"checkTelegramBot","summary":"Check a Telegram bot","tags":["Integrations"],"description":"Validate a pasted Telegram bot token and report whether Group Privacy Mode is disabled, without storing the token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"botToken":{"type":"string","minLength":1}},"required":["botToken"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready","privacy_enabled","invalid","unreachable"]}},"required":["status"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/slack/app":{"post":{"operationId":"startSlackAppInstall","summary":"Start Slack auto-install","tags":["Integrations"],"description":"Create a Slack app from a manifest using the ORG's stored App Configuration token (Settings), then return the browser OAuth install link. The stored token is auto-rotated when stale.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["socket","http"]}},"required":["agentId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"installId":{"type":"string"},"appId":{"type":"string"},"installUrl":{"type":"string"},"transport":{"type":"string","enum":["socket","http"]}},"required":["installId","appId","installUrl","transport"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/slack/app/{id}":{"get":{"operationId":"getSlackAppInstall","summary":"Poll Slack auto-install","tags":["Integrations"],"description":"Funnel progress: `awaiting_oauth` until the user approves the install in Slack, then `bot_ready` — at which point the console unlocks the app-level-token step. Never returns tokens.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"installId":{"type":"string"},"appId":{"type":"string"},"status":{"type":"string","enum":["awaiting_oauth","bot_ready"]},"transport":{"type":"string","enum":["socket","http"]}},"required":["installId","appId","status","transport"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/slack/app/{id}/finalize":{"post":{"operationId":"finalizeSlackAppInstall","summary":"Finalize Slack auto-install","tags":["Integrations"],"description":"Combine the OAuth-obtained bot token (held server-side) with the operator-pasted app-level token to create the bot + integration and push it live, then delete the pending session. Refuses with `SLACK_MISSING_SCOPES` (and the `missingScopes` list) when the workspace authorization granted fewer bot scopes than the app requires, so a short install never becomes a bot.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appToken":{"type":"string","minLength":1},"shareable":{"type":"boolean"}}}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"agentId":{"type":"string"},"botId":{"type":"string"},"status":{"type":"string"},"region":{"type":"string","enum":["feishu","lark"]},"createdAt":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"spaceId":{"type":["string","null"]},"space":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"key":{"type":["string","null"]},"url":{"type":["string","null"]},"isPrivate":{"type":"boolean"},"kind":{"type":"string","enum":["channel","im","mpim"]},"trigger":{"type":"string","enum":["off","mention","any","decision"]},"decisionBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["gate"]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","when","id"],"additionalProperties":false}}},"required":["decisionId","when","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["shared_bot_routing"]}},"required":["type"],"additionalProperties":false}]},{"type":"null"}]},"decision":{"anyOf":[{"type":"object","properties":{"consumer":{"type":"string","enum":["gate","shared_bot_routing"]},"id":{"type":"string"},"name":{"type":["string","null"]},"enabled":{"type":"boolean"},"disabledReason":{"type":"string","enum":["needs_review","access_revoked","paused"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","daemon_offline","unsupported"]},"reason":{"type":"string"}},"required":["status"],"additionalProperties":false}},"required":["id","name","enabled","readiness"],"additionalProperties":false},{"type":"null"}]},"sessionMode":{"type":"string","enum":["createNew","append"]},"agentId":{"type":["string","null"]}},"required":["channelId","name","spaceId","space","icon","color","key","url","isPrivate","kind","trigger","decisionBinding","decision","sessionMode","agentId"],"additionalProperties":false}}},"required":["id","name","platform","agentId","botId","status","createdAt","channels"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"missingScopes":{"type":"array","items":{"type":"string"}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/slack/platform-install":{"post":{"operationId":"startSlackPlatformInstall","summary":"Start platform Slack app install","tags":["Integrations"],"description":"Mint a pending install of the platform-published Slack app and return the slack.com authorize URL. A generic install binds the OAuth state to an org, target agent, and user; a Settings reauthorization binds it to an existing bot/workspace and preserves that bot’s current agent memberships. Requires the relay pool (the distributed app is Events-API-only).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"botId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"installUrl":{"type":"string"}},"required":["id","installUrl"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/slack/platform-install/{id}":{"get":{"operationId":"getSlackPlatformInstall","summary":"Poll platform Slack app install","tags":["Integrations"],"description":"Completion signal for the \"Add to Slack\" round trip: `pending` while the authorize tab is open, then `completed` (the Bot + install are live) or `failed` with a short reason code. A `missing_scopes` failure also lists the required bot scopes the workspace authorization withheld. Returns no tokens.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","completed","failed"]},"failureReason":{"type":["string","null"]},"missingScopes":{"type":"array","items":{"type":"string"}},"botId":{"type":["string","null"]}},"required":["id","status","failureReason","missingScopes","botId"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/slack/config":{"get":{"operationId":"getSlackConfig","summary":"Slack config status","tags":["Integrations"],"description":"Whether the signed-in caller has stored their own App Configuration token (drives the create modal's forced auto/manual mode) and whether auto-install is usable here. Never returns the token.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"durable":{"type":"boolean"},"funnelEnabled":{"type":"boolean"},"autoAvailable":{"type":"boolean"},"accessExpiresAt":{"type":["string","null"]},"relayAvailable":{"type":"boolean"},"relayPublicUrl":{"type":["string","null"]},"platformInstallAvailable":{"type":"boolean"},"updatedAt":{"type":["string","null"]}},"required":["configured","durable","funnelEnabled","autoAvailable","accessExpiresAt","relayAvailable","relayPublicUrl","platformInstallAvailable","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"putSlackConfig","summary":"Store Slack config token","tags":["Integrations"],"description":"Save (or replace) the caller’s own Slack App Configuration token. With a refresh token it is validated + normalized by rotating once (durable, never expires); access-token-only is stored as-is with Slack’s ~12h lifetime and verified at install time. Forces the create modal into auto-install for this caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accessToken":{"type":"string","minLength":1},"refreshToken":{"type":"string","minLength":1}},"required":["accessToken"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"durable":{"type":"boolean"},"funnelEnabled":{"type":"boolean"},"autoAvailable":{"type":"boolean"},"accessExpiresAt":{"type":["string","null"]},"relayAvailable":{"type":"boolean"},"relayPublicUrl":{"type":["string","null"]},"platformInstallAvailable":{"type":"boolean"},"updatedAt":{"type":["string","null"]}},"required":["configured","durable","funnelEnabled","autoAvailable","accessExpiresAt","relayAvailable","relayPublicUrl","platformInstallAvailable","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteSlackConfig","summary":"Clear Slack config token","tags":["Integrations"],"description":"Remove the caller’s own stored App Configuration token; their create modal falls back to the manual flow.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"204":{"description":"Default Response"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/slack/refresh":{"post":{"operationId":"refreshSlackBot","summary":"Refresh a Slack app","tags":["Bots"],"description":"Sync AgentConnect's required configuration into an existing Slack app without deleting user-owned manifest fields, then check the workspace installation's granted bot scopes. Returns Slack settings links when manual permission updates or workspace reinstallation are required.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"manifest":{"type":"string","enum":["synced","manual_update_required","deployment_update_required","unknown"]},"manifestMissingScopes":{"type":"array","items":{"type":"string"}},"authorization":{"type":"string","enum":["current","reinstall_required","invalid","app_mismatch","unknown"]},"rejection":{"type":["string","null"]},"missingScopes":{"type":"array","items":{"type":"string"}},"settingsUrl":{"type":"string"},"manifestUrl":{"type":"string"},"permissionsUrl":{"type":"string"},"reinstallUrl":{"type":"string"}},"required":["manifest","manifestMissingScopes","authorization","rejection","missingScopes","settingsUrl","manifestUrl","permissionsUrl","reinstallUrl"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/slack/token":{"post":{"operationId":"replaceSlackBotToken","summary":"Replace a Slack bot token","tags":["Bots"],"description":"Verify a new Bot User OAuth Token for a custom Slack app against Slack, require the same app and workspace, then store it in place of the current token. The bot's other credentials are kept. Integrations revoked with the previous token are restored with their ids, conversation settings and schedule targets, and every serving daemon receives the new token. Built-in apps reconnect by reinstalling instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"botToken":{"type":"string","format":"starts_with","pattern":"^xoxb-.*"}},"required":["botToken"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"prebuilt":{"type":"boolean"},"slackAppId":{"type":["string","null"]},"discordAppId":{"type":["string","null"]},"feishuAppId":{"type":["string","null"]},"feishuRegion":{"anyOf":[{"type":"string","enum":["feishu","lark"]},{"type":"null"}]},"createdBy":{"type":["string","null"]},"shareable":{"type":"boolean"},"joinPublicChannels":{"type":"boolean"},"transport":{"type":"string","enum":["socket","http"]},"inUseByAgentId":{"type":["string","null"]},"agentIds":{"type":"array","items":{"type":"string"}},"releasedWhenFreed":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"freedFromAgent":{"type":["string","null"]},"teamId":{"type":["string","null"]},"workspaceId":{"type":["string","null"]},"workspaceName":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"revokedReason":{"anyOf":[{"type":"string","enum":["app_uninstalled","tokens_revoked"]},{"type":"null"}]},"revokedEvidence":{"anyOf":[{"type":"string","enum":["event","probe"]},{"type":"null"}]},"revokedCode":{"type":["string","null"]},"credentialRejectedAt":{"type":["string","null"]},"credentialRejectedCode":{"type":["string","null"]},"externalAppId":{"type":["string","null"]},"platformConfig":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","platform","prebuilt","slackAppId","discordAppId","feishuAppId","feishuRegion","createdBy","shareable","joinPublicChannels","transport","inUseByAgentId","agentIds","releasedWhenFreed","lastUsedAt","freedFromAgent","teamId","workspaceId","workspaceName","revokedAt","revokedReason","revokedEvidence","revokedCode","credentialRejectedAt","credentialRejectedCode","externalAppId","platformConfig","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/feishu/app":{"post":{"operationId":"startFeishuAppRegistration","summary":"Start Lark / Feishu app registration","tags":["Integrations"],"description":"Create an AgentConnect-ready Lark/Feishu self-built app through the official device authorization flow. Returns only the authorization deeplink; credentials are installed server-side after approval.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1},"region":{"default":"lark","type":"string","enum":["feishu","lark"]},"transport":{"default":"socket","type":"string","enum":["socket","http"]}},"required":["agentId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"authorizationUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"transport":{"type":"string","enum":["socket","http"]}},"required":["id","authorizationUrl","expiresAt","transport"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/feishu/app/{id}":{"get":{"operationId":"getFeishuAppRegistration","summary":"Poll Lark / Feishu app registration","tags":["Integrations"],"description":"Read one Lark/Feishu device-registration session until it completes or fails. Credentials are never returned.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","completed","failed"]},"failureReason":{"anyOf":[{"type":"string","enum":["denied","expired","agent_unavailable","invalid_credentials","org_mismatch","setup_failed"]},{"type":"null"}]},"integrationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","status","failureReason","integrationId","expiresAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/linear/connect":{"post":{"operationId":"startLinearConnect","summary":"Start a Linear workspace connect","tags":["Integrations"],"description":"Mint a one-shot OAuth state bound to this organization, the caller, and the workspace’s chosen default agent, then return the linear.app authorize URL. No bot or integration exists until the callback completes. Requires the relay pool: Linear delivers only over HTTP callbacks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["agentId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectUrl":{"type":"string"}},"required":["id","connectUrl"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/linear/connect/{id}":{"get":{"operationId":"getLinearConnect","summary":"Poll a Linear workspace connect","tags":["Integrations"],"description":"Completion signal for the authorize round trip: `pending` while the tab is open, then `completed` (the workspace bot is live, and its id is returned) or `failed` with a short reason code. Returns no tokens.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","completed","failed"]},"failureReason":{"type":["string","null"]},"botId":{"type":["string","null"]}},"required":["id","status","failureReason","botId"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/linear/reconnect":{"post":{"operationId":"reconnectLinearWorkspace","summary":"Reconnect a Linear workspace","tags":["Bots"],"description":"Restart the OAuth funnel against an already-connected workspace whose grant died (refresh rejected, the deployment app’s secret rotated, or the workspace revoked the app upstream). The callback replaces the stored grant in place; the bot, its members, and its default agent are untouched.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectUrl":{"type":"string"}},"required":["id","connectUrl"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/linear/disconnect":{"post":{"operationId":"disconnectLinearWorkspace","summary":"Disconnect a Linear workspace","tags":["Bots"],"description":"Remove a connected Linear workspace for the whole organization: every agent’s membership of it, then the bot identity itself, whose deletion revokes the upstream grant. Atomic from the caller’s side — a partial teardown is reported as a conflict naming what is still linked, never as success.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/googlechat/key":{"put":{"operationId":"replaceGoogleChatKey","summary":"Replace a Google Chat app key","tags":["Bots"],"description":"Validate a new service-account key for this bot’s Google Chat app exactly as a new install does (the key’s own project, its number from Cloud Resource Manager, one Chat API read), require the same project and number, then store it in place of the current key and push it to every serving daemon. The key is write-only. The deployment-owned app takes its key from the Setup Server instead (409).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serviceAccountKey":{"type":"string","minLength":1,"maxLength":20000}},"required":["serviceAccountKey"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"prebuilt":{"type":"boolean"},"slackAppId":{"type":["string","null"]},"discordAppId":{"type":["string","null"]},"feishuAppId":{"type":["string","null"]},"feishuRegion":{"anyOf":[{"type":"string","enum":["feishu","lark"]},{"type":"null"}]},"createdBy":{"type":["string","null"]},"shareable":{"type":"boolean"},"joinPublicChannels":{"type":"boolean"},"transport":{"type":"string","enum":["socket","http"]},"inUseByAgentId":{"type":["string","null"]},"agentIds":{"type":"array","items":{"type":"string"}},"releasedWhenFreed":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"freedFromAgent":{"type":["string","null"]},"teamId":{"type":["string","null"]},"workspaceId":{"type":["string","null"]},"workspaceName":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"revokedReason":{"anyOf":[{"type":"string","enum":["app_uninstalled","tokens_revoked"]},{"type":"null"}]},"revokedEvidence":{"anyOf":[{"type":"string","enum":["event","probe"]},{"type":"null"}]},"revokedCode":{"type":["string","null"]},"credentialRejectedAt":{"type":["string","null"]},"credentialRejectedCode":{"type":["string","null"]},"externalAppId":{"type":["string","null"]},"platformConfig":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","platform","prebuilt","slackAppId","discordAppId","feishuAppId","feishuRegion","createdBy","shareable","joinPublicChannels","transport","inUseByAgentId","agentIds","releasedWhenFreed","lastUsedAt","freedFromAgent","teamId","workspaceId","workspaceName","revokedAt","revokedReason","revokedEvidence","revokedCode","credentialRejectedAt","credentialRejectedCode","externalAppId","platformConfig","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/googlechat/claim":{"post":{"operationId":"claimGoogleChatCustomer","summary":"Claim a Google Workspace customer for Google Chat","tags":["Integrations"],"description":"Connect the caller’s Google Workspace customer to this organization on the deployment’s Google Chat app. `state` is the unsigned base64url JSON the Chat prompt carried; every fact is re-derived: the caller’s linked Google account must be the Chat user who asked, a Space claim requires the caller’s membership in that Space to be INTERNAL, and a DM claim requires the caller to be its only human member, whose domain is the one bound. A DM claim matches only the row that already lists its domain; a Space claim’s domain and customer append the domain to the customer’s row, upgrade and re-key a domain-only row, or consolidate the two rows into the customer’s. A new customer is installed on the organization’s preset agent (201). A customer this organization already holds answers 200; one held by another organization answers 409 without naming it, and a domain bound to a different customer answers 409 GOOGLE_CHAT_CLAIM_CONFLICT. Answers the Chat prompt’s completion URL when the state carried one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":4096}},"required":["state"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect":{"type":"string"}},"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots":{"get":{"operationId":"listBots","summary":"List bots","tags":["Bots"],"description":"The org's durable platform bot identities, including freed and built-in bots offered for reuse.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"prebuilt":{"type":"boolean"},"slackAppId":{"type":["string","null"]},"discordAppId":{"type":["string","null"]},"feishuAppId":{"type":["string","null"]},"feishuRegion":{"anyOf":[{"type":"string","enum":["feishu","lark"]},{"type":"null"}]},"createdBy":{"type":["string","null"]},"shareable":{"type":"boolean"},"joinPublicChannels":{"type":"boolean"},"transport":{"type":"string","enum":["socket","http"]},"inUseByAgentId":{"type":["string","null"]},"agentIds":{"type":"array","items":{"type":"string"}},"releasedWhenFreed":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"freedFromAgent":{"type":["string","null"]},"teamId":{"type":["string","null"]},"workspaceId":{"type":["string","null"]},"workspaceName":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"revokedReason":{"anyOf":[{"type":"string","enum":["app_uninstalled","tokens_revoked"]},{"type":"null"}]},"revokedEvidence":{"anyOf":[{"type":"string","enum":["event","probe"]},{"type":"null"}]},"revokedCode":{"type":["string","null"]},"credentialRejectedAt":{"type":["string","null"]},"credentialRejectedCode":{"type":["string","null"]},"externalAppId":{"type":["string","null"]},"platformConfig":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","platform","prebuilt","slackAppId","discordAppId","feishuAppId","feishuRegion","createdBy","shareable","joinPublicChannels","transport","inUseByAgentId","agentIds","releasedWhenFreed","lastUsedAt","freedFromAgent","teamId","workspaceId","workspaceName","revokedAt","revokedReason","revokedEvidence","revokedCode","credentialRejectedAt","credentialRejectedCode","externalAppId","platformConfig","createdAt"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/bots/{id}":{"get":{"operationId":"getBot","summary":"Get a bot","tags":["Bots"],"description":"Fetch a single bot identity by id (scoped to the caller's org; a cross-org id reads as 404).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"prebuilt":{"type":"boolean"},"slackAppId":{"type":["string","null"]},"discordAppId":{"type":["string","null"]},"feishuAppId":{"type":["string","null"]},"feishuRegion":{"anyOf":[{"type":"string","enum":["feishu","lark"]},{"type":"null"}]},"createdBy":{"type":["string","null"]},"shareable":{"type":"boolean"},"joinPublicChannels":{"type":"boolean"},"transport":{"type":"string","enum":["socket","http"]},"inUseByAgentId":{"type":["string","null"]},"agentIds":{"type":"array","items":{"type":"string"}},"releasedWhenFreed":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"freedFromAgent":{"type":["string","null"]},"teamId":{"type":["string","null"]},"workspaceId":{"type":["string","null"]},"workspaceName":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"revokedReason":{"anyOf":[{"type":"string","enum":["app_uninstalled","tokens_revoked"]},{"type":"null"}]},"revokedEvidence":{"anyOf":[{"type":"string","enum":["event","probe"]},{"type":"null"}]},"revokedCode":{"type":["string","null"]},"credentialRejectedAt":{"type":["string","null"]},"credentialRejectedCode":{"type":["string","null"]},"externalAppId":{"type":["string","null"]},"platformConfig":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","platform","prebuilt","slackAppId","discordAppId","feishuAppId","feishuRegion","createdBy","shareable","joinPublicChannels","transport","inUseByAgentId","agentIds","releasedWhenFreed","lastUsedAt","freedFromAgent","teamId","workspaceId","workspaceName","revokedAt","revokedReason","revokedEvidence","revokedCode","credentialRejectedAt","credentialRejectedCode","externalAppId","platformConfig","createdAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteBot","summary":"Delete a bot","tags":["Bots"],"description":"Forget a bot and, via cascade, its stored tokens; refused while the bot is installed on an agent (uninstall the integration first).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateBot","summary":"Update a bot","tags":["Bots"],"description":"Allow or disallow this HTTP bot from serving multiple agents (allowing requires a platform that supports multi-agent bots; relay ingress is unchanged either way), and/or let the bot join public channels on demand where the platform supports it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shareable":{"type":"boolean"},"joinPublicChannels":{"type":"boolean"}}}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"prebuilt":{"type":"boolean"},"slackAppId":{"type":["string","null"]},"discordAppId":{"type":["string","null"]},"feishuAppId":{"type":["string","null"]},"feishuRegion":{"anyOf":[{"type":"string","enum":["feishu","lark"]},{"type":"null"}]},"createdBy":{"type":["string","null"]},"shareable":{"type":"boolean"},"joinPublicChannels":{"type":"boolean"},"transport":{"type":"string","enum":["socket","http"]},"inUseByAgentId":{"type":["string","null"]},"agentIds":{"type":"array","items":{"type":"string"}},"releasedWhenFreed":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"freedFromAgent":{"type":["string","null"]},"teamId":{"type":["string","null"]},"workspaceId":{"type":["string","null"]},"workspaceName":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"revokedReason":{"anyOf":[{"type":"string","enum":["app_uninstalled","tokens_revoked"]},{"type":"null"}]},"revokedEvidence":{"anyOf":[{"type":"string","enum":["event","probe"]},{"type":"null"}]},"revokedCode":{"type":["string","null"]},"credentialRejectedAt":{"type":["string","null"]},"credentialRejectedCode":{"type":["string","null"]},"externalAppId":{"type":["string","null"]},"platformConfig":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","platform","prebuilt","slackAppId","discordAppId","feishuAppId","feishuRegion","createdBy","shareable","joinPublicChannels","transport","inUseByAgentId","agentIds","releasedWhenFreed","lastUsedAt","freedFromAgent","teamId","workspaceId","workspaceName","revokedAt","revokedReason","revokedEvidence","revokedCode","credentialRejectedAt","credentialRejectedCode","externalAppId","platformConfig","createdAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/decisions/providers":{"get":{"operationId":"listDecisionProviders","summary":"List Decision providers","tags":["Decisions"],"description":"Authorized daemon capabilities and organization credential readiness. Does not decrypt keys or make provider calls.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"daemonId","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"daemonId":{"type":"string"},"daemonName":{"type":"string"},"pool":{"type":"boolean"},"memberSetId":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["byok","ac_credits"]},{"type":"null"}]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","missing_credentials","daemon_offline","unsupported"]}},"required":["status"],"additionalProperties":false},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"questionTypes":{"type":"array","items":{"type":"string","enum":["boolean","choice","score"]}}},"required":["id","label","questionTypes"],"additionalProperties":false}}},"required":["id","name","kind","daemonId","daemonName","pool","memberSetId","source","readiness","models"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/decisions":{"get":{"operationId":"listDecisions","summary":"List Decisions","tags":["Decisions"],"description":"Lists reusable Decision definitions visible to the caller, each with the number of visible consumers: conversations it gates, shared-bot routers, code-host routings, and agents. Message consumers are not enabled by saving a definition.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"default":"org","type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"id":{"type":"string"},"orgId":{"type":"string"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"},"usageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","providerId","model","question","visibility","sharedWith","id","orgId","createdBy","createdAt","updatedAt","canEdit","usageCount"],"additionalProperties":false}}}}}}},"post":{"operationId":"createDecision","summary":"Create a Decision","tags":["Decisions"],"description":"Saves a reusable typed question independently of daemon availability or message triggers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"default":"org","type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"required":["name","providerId","model","question"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"default":"org","type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"id":{"type":"string"},"orgId":{"type":"string"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["name","providerId","model","question","visibility","sharedWith","id","orgId","createdBy","createdAt","updatedAt","canEdit"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/decisions/{id}":{"get":{"operationId":"getDecision","summary":"Get a Decision","tags":["Decisions"],"description":"Returns a visible Decision and its visible consumers: each By decision conversation gate whose agent the caller can see, each shared-bot router whose bot connects an agent the caller can see, each code-host routing with a member or target agent the caller can see, and each agent that uses it.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"default":"org","type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"id":{"type":"string"},"orgId":{"type":"string"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["name","providerId","model","question","visibility","sharedWith","id","orgId","createdBy","createdAt","updatedAt","canEdit"],"additionalProperties":false},"usages":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["gate","shared_bot_routing","agent_tool","model_selection","code_host_routing"]},"id":{"type":"string"},"label":{"type":"string"},"rootDecisionId":{"type":"string"},"integrationId":{"type":"string"},"channelId":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"family":{"type":"string","enum":["issues","pull_request","merge_request"]}},"required":["kind","id","label"],"additionalProperties":false}}},"required":["decision","usages"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateDecision","summary":"Update a Decision","tags":["Decisions"],"description":"Replaces the definition atomically. Omitted visibility and selected members preserve the current audience. Revalidates every By decision conversation gate and routing, marks incompatible ones Needs review (disabled, condition preserved), and re-pushes affected routing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"required":["name","providerId","model","question"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"default":"org","type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"id":{"type":"string"},"orgId":{"type":"string"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["name","providerId","model","question","visibility","sharedWith","id","orgId","createdBy","createdAt","updatedAt","canEdit"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteDecision","summary":"Delete a Decision","tags":["Decisions"],"description":"Deletes a visible definition. Refused with 409 while a conversation gate, a shared-bot router, a code-host routing, or an agent still references it: usages lists what the caller can see and hiddenUsageCount counts the conversations, routers, routings, and agents it cannot.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"usages":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["gate","shared_bot_routing","agent_tool","model_selection","code_host_routing"]},"id":{"type":"string"},"label":{"type":"string"},"rootDecisionId":{"type":"string"},"integrationId":{"type":"string"},"channelId":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"family":{"type":"string","enum":["issues","pull_request","merge_request"]}},"required":["kind","id","label"],"additionalProperties":false}},"hiddenUsageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["error","statusCode","message","usages","hiddenUsageCount"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/decisions/preview":{"post":{"operationId":"previewDecision","summary":"Try a Decision","tags":["Decisions"],"description":"Evaluates a draft and bounded sample state on an authorized daemon, resolving pool or organization group targets within their current ready members. Does not create a session or store sample content.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"visibility":{"default":"org","type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"required":["name","providerId","model","question"],"additionalProperties":false},"daemonId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["daemon"]},"daemonId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","daemonId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pool"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["set"]},"setId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","setId"],"additionalProperties":false}]},"state":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"consumer":{"type":"object","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"],"additionalProperties":false}},"required":["decision","state","consumer"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["live"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","missing_credentials","daemon_offline","unsupported"]}},"required":["status"],"additionalProperties":false},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]},"consumer":{"type":"null"}},"required":["mode","readiness","evaluation","consumer"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/decision-routing":{"get":{"operationId":"getBotDecisionRouting","summary":"Get shared-bot routing","tags":["Decisions"],"description":"Returns the shared bot's By decision routing configuration, its effective channel scope, and readiness, including the evaluation host daemon and each channel's resolved default agent. Names appear only for agents and daemons the caller can view; conversation names only when the caller can view one of the bot's agents.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"botId":{"type":"string"},"config":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},{"type":"null"}]},"channelIds":{"type":"array","items":{"type":"string"}},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","missing_credentials","daemon_offline","unsupported","insufficient_credits"]},"reason":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["status"],"additionalProperties":false},"evaluationHost":{"anyOf":[{"type":"object","properties":{"daemonId":{"type":"string"},"name":{"type":["string","null"]},"source":{"type":"string","enum":["default_agent","earliest_candidate"]},"status":{"type":"string","enum":["ready","daemon_offline","unsupported"]}},"required":["daemonId","name","source","status"],"additionalProperties":false},{"type":"null"}]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"defaultAgent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"evaluationDaemonId":{"type":["string","null"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","missing_credentials","daemon_offline","unsupported","insufficient_credits"]},"reason":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["status"],"additionalProperties":false}},"required":["channelId","name","defaultAgent","evaluationDaemonId","readiness"],"additionalProperties":false}},"updatedAt":{"type":["string","null"]}},"required":["botId","config","channelIds","readiness","evaluationHost","channels","updatedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"saveBotDecisionRouting","summary":"Save shared-bot routing","tags":["Decisions"],"description":"Saves the complete routing configuration and its channel scope in one transaction. `channelIds` is the complete desired scope: an addition must be an enabled group channel and becomes By decision on every sibling row, replacing any gate; every removed channel must appear in `removals` with its replacement trigger and optional default agent. `enabled: false` pauses routing and keeps the scope. Adding channels is refused with `code` DECISION_UNSUPPORTED_CONSUMER (409) while the relay or the evaluation host does not support routing; an invisible Decision is `code` DECISION_NOT_FOUND (404).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},"channelIds":{"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":512}},"removals":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1,"maxLength":512},"settings":{"type":"object","properties":{"trigger":{"type":"string","enum":["off","mention","auto"]}},"required":["trigger"],"additionalProperties":false},"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId","settings"],"additionalProperties":false}}},"required":["config","channelIds","removals"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"botId":{"type":"string"},"config":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},{"type":"null"}]},"channelIds":{"type":"array","items":{"type":"string"}},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","missing_credentials","daemon_offline","unsupported","insufficient_credits"]},"reason":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["status"],"additionalProperties":false},"evaluationHost":{"anyOf":[{"type":"object","properties":{"daemonId":{"type":"string"},"name":{"type":["string","null"]},"source":{"type":"string","enum":["default_agent","earliest_candidate"]},"status":{"type":"string","enum":["ready","daemon_offline","unsupported"]}},"required":["daemonId","name","source","status"],"additionalProperties":false},{"type":"null"}]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"defaultAgent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"evaluationDaemonId":{"type":["string","null"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","missing_credentials","daemon_offline","unsupported","insufficient_credits"]},"reason":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["status"],"additionalProperties":false}},"required":["channelId","name","defaultAgent","evaluationDaemonId","readiness"],"additionalProperties":false}},"updatedAt":{"type":["string","null"]}},"required":["botId","config","channelIds","readiness","evaluationHost","channels","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/decision-routing/{provider}/{repoId}/{family}":{"get":{"operationId":"getCodeHostDecisionRouting","summary":"Get repository routing","tags":["Decisions"],"description":"Returns the Decision routing for one code-host repository and subject family — `github` with `issues` or `pull_request`, `gitlab` or `gitea` with `issues` or `merge_request` (400 for another pair): its config (null when none is saved), status (`enabled`, `needs_review`, `access_revoked`; pause is the config's own `enabled`), the members — every agent with an enabled trigger of that provider on that repository and family, the only valid rule targets — and the evaluation agent. Needs view access to one member; member names appear only for agents the caller can view.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["github","gitlab","gitea"]},"in":"path","name":"provider","required":true},{"schema":{"type":"string","pattern":"^[1-9]\\d{0,18}$"},"in":"path","name":"repoId","required":true},{"schema":{"type":"string","enum":["issues","pull_request","merge_request"]},"in":"path","name":"family","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"repoFullName":{"type":"string"},"family":{"type":"string","enum":["issues","pull_request","merge_request"]},"config":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["enabled","needs_review","access_revoked"]},{"type":"null"}]},"members":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"hookId":{"type":"string"},"name":{"type":["string","null"]}},"required":["agentId","hookId","name"],"additionalProperties":false}},"evaluationAgentId":{"type":["string","null"]}},"required":["provider","repoId","repoFullName","family","config","status","members","evaluationAgentId"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"saveCodeHostDecisionRouting","summary":"Save repository routing","tags":["Decisions"],"description":"Saves the complete routing config for one code-host repository and subject family and clears Needs review. The Decision must be visible and supported (`code` DECISION_NOT_FOUND, 404), the rules must fit its question, and every rule's agent must be a member (400 with `issues`). Needs edit access to every member agent, since the routing decides which of them fire. `enabled: false` pauses routing: the members' triggers fire unrouted. Enabling is refused with `code` DECISION_UNSUPPORTED_CONSUMER (409) while a connected relay does not support routing for this provider.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false}},"required":["config"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["github","gitlab","gitea"]},"in":"path","name":"provider","required":true},{"schema":{"type":"string","pattern":"^[1-9]\\d{0,18}$"},"in":"path","name":"repoId","required":true},{"schema":{"type":"string","enum":["issues","pull_request","merge_request"]},"in":"path","name":"family","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"repoFullName":{"type":"string"},"family":{"type":"string","enum":["issues","pull_request","merge_request"]},"config":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["enabled","needs_review","access_revoked"]},{"type":"null"}]},"members":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"hookId":{"type":"string"},"name":{"type":["string","null"]}},"required":["agentId","hookId","name"],"additionalProperties":false}},"evaluationAgentId":{"type":["string","null"]}},"required":["provider","repoId","repoFullName","family","config","status","members","evaluationAgentId"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteCodeHostDecisionRouting","summary":"Delete repository routing","tags":["Decisions"],"description":"Removes the routing for one code-host repository and subject family; the members' triggers fire unrouted again. Needs edit access to every member agent (an owner for a routing with no member left).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["github","gitlab","gitea"]},"in":"path","name":"provider","required":true},{"schema":{"type":"string","pattern":"^[1-9]\\d{0,18}$"},"in":"path","name":"repoId","required":true},{"schema":{"type":"string","enum":["issues","pull_request","merge_request"]},"in":"path","name":"family","required":true}],"responses":{"204":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/decision-routing/{provider}/{repoId}/{family}/evaluations":{"get":{"operationId":"listCodeHostDecisionRoutingEvaluations","summary":"List repository routing evaluations","tags":["Decisions"],"description":"Recent evaluations of one repository routing, newest first, read from the evaluation agent's serving daemon and proxied without being stored or logged. `decisionId` optionally filters by the recorded root Decision before paging. Needs view access to one member; each row's `title` names what was judged in one line and is null without the edit access to every member agent that its details need. Pages by `cursor` (the previous page's `nextCursor`) up to 50 rows and 32 KiB. Returns 503 when the host daemon is offline (`DAEMON_OFFLINE`) or must be upgraded (`DAEMON_UPGRADE_REQUIRED`).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"in":"query","name":"cursor","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"decisionId","required":false},{"schema":{"type":"string","enum":["github","gitlab","gitea"]},"in":"path","name":"provider","required":true},{"schema":{"type":"string","pattern":"^[1-9]\\d{0,18}$"},"in":"path","name":"repoId","required":true},{"schema":{"type":"string","enum":["issues","pull_request","merge_request"]},"in":"path","name":"family","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"messageId":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["triggered","skipped","unavailable","canceled","pending"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"matchedKeys":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"requestedModel":{"type":"string","minLength":1,"maxLength":128},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"}},"required":["seq","at","messageId","title","decisionId","outcome","reason","answer","matchedKeys","latencyMs","requestedModel","actualModel","usage","detailsExpired"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/decision-routing/{provider}/{repoId}/{family}/evaluations/{seq}":{"get":{"operationId":"getCodeHostDecisionRoutingEvaluation","summary":"Get a repository routing evaluation","tags":["Decisions"],"description":"One routing evaluation with its frozen Decision and rules snapshot, input and history, answer, model, usage, the raw provider request and response JSON (from daemons that support it), and evidence while the host still retains the bodies (bounded to 64 KiB); once stripped, `detailsExpired` is true. Proxied from the evaluation agent's serving daemon, never stored or logged. Needs edit access to every member agent. Returns 404 when the evaluation is gone and 503 when the host daemon is offline or must be upgraded.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["github","gitlab","gitea"]},"in":"path","name":"provider","required":true},{"schema":{"type":"string","pattern":"^[1-9]\\d{0,18}$"},"in":"path","name":"repoId","required":true},{"schema":{"type":"string","enum":["issues","pull_request","merge_request"]},"in":"path","name":"family","required":true},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"path","name":"seq","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"messageId":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["triggered","skipped","unavailable","canceled","pending"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"matchedKeys":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"requestedModel":{"type":"string","minLength":1,"maxLength":128},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"},"snapshot":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"condition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"sessionMode":{"type":"string","maxLength":64}},"required":["decisionId","providerId","model","question","condition","sessionMode"],"additionalProperties":false},{"type":"null"}]},"input":{"anyOf":[{"type":"object","properties":{"currentMessage":{"type":"object","properties":{"id":{"type":"string","maxLength":256},"sender":{"type":"object","properties":{"id":{"type":"string","maxLength":256}},"required":["id"],"additionalProperties":false},"text":{"type":"string","maxLength":32768},"quote":{"type":"object","properties":{"sender":{"type":"string","maxLength":256},"text":{"type":"string","maxLength":32768}},"required":["text"],"additionalProperties":false},"threadId":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"time":{"type":"string","maxLength":64},"truncated":{"type":"boolean","enum":[true]}},"required":["id","sender","text","threadId"],"additionalProperties":false},"history":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":256},"sender":{"type":"object","properties":{"id":{"type":"string","maxLength":256}},"required":["id"],"additionalProperties":false},"text":{"type":"string","maxLength":32768},"quote":{"type":"object","properties":{"sender":{"type":"string","maxLength":256},"text":{"type":"string","maxLength":32768}},"required":["text"],"additionalProperties":false},"threadId":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"time":{"type":"string","maxLength":64},"truncated":{"type":"boolean","enum":[true]}},"required":["id","sender","text","threadId"],"additionalProperties":false}},"historyOmitted":{"type":"integer","minimum":0,"maximum":9007199254740991},"context":{"type":"object","properties":{"partial":{"type":"boolean"},"reasons":{"maxItems":8,"type":"array","items":{"type":"string","maxLength":64}},"omittedMessages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["partial","reasons","omittedMessages"],"additionalProperties":false}},"required":["currentMessage","history","historyOmitted","context"],"additionalProperties":false},{"type":"null"}]},"fullAnswer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},{"type":"null"}]},"chain":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","maxLength":128},"decisionId":{"type":"string","minLength":1,"maxLength":128},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]}},"required":["stepId","decisionId","evaluation"],"additionalProperties":false}},"rawRequest":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]},"rawResponse":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","properties":{"snapshotSeq":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppliedBackground":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["snapshotSeq","suppliedBackground"],"additionalProperties":false},{"type":"null"}]}},"required":["seq","at","messageId","title","decisionId","outcome","reason","answer","matchedKeys","latencyMs","requestedModel","actualModel","usage","detailsExpired","snapshot","input","fullAnswer","evidence"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/decision-routing/preview":{"post":{"operationId":"previewBotDecisionRouting","summary":"Try shared-bot routing","tags":["Decisions"],"description":"Evaluates a draft routing configuration and draft channel scope against a sample on the bot's evaluation host, for one channel and situation (a new conversation, an explicit mention, or an established thread with participant flags), then settles the targets exactly as the router does: every matched rule's agent, deduplicated, or Otherwise; a constrained situation keeps its recipients or skips. Writes nothing and never stores or logs the sample. Off, outside-scope, paused, Needs review, and unsupported configurations return `not_applied` with the reason and no model call; a situation whose recipients all participate settles with no model call. Returns 503 when the evaluation host is offline or unreachable; a provider failure returns `unavailable` with its continuation, which is never a skip.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},"channelIds":{"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":512}},"channelId":{"type":"string","minLength":1,"maxLength":512},"targets":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["new"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["mention","thread"]},"agentIds":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"participantAgentIds":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["type","agentIds"],"additionalProperties":false}]},"state":{"type":"object","properties":{"history":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"sender":{"type":"string","minLength":1,"maxLength":128},"text":{"type":"string","maxLength":16384}},"required":["sender","text"],"additionalProperties":false}},"currentMessage":{"type":"object","properties":{"sender":{"type":"string","minLength":1,"maxLength":128},"text":{"type":"string","minLength":1,"maxLength":16384}},"required":["text"],"additionalProperties":false}},"required":["history","currentMessage"],"additionalProperties":false}},"required":["config","channelIds","channelId","targets","state"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["live"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","unsupported"]}},"required":["status"],"additionalProperties":false},"evaluation":{"anyOf":[{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]},{"type":"null"}]},"chain":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","maxLength":128},"decisionId":{"type":"string","minLength":1,"maxLength":128},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]}},"required":["stepId","decisionId","evaluation"],"additionalProperties":false}},"consumer":{"type":"object","properties":{"type":{"type":"string","enum":["shared_bot_routing"]},"outcome":{"type":"string","enum":["activate","continue","skip","unavailable","not_applied"]},"notAppliedReason":{"type":"string","enum":["off","outside_scope","paused","needs_review","unsupported"]},"reason":{"type":"string"},"evaluated":{"type":"boolean"},"rules":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"matched":{"type":"boolean"},"matchedKeys":{"type":"array","items":{"type":"string"}}},"required":["ruleId","matched","matchedKeys"],"additionalProperties":false}},"matchedRuleIds":{"type":"array","items":{"type":"string"}},"matchedKeys":{"type":"array","items":{"type":"string"}},"matchedAgentIds":{"type":"array","items":{"type":"string"}},"usedOtherwise":{"type":"boolean"},"fallback":{"anyOf":[{"type":"string","enum":["constrained","default","none"]},{"type":"null"}]},"defaultAgent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"targetConstraint":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["new"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["mention","thread"]},"agentIds":{"type":"array","items":{"type":"string"}},"participantAgentIds":{"type":"array","items":{"type":"string"}}},"required":["type","agentIds"],"additionalProperties":false}]},"targets":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"name":{"type":["string","null"]},"effect":{"type":"string","enum":["participant","kept","selected","default_agent","fallback_constrained","fallback_default"]},"participant":{"type":"boolean"},"via":{"type":"string","enum":["mention","implicit"]},"status":{"type":"string","enum":["available","unavailable","removed"]}},"required":["agentId","name","effect","participant","via","status"],"additionalProperties":false}}},"required":["type","outcome","evaluated","rules","matchedRuleIds","matchedKeys","matchedAgentIds","usedOtherwise","fallback","defaultAgent","targetConstraint","targets"],"additionalProperties":false}},"required":["mode","readiness","evaluation","consumer"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/decision-routing/evaluations":{"get":{"operationId":"listBotDecisionRoutingEvaluations","summary":"List recent routing evaluations","tags":["Decisions"],"description":"Recent shared-bot routing evaluations, newest first, read from the bot's evaluation host and proxied without being stored or logged: the answer, matched rules or Otherwise, each target with its admission status, and the outcome (Routed, Partially routed, Skipped, Fallback, Unavailable, Canceled, Pending). Covers `channelId`, or else every routed channel the bot-level host evaluates (up to 100); `decisionId` optionally filters by the recorded root Decision before paging. Each row is returned only when the caller can read its conversation: the audience of the newest session any bot agent holds there in the namespace the host names, or before any session the organization baseline (closed while an external-access policy is active); refused rows are dropped, so a page may be short while `nextCursor` continues. Each row's `title` names what was judged in one line and is null unless the caller could also read that evaluation's bodies. Returns 503 when the host is offline or must be upgraded, including a reply that names no namespace.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"query","name":"channelId","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"in":"query","name":"cursor","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"decisionId","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"channel":{"type":"string","maxLength":512},"messageId":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["routed","partially_routed","skipped","fallback","unavailable","canceled","pending"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"evaluated":{"type":"boolean"},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"matchedKeys":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"matchedRuleIds":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"usedOtherwise":{"type":"boolean"},"fallback":{"anyOf":[{"type":"string","enum":["constrained","default","none"]},{"type":"null"}]},"targets":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string","minLength":1,"maxLength":128},"effect":{"type":"string","enum":["participant","kept","selected","default_agent","fallback_constrained","fallback_default"]},"via":{"type":"string","enum":["mention","implicit"]},"participant":{"type":"boolean"},"disposition":{"type":"string","enum":["pending","admitted","rejected","unavailable"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["agentId","effect","via","participant","disposition","reason"],"additionalProperties":false}},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"requestedModel":{"type":"string","minLength":1,"maxLength":128},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"}},"required":["seq","at","channel","messageId","title","decisionId","outcome","reason","evaluated","answer","matchedKeys","matchedRuleIds","usedOtherwise","fallback","targets","latencyMs","requestedModel","actualModel","usage","detailsExpired"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/bots/{id}/decision-routing/evaluations/{seq}":{"get":{"operationId":"getBotDecisionRoutingEvaluation","summary":"Get a routing evaluation","tags":["Decisions"],"description":"One routing evaluation with its frozen Decision and routing snapshot, target constraint (agents, participation, and mention or implicit only), input and history, answer, model, usage, the raw provider request and response JSON (from daemons that support it, each capped at 16K characters), and every target's admission status while the host still retains the bodies (bounded to 64 KiB); once stripped, `detailsExpired` is true and only the summary and snapshot remain. Proxied from the evaluation host, never stored or logged, and returned only after the conversation audience check; before any session there names an audience the bodies need edit access to the conversation's owner agent. Returns 404 when the evaluation is gone or unreadable and 503 when the host is offline or must be upgraded, including a reply that names no namespace.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"query","name":"channelId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"path","name":"seq","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"channel":{"type":"string","maxLength":512},"messageId":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["routed","partially_routed","skipped","fallback","unavailable","canceled","pending"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"evaluated":{"type":"boolean"},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"matchedKeys":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"matchedRuleIds":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"usedOtherwise":{"type":"boolean"},"fallback":{"anyOf":[{"type":"string","enum":["constrained","default","none"]},{"type":"null"}]},"targets":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string","minLength":1,"maxLength":128},"effect":{"type":"string","enum":["participant","kept","selected","default_agent","fallback_constrained","fallback_default"]},"via":{"type":"string","enum":["mention","implicit"]},"participant":{"type":"boolean"},"disposition":{"type":"string","enum":["pending","admitted","rejected","unavailable"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["agentId","effect","via","participant","disposition","reason"],"additionalProperties":false}},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"requestedModel":{"type":"string","minLength":1,"maxLength":128},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"},"snapshot":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"routing":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"enabled":{"type":"boolean"},"otherwise":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["default_agent"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false}]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"rules":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","agentId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["decision"]},"nextStepId":{"type":"string","minLength":1,"maxLength":128}},"required":["type","nextStepId"],"additionalProperties":false}]}},"required":["id","when","action"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules","enabled","otherwise"],"additionalProperties":false},"defaultAgentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]}},"required":["decisionId","providerId","model","question","routing","defaultAgentId"],"additionalProperties":false},{"type":"null"}]},"constraint":{"anyOf":[{"maxItems":64,"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string","minLength":1,"maxLength":128},"participant":{"type":"boolean"},"via":{"type":"string","enum":["mention","implicit"]}},"required":["agentId","participant","via"],"additionalProperties":false}},{"type":"null"}]},"input":{"anyOf":[{"type":"object","properties":{"currentMessage":{"type":"object","properties":{"id":{"type":"string","maxLength":256},"sender":{"type":"object","properties":{"id":{"type":"string","maxLength":256}},"required":["id"],"additionalProperties":false},"text":{"type":"string","maxLength":32768},"quote":{"type":"object","properties":{"sender":{"type":"string","maxLength":256},"text":{"type":"string","maxLength":32768}},"required":["text"],"additionalProperties":false},"threadId":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"time":{"type":"string","maxLength":64},"truncated":{"type":"boolean","enum":[true]}},"required":["id","sender","text","threadId"],"additionalProperties":false},"history":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":256},"sender":{"type":"object","properties":{"id":{"type":"string","maxLength":256}},"required":["id"],"additionalProperties":false},"text":{"type":"string","maxLength":32768},"quote":{"type":"object","properties":{"sender":{"type":"string","maxLength":256},"text":{"type":"string","maxLength":32768}},"required":["text"],"additionalProperties":false},"threadId":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"time":{"type":"string","maxLength":64},"truncated":{"type":"boolean","enum":[true]}},"required":["id","sender","text","threadId"],"additionalProperties":false}},"historyOmitted":{"type":"integer","minimum":0,"maximum":9007199254740991},"context":{"type":"object","properties":{"partial":{"type":"boolean"},"reasons":{"maxItems":8,"type":"array","items":{"type":"string","maxLength":64}},"omittedMessages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["partial","reasons","omittedMessages"],"additionalProperties":false}},"required":["currentMessage","history","historyOmitted","context"],"additionalProperties":false},{"type":"null"}]},"fullAnswer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},{"type":"null"}]},"chain":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","maxLength":128},"decisionId":{"type":"string","minLength":1,"maxLength":128},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]}},"required":["stepId","decisionId","evaluation"],"additionalProperties":false}},"rawRequest":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]},"rawResponse":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]}},"required":["seq","at","channel","messageId","title","decisionId","outcome","reason","evaluated","answer","matchedKeys","matchedRuleIds","usedOtherwise","fallback","targets","latencyMs","requestedModel","actualModel","usage","detailsExpired","snapshot","constraint","input","fullAnswer"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/model-evaluations":{"get":{"operationId":"listAgentModelEvaluations","summary":"List recent model selection evaluations","tags":["Decisions"],"description":"Lists this agent's recent session-start model choices from its serving daemon. `decisionId` optionally filters by the recorded root Decision before paging. Rows from sessions the caller cannot view are omitted; each row's `title` is its session's title, with mentions named while the serving daemon still holds the session. Detail bodies expire after 24 hours or 20 newer choices; summaries expire after seven days.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"in":"query","name":"cursor","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"decisionId","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"sessionId":{"type":"string","minLength":1,"maxLength":128},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["selected","fallback"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"target":{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"}},"required":["runtime","model"],"additionalProperties":false},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"requestedModel":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"}},"required":["seq","at","sessionId","title","decisionId","outcome","reason","target","answer","requestedModel","actualModel","latencyMs","usage","detailsExpired"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{id}/model-evaluations/{seq}":{"get":{"operationId":"getAgentModelEvaluation","summary":"Get a model selection evaluation","tags":["Decisions"],"description":"Reads a frozen session-start model choice from the serving daemon after checking the session audience. Returns the retained answer, rules, input, and provider JSON when still available.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"in":"path","name":"seq","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"sessionId":{"type":"string","minLength":1,"maxLength":128},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["selected","fallback"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"target":{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"}},"required":["runtime","model"],"additionalProperties":false},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"requestedModel":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"},"selection":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"minItems":1,"maxItems":32,"type":"array","items":{"anyOf":[{"type":"object","properties":{"runtime":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":256},"effort":{"type":"string","maxLength":128},"permissionMode":{"type":"string","minLength":1,"maxLength":128},"fastMode":{"type":"boolean"},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["runtime","model","when"],"additionalProperties":false},{"type":"object","properties":{"nextStepId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]}},"required":["nextStepId","when"],"additionalProperties":false}]}},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","rules","id"],"additionalProperties":false}}},"required":["decisionId","rules"],"additionalProperties":false},{"type":"null"}]},"question":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},{"type":"null"}]},"input":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"fullAnswer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},{"type":"null"}]},"chain":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","maxLength":128},"decisionId":{"type":"string","minLength":1,"maxLength":128},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]}},"required":["stepId","decisionId","evaluation"],"additionalProperties":false}},"rawRequest":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]},"rawResponse":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]}},"required":["seq","at","sessionId","title","decisionId","outcome","reason","target","answer","requestedModel","actualModel","latencyMs","usage","detailsExpired","selection","question","input","fullAnswer","rawRequest","rawResponse"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/{id}/channels/{channelId}/decision-preview":{"post":{"operationId":"previewIntegrationChannelDecision","summary":"Try a conversation gate","tags":["Decisions"],"description":"Evaluates a draft By decision gate against a sample (history lines with sender ids and a current message) on the daemon serving the conversation's consumer agent, then applies the draft condition. Writes nothing: no observation, verdict, or session, and the sample is never stored. Off, unsupported, and Needs review gates return `not_applied` without a model call. Returns 503 when no serving daemon is connected; a provider failure returns `unavailable`, which continues to the target and never means skip.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decisionBinding":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["gate"]},"steps":{"maxItems":7,"type":"array","items":{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"when":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"nextStepId":{"type":"string","minLength":1,"maxLength":128},"elseStepId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["decisionId","when","id"],"additionalProperties":false}}},"required":["decisionId","when","type"],"additionalProperties":false},"state":{"type":"object","properties":{"history":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"sender":{"type":"string","minLength":1,"maxLength":128},"text":{"type":"string","maxLength":16384}},"required":["sender","text"],"additionalProperties":false}},"currentMessage":{"type":"object","properties":{"sender":{"type":"string","minLength":1,"maxLength":128},"text":{"type":"string","minLength":1,"maxLength":16384}},"required":["text"],"additionalProperties":false}},"required":["history","currentMessage"],"additionalProperties":false}},"required":["decisionBinding","state"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"channelId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["live"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","pending_sync","needs_review","daemon_offline","unsupported"]}},"required":["status"],"additionalProperties":false},"evaluation":{"anyOf":[{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]},{"type":"null"}]},"chain":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","maxLength":128},"decisionId":{"type":"string","minLength":1,"maxLength":128},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]}},"required":["stepId","decisionId","evaluation"],"additionalProperties":false}},"consumer":{"type":"object","properties":{"type":{"type":"string","enum":["gate"]},"outcome":{"type":"string","enum":["trigger","skip","unavailable","not_applied"]},"notAppliedReason":{"type":"string","enum":["off","unsupported","needs_review"]},"reason":{"type":"string"},"matched":{"type":"boolean"},"matchedKeys":{"type":"array","items":{"type":"string"}},"target":{"type":"object","properties":{"agentId":{"type":"string"},"name":{"type":"string"}},"required":["agentId","name"],"additionalProperties":false}},"required":["type","outcome","matched","matchedKeys","target"],"additionalProperties":false}},"required":["mode","readiness","evaluation","consumer"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/{id}/channels/{channelId}/decision-evaluations":{"get":{"operationId":"listIntegrationChannelDecisionEvaluations","summary":"List recent conversation evaluations","tags":["Decisions"],"description":"Recent By decision evaluations for one conversation, newest first, read from the serving daemon and proxied without being stored or logged. `decisionId` optionally filters by the recorded root Decision before paging. The caller must be able to read the conversation: the audience of its newest session in the namespace (platform and tenant scope) the serving daemon names for the install, or, before any session exists there, the organization baseline (closed while an external-access policy is active); the check runs on the reply before anything is returned. Each row's `title` names what was judged in one line and is null unless the caller could also read that evaluation's bodies. Pages by `cursor` (the previous page's `nextCursor`) up to 50 rows and 32 KiB. Returns 503 when the serving daemon is offline, including while its connection to the install has not yet reported the tenant scope, or must be upgraded, including a reply that names no namespace.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"in":"query","name":"cursor","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"decisionId","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"channelId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"messageId":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["triggered","skipped","unavailable","canceled","pending"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"matchedKeys":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"requestedModel":{"type":"string","minLength":1,"maxLength":128},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"}},"required":["seq","at","messageId","title","decisionId","outcome","reason","answer","matchedKeys","latencyMs","requestedModel","actualModel","usage","detailsExpired"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/integrations/{id}/channels/{channelId}/decision-evaluations/{seq}":{"get":{"operationId":"getIntegrationChannelDecisionEvaluation","summary":"Get a conversation evaluation","tags":["Decisions"],"description":"One evaluation with its frozen Decision and condition snapshot, input and history, answer, model, usage, the raw provider request and response JSON (from daemons that support it, each capped at 16K characters), and evidence while the daemon still retains the bodies (bounded to 64 KiB); once stripped, `detailsExpired` is true and only the summary and snapshot remain. Proxied from the serving daemon, never stored or logged, and returned only after the conversation audience check on the namespace the daemon names for the install; before any session there names an audience the bodies need edit access to the consumer agent rather than the organization read baseline. Returns 404 when the evaluation is gone and 503 when the daemon is offline, including while its connection to the install has not yet reported the tenant scope, or must be upgraded, including a reply that names no namespace.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"path","name":"channelId","required":true},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"path","name":"seq","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string","maxLength":64},"messageId":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"decisionId":{"type":"string","minLength":1,"maxLength":128},"outcome":{"type":"string","enum":["triggered","skipped","unavailable","canceled","pending"]},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"answer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","confidence"],"additionalProperties":false}]},{"type":"null"}]},"matchedKeys":{"maxItems":32,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"requestedModel":{"type":"string","minLength":1,"maxLength":128},"actualModel":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false},{"type":"null"}]},"detailsExpired":{"type":"boolean"},"snapshot":{"anyOf":[{"type":"object","properties":{"decisionId":{"type":"string","minLength":1,"maxLength":128},"providerId":{"type":"string","minLength":1,"maxLength":128},"model":{"type":"string","minLength":1,"maxLength":128},"question":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"instructions":{"type":"string","minLength":1},"criteria":{"type":"object","properties":{"true":{"type":"string","minLength":1},"false":{"type":"string","minLength":1}},"required":["true","false"],"additionalProperties":false}},"required":["type","instructions","criteria"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"instructions":{"type":"string","minLength":1},"criteria":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}},"required":["type","instructions","criteria"],"additionalProperties":false}]},"condition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"thresholds":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","thresholds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"values":{"maxItems":2,"type":"array","items":{"type":"boolean"}}},"required":["type","values"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["type","min","max"],"additionalProperties":false}]},"sessionMode":{"type":"string","maxLength":64}},"required":["decisionId","providerId","model","question","condition","sessionMode"],"additionalProperties":false},{"type":"null"}]},"input":{"anyOf":[{"type":"object","properties":{"currentMessage":{"type":"object","properties":{"id":{"type":"string","maxLength":256},"sender":{"type":"object","properties":{"id":{"type":"string","maxLength":256}},"required":["id"],"additionalProperties":false},"text":{"type":"string","maxLength":32768},"quote":{"type":"object","properties":{"sender":{"type":"string","maxLength":256},"text":{"type":"string","maxLength":32768}},"required":["text"],"additionalProperties":false},"threadId":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"time":{"type":"string","maxLength":64},"truncated":{"type":"boolean","enum":[true]}},"required":["id","sender","text","threadId"],"additionalProperties":false},"history":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":256},"sender":{"type":"object","properties":{"id":{"type":"string","maxLength":256}},"required":["id"],"additionalProperties":false},"text":{"type":"string","maxLength":32768},"quote":{"type":"object","properties":{"sender":{"type":"string","maxLength":256},"text":{"type":"string","maxLength":32768}},"required":["text"],"additionalProperties":false},"threadId":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}]},"time":{"type":"string","maxLength":64},"truncated":{"type":"boolean","enum":[true]}},"required":["id","sender","text","threadId"],"additionalProperties":false}},"historyOmitted":{"type":"integer","minimum":0,"maximum":9007199254740991},"context":{"type":"object","properties":{"partial":{"type":"boolean"},"reasons":{"maxItems":8,"type":"array","items":{"type":"string","maxLength":64}},"omittedMessages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["partial","reasons","omittedMessages"],"additionalProperties":false}},"required":["currentMessage","history","historyOmitted","context"],"additionalProperties":false},{"type":"null"}]},"fullAnswer":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},{"type":"null"}]},"chain":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","maxLength":128},"decisionId":{"type":"string","minLength":1,"maxLength":128},"evaluation":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["answered"]},"answer":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"value":{"type":"boolean"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probability"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"value":{"type":"string","minLength":1,"maxLength":64},"probabilities":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"value":{"type":"number","minimum":0},"probabilities":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["type","value","probabilities","confidence"],"additionalProperties":false}]},"model":{"type":"string","minLength":1,"maxLength":128},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["inputTokens","outputTokens"],"additionalProperties":false}},"required":["status","answer","model","usage"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["timeout","capacity","credentials","provider","invalid_response","unsupported_input"]}},"required":["status","reason"],"additionalProperties":false}]}},"required":["stepId","decisionId","evaluation"],"additionalProperties":false}},"rawRequest":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]},"rawResponse":{"anyOf":[{"type":"object","properties":{"text":{"type":"string","maxLength":16384},"truncated":{"type":"boolean"}},"required":["text","truncated"],"additionalProperties":false},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","properties":{"snapshotSeq":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppliedBackground":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["snapshotSeq","suppliedBackground"],"additionalProperties":false},{"type":"null"}]}},"required":["seq","at","messageId","title","decisionId","outcome","reason","answer","matchedKeys","latencyMs","requestedModel","actualModel","usage","detailsExpired","snapshot","input","fullAnswer","evidence"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/provider-keys":{"get":{"operationId":"listProviderKeys","summary":"List provider key status","tags":["Provider keys"],"description":"Lists provider profiles, configured endpoints, header names, and organization key status. Never returns secret values or validates credentials upstream.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["typesafe","openrouter","cloudflare"]},"name":{"type":"string"},"defaultEndpoint":{"type":["string","null"]},"endpointRequired":{"type":"boolean"},"endpoint":{"type":["string","null"]},"headerNames":{"type":"array","items":{"type":"string"}},"configured":{"type":"boolean"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["provider","name","defaultEndpoint","endpointRequired","endpoint","headerNames","configured","updatedAt"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/provider-keys/{provider}":{"put":{"operationId":"setProviderKey","summary":"Set an organization provider key","tags":["Provider keys"],"description":"Owner-only. Saves an API key, endpoint, and a header patch atomically. The first save requires a key; omitted secrets are retained and null header values remove headers. Cloudflare requires an endpoint on each save. Key and header values are write-only and use the configured secret cipher.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","minLength":1,"maxLength":8192,"pattern":"^\\S+$"},"endpoint":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"headers":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":8192,"pattern":"^[\\t\\x20-\\x7e]+$"},{"type":"null"}]}}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["typesafe","openrouter","cloudflare"]},"in":"path","name":"provider","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["typesafe","openrouter","cloudflare"]},"name":{"type":"string"},"defaultEndpoint":{"type":["string","null"]},"endpointRequired":{"type":"boolean"},"endpoint":{"type":["string","null"]},"headerNames":{"type":"array","items":{"type":"string"}},"configured":{"type":"boolean"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["provider","name","defaultEndpoint","endpointRequired","endpoint","headerNames","configured","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteProviderKey","summary":"Remove an organization provider key","tags":["Provider keys"],"description":"Owner-only. Removes the stored key idempotently. This does not revoke the credential at its provider.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","enum":["typesafe","openrouter","cloudflare"]},"in":"path","name":"provider","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/mcp-providers":{"get":{"operationId":"listMcpProviders","summary":"List MCP providers","tags":["MCP providers"],"description":"Every MCP provider in the active organization (metadata + upstream header names only).","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt"],"additionalProperties":false}}}}}}},"post":{"operationId":"createMcpProvider","summary":"Register an MCP provider","tags":["MCP providers"],"description":"Register an org-level upstream MCP server (http transport, org visibility) and mint its bearer grant key. The grant key is returned exactly once and is never retrievable afterward; upstream header values go in and never come back. Rejected with 409 while any agent already enables an MCP server under the requested name — agents bind by name, so a new provider must not silently capture existing selections.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"url":{"type":"string","minLength":1},"transport":{"type":"string","enum":["http","sse"]},"ui":{"type":"boolean"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"auth":{"type":"string","enum":["headers","oauth2"]},"headers":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","minLength":1}},"required":["name","value"]}}},"required":["name","url"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"},"grantKey":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt","grantKey"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/mcp-providers/{id}":{"get":{"operationId":"getMcpProvider","summary":"Get an MCP provider","tags":["MCP providers"],"description":"Fetch a single MCP provider by id (scoped to the caller's org; a cross-org id reads as 404). Header values and the grant key are never returned.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateMcpProvider","summary":"Update an MCP provider","tags":["MCP providers"],"description":"Edit an MCP provider’s url and/or upstream headers. `headers` replaces the stored set wholesale; a changed url passes the SSRF gate. Name, transport, and visibility are immutable through this surface (agents bind by name; recreate to rename).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1},"headers":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","minLength":1}},"required":["name","value"]}},"ui":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteMcpProvider","summary":"Delete an MCP provider","tags":["MCP providers"],"description":"Delete an MCP provider, unbind it from relays/daemons, and cascade-drop its upstream secret and grants. Rejected with 409 while any agent still enables it — unselect it from those agents first.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/mcp-providers/{id}/grant/rotate":{"post":{"operationId":"rotateMcpProviderGrant","summary":"Rotate an MCP provider grant key","tags":["MCP providers"],"description":"Mint a fresh bearer grant key for the provider and retire the previous one. The new key + binding are pushed to relays and daemons before the old grant is revoked (grace-safe). Like create, the new grant key is returned exactly once and is never retrievable afterward.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"},"grantKey":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt","grantKey"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/mcp-providers/{id}/sharing":{"put":{"operationId":"setMcpProviderSharing","summary":"Set MCP provider sharing","tags":["MCP providers"],"description":"Set an MCP provider’s visibility (Everyone vs Selected) and complete Selected audience. Requires edit rights; Selected must retain at least one current organization member, and sharedWith is intersected with current membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string"}}},"required":["visibility"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/mcp-providers/{id}/oauth/start":{"post":{"operationId":"startMcpProviderOauth","summary":"Start MCP provider authorization","tags":["MCP providers"],"description":"Discover the provider's authorization server, obtain a client identity, and return a URL the console opens in a popup to complete OAuth. Supplying `clientId` uses a pre-registered client instead of dynamic registration. Requires a deployment public CP URL, since the callback is registered with the authorization server.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnPath":{"type":"string","maxLength":512},"clientId":{"type":"string","minLength":1,"maxLength":512},"clientSecret":{"type":"string","minLength":1,"maxLength":2048}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/mcp-providers/{id}/oauth/disconnect":{"post":{"operationId":"disconnectMcpProviderOauth","summary":"Disconnect an MCP provider grant","tags":["MCP providers"],"description":"Drop the stored OAuth grant and stop projecting it into the relay binding. The provider row and its grant key stay, so re-authorizing restores it without any agent having to re-select the provider.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/skill-sources":{"get":{"operationId":"listSkillSources","summary":"List skill sources","tags":["Skill sources"],"description":"Every shared-skills source in the active organization (metadata only; content stays daemon-side).","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"githubRepoId":{"type":["string","null"]},"ref":{"type":["string","null"]},"subDir":{"type":["string","null"]},"skills":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","source","githubRepoId","ref","subDir","skills","private","visibility","sharedWith","createdBy","canEdit","canManageSharing","createdAt"],"additionalProperties":false}}}}}}},"post":{"operationId":"createSkillSource","summary":"Register a skill source","tags":["Skill sources"],"description":"Register an org-level GitHub skill source. The numeric repository identity is resolved server-side (org installation first, then a public read), so no client needs to know it; `githubRepoId` in the body only overrides that lookup. A private repository is accepted when the org GitHub App installation covers its owner: the row is marked `private` and daemons acquire it with a read-only installation token minted for every agent that enables the source. A repository that cannot be identified is rejected — 400 when GitHub says it does not exist, 503 while GitHub is unreachable — rather than persisted as a row the projection would silently drop. The daemon acquires a bounded local snapshot; the remote source is never passed to the CLI. `skills` empty ⇒ install every skill the snapshot exposes. Rejected with 409 while any agent already enables skills under the requested source name — agents bind by name, so a new source must not silently capture existing selections.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9._-]+$"},"source":{"type":"string","minLength":1,"maxLength":512},"githubRepoId":{"type":"string","pattern":"^[1-9]\\d*$"},"ref":{"type":"string","minLength":1,"maxLength":256},"subDir":{"type":"string","minLength":1,"maxLength":1024},"skills":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9._-]{0,126}[a-z0-9_])?$"}},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}}},"required":["name","source"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"githubRepoId":{"type":["string","null"]},"ref":{"type":["string","null"]},"subDir":{"type":["string","null"]},"skills":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","source","githubRepoId","ref","subDir","skills","private","visibility","sharedWith","createdBy","canEdit","canManageSharing","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/skill-sources/registry/search":{"get":{"operationId":"searchSkillRegistry","summary":"Search the skills.sh registry","tags":["Skill sources"],"description":"Look up installable skills by name in the public skills.sh index. Each hit carries the `owner/repo` source plus the skill directory name, ready to be registered with POST /skill-sources. Discovery only — nothing is persisted, and `reachable:false` (empty list) means the index could not be read rather than that nothing matched.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120},"in":"query","name":"q","required":true},{"schema":{"type":"string","pattern":"^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$"},"in":"query","name":"owner","required":false},{"schema":{"default":10,"type":"integer","minimum":1,"maximum":25},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"reachable":{"type":"boolean"},"skills":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"installs":{"type":["number","null"]}},"required":["id","name","source","installs"],"additionalProperties":false}}},"required":["reachable","skills"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/skill-sources/{id}":{"get":{"operationId":"getSkillSource","summary":"Get a skill source","tags":["Skill sources"],"description":"Fetch a single skill source by id (scoped to the caller's org; a cross-org id reads as 404).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"githubRepoId":{"type":["string","null"]},"ref":{"type":["string","null"]},"subDir":{"type":["string","null"]},"skills":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","source","githubRepoId","ref","subDir","skills","private","visibility","sharedWith","createdBy","canEdit","canManageSharing","createdAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateSkillSource","summary":"Update a skill source","tags":["Skill sources"],"description":"Edit a source’s source string, ref, subdir, or skill filter. `skills` replaces the stored filter wholesale. Name is immutable (agents bind by name; recreate to rename). Changes re-push every agent that enables this source. The numeric repository identity is re-resolved when the source changes or the row never had one — which is how a historical unbound row is repaired — and clearing it is refused, since an unbound source can never install.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":512},"githubRepoId":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d*$"},{"type":"null"}]},"ref":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"subDir":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024},{"type":"null"}]},"skills":{"maxItems":64,"type":"array","items":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9._-]{0,126}[a-z0-9_])?$"}}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"githubRepoId":{"type":["string","null"]},"ref":{"type":["string","null"]},"subDir":{"type":["string","null"]},"skills":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","source","githubRepoId","ref","subDir","skills","private","visibility","sharedWith","createdBy","canEdit","canManageSharing","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteSkillSource","summary":"Delete a skill source","tags":["Skill sources"],"description":"Delete a skill source. Rejected with 409 while any agent still enables it — unselect it from those agents first.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/skill-sources/{id}/skills":{"get":{"operationId":"listSkillSourceSkills","summary":"List a skill source’s skills","tags":["Skill sources"],"description":"Best-effort scan of the source repo for its SKILL.md manifest, for the per-agent skill picker. Returns resolvable:false + an empty list when the source is not a scannable GitHub repo reachable by an installation (the UI then offers whole-source enablement only).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"resolvable":{"type":"boolean"},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dirPath":{"type":"string"}},"required":["name","dirPath"],"additionalProperties":false}}},"required":["resolvable","skills"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/skill-sources/preview":{"post":{"operationId":"previewSkillSource","summary":"Preview a GitHub skill source","tags":["Skill sources"],"description":"Best-effort scan of a repo for the import dialog: branch + tag choices and the SKILL.md manifest. Requires a GitHub App installation reachable by the caller; scan failure yields an empty skill list (install all).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"string"},"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1},"ref":{"type":"string"}},"required":["installationId","owner","repo"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"branches":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dirPath":{"type":"string"}},"required":["name","dirPath"],"additionalProperties":false}}},"required":["branches","tags","skills"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/skill-sources/{id}/sharing":{"put":{"operationId":"setSkillSourceSharing","summary":"Set skill source sharing","tags":["Skill sources"],"description":"Set a skill source’s visibility (Everyone vs Selected) and complete Selected audience. Requires edit rights; Selected must retain at least one current organization member, and sharedWith is intersected with current membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string"}}},"required":["visibility"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"githubRepoId":{"type":["string","null"]},"ref":{"type":["string","null"]},"subDir":{"type":["string","null"]},"skills":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","source","githubRepoId","ref","subDir","skills","private","visibility","sharedWith","createdBy","canEdit","canManageSharing","createdAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge":{"get":{"operationId":"listOrganizationKnowledge","summary":"List accepted organization knowledge","tags":["Organization knowledge"],"description":"Lists the current accepted knowledge revision visible to every member of the organization.","parameters":[{"schema":{"type":"string"},"in":"query","name":"includeArchived","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revisionCreatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","title","content","summary","tags","currentRevision","digest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","archivedAt","createdAt","updatedAt","revisionCreatedAt","canManage"],"additionalProperties":false}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createOrganizationKnowledge","summary":"Publish organization knowledge manually","tags":["Organization knowledge"],"description":"Publishes the first immutable revision of an owner-authored organization knowledge entry.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":128},"content":{"type":"string","minLength":1,"maxLength":262144},"summary":{"type":"string","maxLength":1024},"tags":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["title","content"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revisionCreatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","title","content","summary","tags","currentRevision","digest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","archivedAt","createdAt","updatedAt","revisionCreatedAt","canManage"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge/{id}":{"get":{"operationId":"getOrganizationKnowledge","summary":"Get organization knowledge","tags":["Organization knowledge"],"description":"Returns the current accepted revision of one organization knowledge entry.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revisionCreatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","title","content","summary","tags","currentRevision","digest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","archivedAt","createdAt","updatedAt","revisionCreatedAt","canManage"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateOrganizationKnowledge","summary":"Publish a new immutable knowledge revision","tags":["Organization knowledge"],"description":"Publishes an owner-authored revision using optimistic revision fencing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":128},"content":{"type":"string","minLength":1,"maxLength":262144},"summary":{"type":"string","maxLength":1024},"tags":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["title","content","expectedRevision"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revisionCreatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","title","content","summary","tags","currentRevision","digest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","archivedAt","createdAt","updatedAt","revisionCreatedAt","canManage"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge/{id}/revisions":{"get":{"operationId":"listOrganizationKnowledgeRevisions","summary":"List immutable organization knowledge revisions","tags":["Organization knowledge"],"description":"Lists every immutable revision and its provenance, newest first.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"knowledgeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"digest":{"type":"string"},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["knowledgeId","revision","content","summary","tags","digest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","createdAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge/{id}/archive":{"post":{"operationId":"archiveOrganizationKnowledge","summary":"Archive or restore organization knowledge","tags":["Organization knowledge"],"description":"Archives or restores an organization knowledge entry without deleting its revisions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"boolean"}},"required":["archived"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"revisionCreatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","title","content","summary","tags","currentRevision","digest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","archivedAt","createdAt","updatedAt","revisionCreatedAt","canManage"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/managed-skills":{"get":{"operationId":"listManagedSkills","summary":"List accepted managed Agent Skills bundles","tags":["Organization knowledge"],"description":"Lists current centrally approved managed Agent Skills bundles for the organization.","parameters":[{"schema":{"type":"string"},"in":"query","name":"includeArchived","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"compressedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"expandedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"manifest":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","name","description","currentRevision","digest","compressedBytes","expandedBytes","fileCount","manifest","archivedAt","createdAt","updatedAt","canManage"],"additionalProperties":false}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/managed-skills/{id}":{"get":{"operationId":"getManagedSkill","summary":"Get a managed Agent Skills bundle","tags":["Organization knowledge"],"description":"Returns the current approved metadata for one managed Agent Skills bundle.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"compressedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"expandedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"manifest":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","name","description","currentRevision","digest","compressedBytes","expandedBytes","fileCount","manifest","archivedAt","createdAt","updatedAt","canManage"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/managed-skills/{id}/revisions":{"get":{"operationId":"listManagedSkillRevisions","summary":"List immutable managed skill revisions","tags":["Organization knowledge"],"description":"Lists every immutable managed-skill revision with bundle metadata and provenance.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"managedSkillId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"compressedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"expandedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"manifest":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"source":{"type":"string","enum":["manual","dream"]},"sourceAgentId":{"type":["string","null"]},"sourceDreamId":{"type":["string","null"]},"sourceSessionIds":{"type":"array","items":{"type":"string"}},"createdByUserId":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["managedSkillId","revision","digest","compressedBytes","expandedBytes","fileCount","manifest","source","sourceAgentId","sourceDreamId","sourceSessionIds","createdByUserId","reviewedByUserId","createdAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/managed-skills/{id}/archive":{"post":{"operationId":"archiveManagedSkill","summary":"Archive or restore a managed Agent Skills bundle","tags":["Organization knowledge"],"description":"Archives or restores a managed skill and reconciles agents that enable it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"boolean"}},"required":["archived"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"currentRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"digest":{"type":"string"},"compressedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"expandedBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"manifest":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","name","description","currentRevision","digest","compressedBytes","expandedBytes","fileCount","manifest","archivedAt","createdAt","updatedAt","canManage"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge-suggestions":{"get":{"operationId":"listOrganizationKnowledgeSuggestions","summary":"List retained Dream suggestions","tags":["Organization knowledge"],"description":"Lists owner-reviewable Dream suggestion metadata retained by the control plane.","parameters":[{"schema":{"type":"string","enum":["knowledge","skill"]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","enum":["pending","accepted","rejected"]},"in":"query","name":"state","required":false},{"schema":{"type":"string","maxLength":128},"in":"query","name":"query","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceAgentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceAgentName":{"type":["string","null"]},"sourceDaemonId":{"type":["string","null"]},"dreamId":{"type":"string"},"candidateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["knowledge","skill"]},"operation":{"type":"string","enum":["create","update"]},"targetArtifactId":{"type":["string","null"]},"targetRevision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"title":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"digest":{"type":"string"},"contentBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"sessionIds":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["pending","accepted","rejected"]},"contentAvailable":{"type":"boolean"},"reviewedAt":{"type":["string","null"]},"reviewReason":{"type":["string","null"]},"acceptedArtifactId":{"type":["string","null"]},"acceptedArtifactRevision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","sourceAgentId","sourceAgentName","sourceDaemonId","dreamId","candidateId","kind","operation","targetArtifactId","targetRevision","title","summary","tags","digest","contentBytes","sessionIds","state","contentAvailable","reviewedAt","reviewReason","acceptedArtifactId","acceptedArtifactRevision","createdAt","updatedAt"],"additionalProperties":false}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge-suggestions/{id}/content":{"get":{"operationId":"readOrganizationKnowledgeSuggestion","summary":"Read one daemon-local suggestion body","tags":["Organization knowledge"],"description":"Reads and verifies the staged body and returns a token binding the inspected snapshot.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["knowledge"]},"digest":{"type":"string"},"snapshotToken":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"content":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}}},"required":["kind","digest","snapshotToken","content","summary","tags"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["skill"]},"digest":{"type":"string"},"snapshotToken":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"encoding":{"type":"string","enum":["utf8","base64"]},"content":{"type":"string"}},"required":["path","encoding","content"],"additionalProperties":false}}},"required":["kind","digest","snapshotToken","files"],"additionalProperties":false}]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/knowledge-suggestions/{id}/review":{"post":{"operationId":"reviewOrganizationKnowledgeSuggestion","summary":"Accept or reject one Dream suggestion","tags":["Organization knowledge"],"description":"Records an owner decision; acceptance requires the exact token returned during inspection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["accept"]},"snapshotToken":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["decision","snapshotToken"],"additionalProperties":false},{"type":"object","properties":{"decision":{"type":"string","enum":["reject"]},"reason":{"type":"string","maxLength":1024}},"required":["decision"],"additionalProperties":false}]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceAgentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceAgentName":{"type":["string","null"]},"sourceDaemonId":{"type":["string","null"]},"dreamId":{"type":"string"},"candidateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["knowledge","skill"]},"operation":{"type":"string","enum":["create","update"]},"targetArtifactId":{"type":["string","null"]},"targetRevision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"title":{"type":"string"},"summary":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"digest":{"type":"string"},"contentBytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"sessionIds":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["pending","accepted","rejected"]},"contentAvailable":{"type":"boolean"},"reviewedAt":{"type":["string","null"]},"reviewReason":{"type":["string","null"]},"acceptedArtifactId":{"type":["string","null"]},"acceptedArtifactRevision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","sourceAgentId","sourceAgentName","sourceDaemonId","dreamId","candidateId","kind","operation","targetArtifactId","targetRevision","title","summary","tags","digest","contentBytes","sessionIds","state","contentAvailable","reviewedAt","reviewReason","acceptedArtifactId","acceptedArtifactRevision","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/environment":{"get":{"operationId":"listOrganizationEnvironment","summary":"List organization variables and secrets","tags":["Organization variables & secrets"],"description":"Lists the organization environment registry. Owner-only. Variable values are returned; secret values never are — only whether material is stored. Bindings are filtered to agents the caller can view.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"kind":{"type":"string","enum":["variable","secret"]},"variableValue":{"type":"string"},"secretConfigured":{"type":"boolean"},"audience":{"type":"string","enum":["all","selected"]},"visibleAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","kind","audience","visibleAgentIds","version","createdAt","updatedAt"],"additionalProperties":false}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createOrganizationEnvironmentEntry","summary":"Create an organization variable or secret","tags":["Organization variables & secrets"],"description":"Defines one organization-owned entry and targets it at all agents or a selected set. A secret value is write-only: it is accepted here and never returned. `all` enrolls every agent the caller may edit and auto-enrolls agents on later authorized configuration writes; it never reaches an agent the caller cannot manage, and it skips an agent placed on a daemon that does not yet support organization environment entries (that agent enrolls on a later configuration write once its daemon is upgraded). `key` and `kind` are immutable afterwards.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"kind":{"type":"string","enum":["variable","secret"]},"value":{"type":"string","maxLength":65536},"audience":{"type":"string","enum":["all","selected"]},"agentIds":{"maxItems":512,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["key","kind","value","audience"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"kind":{"type":"string","enum":["variable","secret"]},"variableValue":{"type":"string"},"secretConfigured":{"type":"boolean"},"audience":{"type":"string","enum":["all","selected"]},"visibleAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","kind","audience","visibleAgentIds","version","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/environment/{entryId}":{"patch":{"operationId":"updateOrganizationEnvironmentEntry","summary":"Replace a value or retarget an organization entry","tags":["Organization variables & secrets"],"description":"Replaces the value and/or changes the audience under `expectedVersion`. An omitted value leaves it unchanged, which is how the Console keeps an existing secret while editing other fields. Switching to `all` enrolls every agent the caller may edit (skipping agents on daemons that do not yet support organization environment entries) and keeps existing delegated bindings; switching to `selected` stops automatic enrollment without revoking bindings to private agents the caller cannot see. `key` and `kind` cannot change — rename or convert by deleting and recreating.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"value":{"type":"string","maxLength":65536},"audience":{"type":"string","enum":["all","selected"]}},"required":["expectedVersion"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"entryId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"kind":{"type":"string","enum":["variable","secret"]},"variableValue":{"type":"string"},"secretConfigured":{"type":"boolean"},"audience":{"type":"string","enum":["all","selected"]},"visibleAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","kind","audience","visibleAgentIds","version","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteOrganizationEnvironmentEntry","summary":"Delete an organization variable or secret","tags":["Organization variables & secrets"],"description":"Removes the entry and every binding it had, exercising the authority each binding already delegated. The agents that were receiving it are not disclosed. Each affected daemon then receives a full snapshot without the key, so any same-key agent-local row becomes effective again. A process already running keeps the old value until its next safe replacement point.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"entryId","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/environment/{entryId}/agents/{agentId}":{"put":{"operationId":"assignOrganizationEnvironmentEntry","summary":"Assign an organization entry to one agent","tags":["Organization variables & secrets"],"description":"Idempotently binds the entry to one agent. Valid only while the entry targets selected agents. Requires `resource.edit` on the target, not merely `resource.view` — an agent the caller cannot manage returns 404, identical to a missing one. The binding is a durable delegation: organization environment managers may afterwards rotate the entry without gaining visibility into this agent.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"entryId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"kind":{"type":"string","enum":["variable","secret"]},"variableValue":{"type":"string"},"secretConfigured":{"type":"boolean"},"audience":{"type":"string","enum":["all","selected"]},"visibleAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","kind","audience","visibleAgentIds","version","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"unassignOrganizationEnvironmentEntry","summary":"Unassign an organization entry from one agent","tags":["Organization variables & secrets"],"description":"Idempotently removes one binding. Valid only while the entry targets selected agents, and requires `resource.edit` on the target. The agent then receives a full snapshot without the key, so a retained same-key agent-local row becomes effective again without re-entering its value.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"entryId","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"kind":{"type":"string","enum":["variable","secret"]},"variableValue":{"type":"string"},"secretConfigured":{"type":"boolean"},"audience":{"type":"string","enum":["all","selected"]},"visibleAgentIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","kind","audience","visibleAgentIds","version","createdAt","updatedAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/connectors/config":{"get":{"operationId":"getConnectorsConfig","summary":"Connectors feature status","tags":["MCP providers"],"description":"Whether the open-connector integration is configured on this CP (drives the Add menu).","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/connectors/catalog":{"get":{"operationId":"listConnectorProviders","summary":"Browse connector providers","tags":["MCP providers"],"description":"The open-connector provider catalog, filtered to connectable providers (non-OAuth, or OAuth with a configured client secret), the provider whitelist, and the provider blocklist. 404 when the integration is not configured.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"service":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"authTypes":{"type":"array","items":{"type":"string"}},"auth":{"type":"array","items":{}},"homepageUrl":{"type":"string"},"iconUrl":{"type":"string"}},"required":["service","displayName","categories","authTypes","auth"],"additionalProperties":false}}},"required":["providers"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/connectors/connections":{"post":{"operationId":"createConnectorConnection","summary":"Create a connector connection","tags":["MCP providers"],"description":"Provision a new open-connector connection and record it as an open_connector MCP provider (named connectionName, org-unique). For api-key/custom/no-auth the credentials are saved immediately; for oauth2 an authorizationUrl is returned to open in a popup. The grant key is returned exactly once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"string","minLength":1},"connectionName":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$"},"authType":{"type":"string","enum":["oauth2","api_key","custom_credential","no_auth"]},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}}},"required":["service","connectionName","authType"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"transport":{"type":"string"},"url":{"type":"string"},"service":{"type":"string"},"visibility":{"type":"string"},"sharedWith":{"type":"array","items":{"type":"string"}},"ui":{"type":"boolean"},"createdBy":{"type":["string","null"]},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"},"headerNames":{"type":"array","items":{"type":"string"}},"auth":{"type":"string"},"oauth":{"type":"object","properties":{"status":{"type":"string"},"issuer":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"clientSource":{"type":"string"},"expiresAt":{"type":["string","null"]}},"required":["status","issuer","scopes","clientSource","expiresAt"],"additionalProperties":false},"createdAt":{"type":"string"},"grantKey":{"type":"string"},"authorizationUrl":{"type":"string"}},"required":["id","name","kind","transport","url","visibility","sharedWith","ui","createdBy","canEdit","canManageSharing","headerNames","auth","createdAt","grantKey"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/connectors/connections/{id}/reconnect":{"post":{"operationId":"reconnectConnectorConnection","summary":"Reconnect a connector connection","tags":["MCP providers"],"description":"Re-run authorization (oauth2) or re-save credentials (api-key/custom) for an existing open_connector connection — for when its upstream token expired/was revoked or the api key rotated. The provider row, grant key, and relay binding are untouched; the service + connection profile are re-derived from the stored binding markers. For oauth2 an authorizationUrl is returned to open in a popup.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"authType":{"type":"string","enum":["oauth2","api_key","custom_credential","no_auth"]},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["authType"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/memory-plugin-installations":{"get":{"operationId":"listMemoryPluginInstallations","summary":"List memory plugin installations","tags":["External memory"],"description":"List owner-reviewed external-memory plugin installations for the active organization.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pluginId":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","stdio"]},"endpoint":{"type":["string","null"]},"commandRef":{"type":["string","null"]},"pinnedProfileMajor":{"type":"number","enum":[1]},"expectedManifestDigest":{"type":["string","null"]},"secretHeaders":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"header":{"type":"string","minLength":1,"maxLength":128},"required":{"default":true,"type":"boolean"}},"required":["name","header","required"],"additionalProperties":false}},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","pluginId","transport","endpoint","commandRef","pinnedProfileMajor","expectedManifestDigest","secretHeaders","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}}}}},"post":{"operationId":"createMemoryPluginInstallation","summary":"Register a memory plugin installation","tags":["External memory"],"description":"Owner-only trust action. Register a pinned remote endpoint or an operator-installed local command reference and its reviewed logical-secret contract.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pluginId":{"type":"string","maxLength":255,"pattern":"^[a-z0-9]+(?:[.-][a-z0-9]+)+$"},"transport":{"default":"streamable-http","type":"string","enum":["streamable-http","stdio"]},"endpoint":{"type":"string","maxLength":2048,"format":"uri"},"commandRef":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"pinnedProfileMajor":{"default":1,"type":"number","enum":[1]},"expectedManifestDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"secretHeaders":{"default":[],"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"header":{"type":"string","minLength":1,"maxLength":128},"required":{"default":true,"type":"boolean"}},"required":["name","header"],"additionalProperties":false}}},"required":["pluginId"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pluginId":{"type":"string"},"transport":{"type":"string","enum":["streamable-http","stdio"]},"endpoint":{"type":["string","null"]},"commandRef":{"type":["string","null"]},"pinnedProfileMajor":{"type":"number","enum":[1]},"expectedManifestDigest":{"type":["string","null"]},"secretHeaders":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"header":{"type":"string","minLength":1,"maxLength":128},"required":{"default":true,"type":"boolean"}},"required":["name","header","required"],"additionalProperties":false}},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","pluginId","transport","endpoint","commandRef","pinnedProfileMajor","expectedManifestDigest","secretHeaders","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/memory-plugin-installations/{id}":{"delete":{"operationId":"deleteMemoryPluginInstallation","summary":"Delete a memory plugin installation","tags":["External memory"],"description":"Owner-only. Refused while an external-memory connection still references the installation.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/external-memory-connections":{"get":{"operationId":"listExternalMemoryConnections","summary":"List external-memory connections","tags":["External memory"],"description":"List org connection metadata and secret field names. Secret values and daemon grants never return.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secretKeys":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["probing","ready","degraded","invalid"]},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"probedRevision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"pluginVersion":{"type":["string","null"]},"profile":{"type":["string","null"]},"manifestDigest":{"type":["string","null"]},"capabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"configSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"declaredEgressHosts":{"type":"array","items":{"type":"string"}},"reasonCode":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","installationId","config","secretKeys","status","revision","probedRevision","pluginVersion","profile","manifestDigest","capabilities","configSchema","declaredEgressHosts","reasonCode","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}}}}},"post":{"operationId":"createExternalMemoryConnection","summary":"Create an external-memory connection","tags":["External memory"],"description":"Owner-only. Store bounded non-secret config and write-only secret values, mint an internal relay grant, and begin daemon conformance probing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secrets":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"type":"string","minLength":1,"maxLength":16384}}},"required":["installationId"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secretKeys":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["probing","ready","degraded","invalid"]},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"probedRevision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"pluginVersion":{"type":["string","null"]},"profile":{"type":["string","null"]},"manifestDigest":{"type":["string","null"]},"capabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"configSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"declaredEgressHosts":{"type":"array","items":{"type":"string"}},"reasonCode":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","installationId","config","secretKeys","status","revision","probedRevision","pluginVersion","profile","manifestDigest","capabilities","configSchema","declaredEgressHosts","reasonCode","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/external-memory-connections/{id}":{"get":{"operationId":"getExternalMemoryConnection","summary":"Get an external-memory connection","tags":["External memory"],"description":"Get one org connection, its non-secret config, secret field names, and latest probe status.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secretKeys":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["probing","ready","degraded","invalid"]},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"probedRevision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"pluginVersion":{"type":["string","null"]},"profile":{"type":["string","null"]},"manifestDigest":{"type":["string","null"]},"capabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"configSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"declaredEgressHosts":{"type":"array","items":{"type":"string"}},"reasonCode":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","installationId","config","secretKeys","status","revision","probedRevision","pluginVersion","profile","manifestDigest","capabilities","configSchema","declaredEgressHosts","reasonCode","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateExternalMemoryConnection","summary":"Update an external-memory connection","tags":["External memory"],"description":"Owner-only. Replace non-secret config and/or the complete write-only secret set, increment the connection revision, and re-run daemon probing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secrets":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"type":"string","minLength":1,"maxLength":16384}}},"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secretKeys":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["probing","ready","degraded","invalid"]},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"probedRevision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"pluginVersion":{"type":["string","null"]},"profile":{"type":["string","null"]},"manifestDigest":{"type":["string","null"]},"capabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"configSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"declaredEgressHosts":{"type":"array","items":{"type":"string"}},"reasonCode":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","installationId","config","secretKeys","status","revision","probedRevision","pluginVersion","profile","manifestDigest","capabilities","configSchema","declaredEgressHosts","reasonCode","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteExternalMemoryConnection","summary":"Delete an external-memory connection","tags":["External memory"],"description":"Owner-only. Refused while an agent is bound; otherwise revokes relay/daemon state and deletes secrets and grants.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/external-memory-connections/{id}/grant/rotate":{"post":{"operationId":"rotateExternalMemoryConnectionGrant","summary":"Rotate an external-memory relay grant","tags":["External memory"],"description":"Owner-only. Mint and distribute a new daemon-private grant before revoking the old grant. No grant value is returned.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secretKeys":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["probing","ready","degraded","invalid"]},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"probedRevision":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"pluginVersion":{"type":["string","null"]},"profile":{"type":["string","null"]},"manifestDigest":{"type":["string","null"]},"capabilities":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"configSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"declaredEgressHosts":{"type":"array","items":{"type":"string"}},"reasonCode":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","installationId","config","secretKeys","status","revision","probedRevision","pluginVersion","profile","manifestDigest","capabilities","configSchema","declaredEgressHosts","reasonCode","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/members":{"get":{"operationId":"listMembers","summary":"List members","tags":["Members"],"description":"The active org’s members — membership joined with each user’s profile.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"isCurrentUser":{"type":"boolean"},"joinedAt":{"type":"string"}},"required":["userId","email","name","picture","role","isCurrentUser","joinedAt"],"additionalProperties":false}}}}}}},"post":{"operationId":"addMember","summary":"Add a member","tags":["Members"],"description":"Owner-only. Adds a member by email with the given role; no email is sent — an unknown address becomes an invited row, claimed on first SSO sign-in.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"role":{"default":"collaborator","type":"string","enum":["owner","collaborator","viewer"]}},"required":["email"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"isCurrentUser":{"type":"boolean"},"joinedAt":{"type":"string"}},"required":["userId","email","name","picture","role","isCurrentUser","joinedAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/members/{id}":{"patch":{"operationId":"updateMember","summary":"Change a member’s role","tags":["Members"],"description":"Owner-only. Changes a member’s role; the last owner can’t be demoted, which would orphan the org.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","collaborator","viewer"]}},"required":["role"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"isCurrentUser":{"type":"boolean"},"joinedAt":{"type":"string"}},"required":["userId","email","name","picture","role","isCurrentUser","joinedAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"removeMember","summary":"Leave or remove a member","tags":["Members"],"description":"Any member can remove their own membership to leave the org. Only owners can remove another member. The last owner can’t leave, which would orphan the org.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/members/{id}/removal-preview":{"get":{"operationId":"previewMemberRemoval","summary":"Preview a leave or removal","tags":["Members"],"description":"What DELETE /members/:id would do to Selected audiences: which current member would be added only where the audience would otherwise become empty, and per-resource-kind counts for all affected and reassigned audiences. Same authorization as the removal itself. Advisory only: nothing is locked, and the removal re-derives the replacement inside the transaction.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"replacement":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"picture":{"type":["string","null"]},"role":{"type":"string","enum":["owner","collaborator","viewer"]},"isCurrentUser":{"type":"boolean"},"joinedAt":{"type":"string"}},"required":["userId","email","name","picture","role","isCurrentUser","joinedAt"],"additionalProperties":false},{"type":"null"}]},"resources":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["agent","daemon","cron","mcpProvider","skillSource","decision"]},"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reassigned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","selected","reassigned"],"additionalProperties":false}}},"required":["replacement","resources"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/invite-links":{"get":{"operationId":"getOrganizationInviteLink","summary":"Get the organization invite link","tags":["Members"],"description":"Owner-only. Returns the organization’s single invite-link slot, including expired or revoked state. The plaintext token is never returned.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayTail":{"type":"string"},"status":{"type":"string","enum":["active","expired","revoked"]},"expiresAt":{"type":"string"},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","displayTail","status","expiresAt","revokedAt","createdAt"],"additionalProperties":false},{"type":"null"}]}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"createOrganizationInviteLink","summary":"Generate the organization invite link","tags":["Members"],"description":"Owner-only. Generates the single seven-day, unlimited-use collaborator link. An active link must be revoked or expire first. The token is returned exactly once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"displayTail":{"type":"string"},"status":{"type":"string","enum":["active","expired","revoked"]},"expiresAt":{"type":"string"},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"token":{"type":"string"}},"required":["id","displayTail","status","expiresAt","revokedAt","createdAt","token"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/invite-links/{id}":{"delete":{"operationId":"revokeOrganizationInviteLink","summary":"Revoke the organization invite link","tags":["Members"],"description":"Owner-only. Immediately revokes the link. Existing memberships are unchanged.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/crons/{id}":{"put":{"operationId":"upsertCron","summary":"Create or update a cron","tags":["Crons"],"description":"Idempotent upsert of a cron definition keyed on its client-minted UUID; every write is best-effort pushed live to the owning agent’s daemon.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"schedule":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"trigger":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}}},"required":["agentId","schedule","trigger"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"name":{"type":["string","null"]},"schedule":{"type":"string"},"timezone":{"type":"string"},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"trigger":{"type":"string"},"enabled":{"type":"boolean"},"lastRunAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"}},"required":["id","orgId","agentId","name","schedule","timezone","targetPlatform","targetChannel","targetIntegrationId","trigger","enabled","lastRunAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt","visibility","sharedWith","canEdit","canManageSharing"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"get":{"operationId":"getCron","summary":"Get a cron","tags":["Crons"],"description":"A single cron definition by id, scoped to the caller’s active organization.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"name":{"type":["string","null"]},"schedule":{"type":"string"},"timezone":{"type":"string"},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"trigger":{"type":"string"},"enabled":{"type":"boolean"},"lastRunAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"}},"required":["id","orgId","agentId","name","schedule","timezone","targetPlatform","targetChannel","targetIntegrationId","trigger","enabled","lastRunAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt","visibility","sharedWith","canEdit","canManageSharing"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteCron","summary":"Delete a cron","tags":["Crons"],"description":"Remove a cron definition and best-effort push the removal to the owning agent’s daemon.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/crons":{"get":{"operationId":"listCrons","summary":"List crons","tags":["Crons"],"description":"Every cron definition in the caller’s active organization.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"name":{"type":["string","null"]},"schedule":{"type":"string"},"timezone":{"type":"string"},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"trigger":{"type":"string"},"enabled":{"type":"boolean"},"lastRunAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"}},"required":["id","orgId","agentId","name","schedule","timezone","targetPlatform","targetChannel","targetIntegrationId","trigger","enabled","lastRunAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt","visibility","sharedWith","canEdit","canManageSharing"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/crons/{id}/runs":{"get":{"operationId":"listCronRuns","summary":"List cron runs","tags":["Crons"],"description":"Daemon-reported run history for a cron, newest first.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"startedAt":{"type":"string"},"status":{"type":"string","enum":["running","success","failed"]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sessionId":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["id","startedAt","status","durationMs","sessionId","reason"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/crons/{id}/run":{"post":{"operationId":"triggerCronRun","summary":"Trigger a cron run","tags":["Crons"],"description":"Fire the cron on its daemon immediately; the 202 only means the daemon accepted the fire — the run itself is async and lands in the run history.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/crons/{id}/sharing":{"put":{"operationId":"setCronSharing","summary":"Set cron sharing","tags":["Crons"],"description":"Set a schedule’s visibility (Everyone vs Selected) and complete Selected audience. Requires edit rights; Selected must retain at least one current organization member, and sharedWith is intersected with current membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"default":[],"type":"array","items":{"type":"string"}}},"required":["visibility"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"name":{"type":["string","null"]},"schedule":{"type":"string"},"timezone":{"type":"string"},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"trigger":{"type":"string"},"enabled":{"type":"boolean"},"lastRunAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"visibility":{"type":"string","enum":["org","restricted"]},"sharedWith":{"type":"array","items":{"type":"string"}},"canEdit":{"type":"boolean"},"canManageSharing":{"type":"boolean"}},"required":["id","orgId","agentId","name","schedule","timezone","targetPlatform","targetChannel","targetIntegrationId","trigger","enabled","lastRunAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt","visibility","sharedWith","canEdit","canManageSharing"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/hooks":{"post":{"operationId":"createHook","summary":"Create a hook","tags":["Hooks"],"description":"Create a trigger for one agent. `kind:\"webhook\"` mints an ingress URL (the response carries it plus — when requested — the one-time HMAC signing secret, never retrievable again). `kind:\"github\"` subscribes a repository covered by one of the organization’s GitHub App installations to issue, pull-request, push, deployment or release events, or, with `githubAccount` in place of `repoFullName`, every repository of that account’s installation, which needs the agent’s installation grant. A code-host trigger covers ONE subject `family`, so a repository watched for both pull requests and issues is two triggers, each with its own cadence and mention gate; a second trigger on the same family is a 409. A `deployment_status:<state>` pattern selects on the status state (`success`, `failure`, …).","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["webhook"]},"sessionMode":{"default":"perDelivery","type":"string","enum":["perDelivery","perSubject","shared"]},"hmac":{"default":false,"type":"boolean"}},"required":["agentId","name","kind"]},{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["github"]},"family":{"type":"string","enum":["pull_request","issues","push","deployment","release"]},"repoFullName":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"},"githubAccount":{"type":"string","minLength":1,"maxLength":100},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(issues|pull_request|issue_comment|pull_request_review_comment|push|deployment|deployment_status|release):([a-z_]+|\\*)$"}},"commentFamilies":{"default":[],"maxItems":2,"type":"array","items":{"type":"string","enum":["issues","pull_request"]}},"labelFilter":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"mentionOnly":{"default":false,"type":"boolean"},"reviewPolicy":{"default":"off","type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"default":"off","type":"string","enum":["off","check","status"]},"gateMode":{"default":"informational","type":"string","enum":["informational","required"]}},"required":["agentId","name","kind","family","events"]},{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["gitlab"]},"projectId":{"type":"string","pattern":"^[1-9]\\d*$"},"family":{"type":"string","enum":["merge_request","issues","push","release"]},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(issues|merge_request|push|release):([a-z_]+|\\*)$"}},"commentFamilies":{"default":[],"maxItems":2,"type":"array","items":{"type":"string","enum":["issues","merge_request"]}},"labelFilter":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"mentionOnly":{"default":false,"type":"boolean"},"reviewPolicy":{"default":"off","type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"default":"off","type":"string","enum":["off","check","status"]}},"required":["agentId","name","kind","projectId","family","events"]},{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["gitea"]},"repoId":{"type":"string","pattern":"^[1-9]\\d*$"},"family":{"type":"string","enum":["merge_request","issues","push","release"]},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(issues|merge_request|push|release):([a-z_]+|\\*)$"}},"commentFamilies":{"default":[],"maxItems":2,"type":"array","items":{"type":"string","enum":["issues","merge_request"]}},"labelFilter":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"mentionOnly":{"default":false,"type":"boolean"},"reviewPolicy":{"default":"off","type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"default":"off","type":"string","enum":["off","check","status"]}},"required":["agentId","name","kind","repoId","family","events"]}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"kind":{"type":"string","enum":["webhook","github","gitlab","gitea"]},"name":{"type":"string"},"sessionMode":{"type":"string","enum":["perDelivery","perThread","perSubject","shared"]},"enabled":{"type":"boolean"},"url":{"type":["string","null"]},"hmacConfigured":{"type":"boolean"},"repoId":{"type":["string","null"]},"repoFullName":{"type":["string","null"]},"installationId":{"type":["string","null"]},"installationAccount":{"type":["string","null"]},"family":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"commentFamilies":{"type":"array","items":{"type":"string","enum":["issues","pull_request","merge_request"]}},"labelFilter":{"type":"array","items":{"type":"string"}},"mentionOnly":{"type":"boolean"},"configRevision":{"type":"string"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]},"gateMode":{"type":"string","enum":["informational","required"]},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"lastFiredAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"},"hmacSecret":{"type":["string","null"]}},"required":["id","orgId","agentId","kind","name","sessionMode","enabled","url","hmacConfigured","repoId","repoFullName","installationId","installationAccount","family","events","commentFamilies","labelFilter","mentionOnly","configRevision","reviewPolicy","reportingMode","gateMode","targetPlatform","targetChannel","targetIntegrationId","lastFiredAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt","hmacSecret"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/hooks":{"get":{"operationId":"listAgentHooks","summary":"List an agent’s hooks","tags":["Hooks"],"description":"Every hook firing this agent. Gated by the agent’s visibility.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"kind":{"type":"string","enum":["webhook","github","gitlab","gitea"]},"name":{"type":"string"},"sessionMode":{"type":"string","enum":["perDelivery","perThread","perSubject","shared"]},"enabled":{"type":"boolean"},"url":{"type":["string","null"]},"hmacConfigured":{"type":"boolean"},"repoId":{"type":["string","null"]},"repoFullName":{"type":["string","null"]},"installationId":{"type":["string","null"]},"installationAccount":{"type":["string","null"]},"family":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"commentFamilies":{"type":"array","items":{"type":"string","enum":["issues","pull_request","merge_request"]}},"labelFilter":{"type":"array","items":{"type":"string"}},"mentionOnly":{"type":"boolean"},"configRevision":{"type":"string"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]},"gateMode":{"type":"string","enum":["informational","required"]},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"lastFiredAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"}},"required":["id","orgId","agentId","kind","name","sessionMode","enabled","url","hmacConfigured","repoId","repoFullName","installationId","installationAccount","family","events","commentFamilies","labelFilter","mentionOnly","configRevision","reviewPolicy","reportingMode","gateMode","targetPlatform","targetChannel","targetIntegrationId","lastFiredAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/hooks/{id}":{"get":{"operationId":"getHook","summary":"Get a hook","tags":["Hooks"],"description":"A single hook definition by id, scoped to the caller’s active organization.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"kind":{"type":"string","enum":["webhook","github","gitlab","gitea"]},"name":{"type":"string"},"sessionMode":{"type":"string","enum":["perDelivery","perThread","perSubject","shared"]},"enabled":{"type":"boolean"},"url":{"type":["string","null"]},"hmacConfigured":{"type":"boolean"},"repoId":{"type":["string","null"]},"repoFullName":{"type":["string","null"]},"installationId":{"type":["string","null"]},"installationAccount":{"type":["string","null"]},"family":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"commentFamilies":{"type":"array","items":{"type":"string","enum":["issues","pull_request","merge_request"]}},"labelFilter":{"type":"array","items":{"type":"string"}},"mentionOnly":{"type":"boolean"},"configRevision":{"type":"string"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]},"gateMode":{"type":"string","enum":["informational","required"]},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"lastFiredAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"}},"required":["id","orgId","agentId","kind","name","sessionMode","enabled","url","hmacConfigured","repoId","repoFullName","installationId","installationAccount","family","events","commentFamilies","labelFilter","mentionOnly","configRevision","reviewPolicy","reportingMode","gateMode","targetPlatform","targetChannel","targetIntegrationId","lastFiredAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"put":{"operationId":"updateHook","summary":"Update a hook","tags":["Hooks"],"description":"Update a hook definition. `kind` is immutable (it discriminates the body); so is a code-host trigger’s subject `family`, which is why the update body carries none — delete and re-create to change it. A webhook hook’s ingress URL and signing secret are immutable too — rotating either is a delete + re-create. A github hook’s repository may be re-targeted (re-validated against the organization’s installations).","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["gitlab"]},"projectId":{"type":"string","pattern":"^[1-9]\\d*$"},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(issues|merge_request|push|release):([a-z_]+|\\*)$"}},"commentFamilies":{"maxItems":2,"type":"array","items":{"type":"string","enum":["issues","merge_request"]}},"labelFilter":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"mentionOnly":{"type":"boolean"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]}},"required":["agentId","name","kind","projectId","events"]},{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["gitea"]},"repoId":{"type":"string","pattern":"^[1-9]\\d*$"},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(issues|merge_request|push|release):([a-z_]+|\\*)$"}},"commentFamilies":{"maxItems":2,"type":"array","items":{"type":"string","enum":["issues","merge_request"]}},"labelFilter":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"mentionOnly":{"type":"boolean"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]}},"required":["agentId","name","kind","repoId","events"]},{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["github"]},"repoFullName":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"},"githubAccount":{"type":"string","minLength":1,"maxLength":100},"events":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^(issues|pull_request|issue_comment|pull_request_review_comment|push|deployment|deployment_status|release):([a-z_]+|\\*)$"}},"commentFamilies":{"maxItems":2,"type":"array","items":{"type":"string","enum":["issues","pull_request"]}},"labelFilter":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"mentionOnly":{"type":"boolean"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]},"gateMode":{"type":"string","enum":["informational","required"]}},"required":["agentId","name","kind","events"]},{"type":"object","properties":{"agentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"targetPlatform":{"default":"slack","type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":"string","minLength":1},"targetIntegrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"default":"webhook","type":"string","enum":["webhook"]},"sessionMode":{"default":"perDelivery","type":"string","enum":["perDelivery","perSubject","shared"]}},"required":["agentId","name"]}]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"agentId":{"type":["string","null"]},"kind":{"type":"string","enum":["webhook","github","gitlab","gitea"]},"name":{"type":"string"},"sessionMode":{"type":"string","enum":["perDelivery","perThread","perSubject","shared"]},"enabled":{"type":"boolean"},"url":{"type":["string","null"]},"hmacConfigured":{"type":"boolean"},"repoId":{"type":["string","null"]},"repoFullName":{"type":["string","null"]},"installationId":{"type":["string","null"]},"installationAccount":{"type":["string","null"]},"family":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"commentFamilies":{"type":"array","items":{"type":"string","enum":["issues","pull_request","merge_request"]}},"labelFilter":{"type":"array","items":{"type":"string"}},"mentionOnly":{"type":"boolean"},"configRevision":{"type":"string"},"reviewPolicy":{"type":"string","enum":["off","comment","request_changes","full"]},"reportingMode":{"type":"string","enum":["off","check","status"]},"gateMode":{"type":"string","enum":["informational","required"]},"targetPlatform":{"type":"string","enum":["slack","telegram","discord","feishu","linear","qq","googlechat"]},"targetChannel":{"type":["string","null"]},"targetIntegrationId":{"type":["string","null"]},"lastFiredAt":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"lastModifiedBy":{"type":["string","null"]},"lastModifiedAt":{"type":"string"}},"required":["id","orgId","agentId","kind","name","sessionMode","enabled","url","hmacConfigured","repoId","repoFullName","installationId","installationAccount","family","events","commentFamilies","labelFilter","mentionOnly","configRevision","reviewPolicy","reportingMode","gateMode","targetPlatform","targetChannel","targetIntegrationId","lastFiredAt","createdBy","createdAt","lastModifiedBy","lastModifiedAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteHook","summary":"Delete a hook","tags":["Hooks"],"description":"Remove a hook definition and drop its rule from the relay pool.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/hooks/{id}/runs":{"get":{"operationId":"listHookRuns","summary":"List hook runs","tags":["Hooks"],"description":"Delivery/run history for a hook, newest first (metadata only — payloads never reach the CP).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deliveryKey":{"type":"string"},"event":{"type":["string","null"]},"startedAt":{"type":"string"},"status":{"type":"string","enum":["running","success","failed"]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sessionId":{"type":["string","null"]},"reason":{"type":["string","null"]},"redeliveryAttempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"redeliveryLastRequestedAt":{"type":["string","null"]}},"required":["id","deliveryKey","event","startedAt","status","durationMs","sessionId","reason","redeliveryAttempts","redeliveryLastRequestedAt"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/hooks/{hookId}/trusted-actors":{"get":{"operationId":"listTrustedActors","summary":"List trusted users","tags":["Hooks"],"description":"Users a maintainer vouched for on this hook's repository. They may fire its hooks exactly as a repository role-holder would; the list is shared by every hook row on the repository.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"hookId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"actorId":{"type":"string"},"login":{"type":"string"},"addedBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","repoId","actorId","login","addedBy","createdAt"],"additionalProperties":false}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"post":{"operationId":"addTrustedActor","summary":"Add a trusted user","tags":["Hooks"],"description":"Vouch for one user by login. The server resolves the host's numeric user id through the repository's own credential and stores that; re-adding refreshes the display login.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string","minLength":1,"maxLength":100}},"required":["login"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"hookId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github","gitlab","gitea"]},"repoId":{"type":"string"},"actorId":{"type":"string"},"login":{"type":"string"},"addedBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","provider","repoId","actorId","login","addedBy","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/hooks/{hookId}/trusted-actors/{actorId}":{"delete":{"operationId":"removeTrustedActor","summary":"Remove a trusted user","tags":["Hooks"],"description":"Withdraw the vouch. The user falls back to whatever the repository role gate says.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"hookId","required":true},{"schema":{"type":"string"},"in":"path","name":"actorId","required":true}],"responses":{"204":{"description":"Default Response"},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/session-access/slack":{"get":{"operationId":"getSlackSessionAccess","summary":"Get Slack session access sync","tags":["Sessions"],"description":"Returns whether Slack sessions use the provider's current audience for console access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["slack","github","feishu"]},"available":{"type":"boolean"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","enabling","enabled","degraded"]},"currentRevision":{"type":"string","pattern":"^\\d+$"},"readFenceRevision":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"hiddenSessions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","available","enabled","state","currentRevision","readFenceRevision"],"additionalProperties":false}}}}}},"put":{"operationId":"setSlackSessionAccess","summary":"Set Slack session access sync","tags":["Sessions"],"description":"Owner-only setting. When enabled, Slack sessions follow the provider's current audience; unresolved history remains hidden.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["slack","github","feishu"]},"available":{"type":"boolean"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","enabling","enabled","degraded"]},"currentRevision":{"type":"string","pattern":"^\\d+$"},"readFenceRevision":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"hiddenSessions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","available","enabled","state","currentRevision","readFenceRevision"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/session-access/github":{"get":{"operationId":"getGitHubSessionAccess","summary":"Get GitHub session access sync","tags":["Sessions"],"description":"Returns whether GitHub sessions use the provider's current audience for console access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["slack","github","feishu"]},"available":{"type":"boolean"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","enabling","enabled","degraded"]},"currentRevision":{"type":"string","pattern":"^\\d+$"},"readFenceRevision":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"hiddenSessions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","available","enabled","state","currentRevision","readFenceRevision"],"additionalProperties":false}}}}}},"put":{"operationId":"setGitHubSessionAccess","summary":"Set GitHub session access sync","tags":["Sessions"],"description":"Owner-only setting. When enabled, GitHub sessions follow the provider's current audience; unresolved history remains hidden.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["slack","github","feishu"]},"available":{"type":"boolean"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","enabling","enabled","degraded"]},"currentRevision":{"type":"string","pattern":"^\\d+$"},"readFenceRevision":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"hiddenSessions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","available","enabled","state","currentRevision","readFenceRevision"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/session-access/feishu":{"get":{"operationId":"getFeishuLarkSessionAccess","summary":"Get Feishu/Lark session access sync","tags":["Sessions"],"description":"Returns whether Feishu/Lark sessions use the provider's current audience for console access.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["slack","github","feishu"]},"available":{"type":"boolean"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","enabling","enabled","degraded"]},"currentRevision":{"type":"string","pattern":"^\\d+$"},"readFenceRevision":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"hiddenSessions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","available","enabled","state","currentRevision","readFenceRevision"],"additionalProperties":false}}}}}},"put":{"operationId":"setFeishuLarkSessionAccess","summary":"Set Feishu/Lark session access sync","tags":["Sessions"],"description":"Owner-only setting. When enabled, Feishu/Lark sessions follow the provider's current audience; unresolved history remains hidden.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["slack","github","feishu"]},"available":{"type":"boolean"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["disabled","enabling","enabled","degraded"]},"currentRevision":{"type":"string","pattern":"^\\d+$"},"readFenceRevision":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"hiddenSessions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","available","enabled","state","currentRevision","readFenceRevision"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/facets":{"get":{"operationId":"listSessionFacets","summary":"List session filter facets","tags":["Sessions"],"description":"Lists each distinct session filter facet after applying every other active filter visible to the caller.","parameters":[{"schema":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"in":"query","name":"agentId","required":false},{"schema":{"type":"string","enum":["slack","telegram","webchat","discord","feishu","hook","dream","qq","googlechat"]},"in":"query","name":"platform","required":false},{"schema":{"type":"string","enum":["slack","telegram","webchat","discord","feishu","hook","dream","qq","googlechat","github","gitlab","gitea"]},"in":"query","name":"integration","required":false},{"schema":{"type":"string"},"in":"query","name":"channel","required":false},{"schema":{"type":"string"},"in":"query","name":"triggeredBy","required":false},{"schema":{"type":"string","pattern":"^[1-9]\\d*$"},"in":"query","name":"githubRepoId","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"string"}},"agentNames":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"integrations":{"type":"array","items":{"type":"string"}},"channels":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"platform":{"type":"string"},"integration":{"type":"string"},"name":{"type":["string","null"]},"triggeredByName":{"type":["string","null"]}},"required":["value","platform","integration","name","triggeredByName"],"additionalProperties":false}},"triggers":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"integration":{"type":"string"},"name":{"type":["string","null"]},"hookKind":{"anyOf":[{"type":"string","enum":["webhook","github","gitlab","gitea"]},{"type":"null"}]},"githubRepoId":{"type":["string","null"]}},"required":["value","integration","name","hookKind","githubRepoId"],"additionalProperties":false}}},"required":["agents","agentNames","integrations","channels","triggers"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions":{"get":{"operationId":"listSessions","summary":"List sessions","tags":["Sessions"],"description":"Lists CP-stored session metadata synced by daemon event/session snapshots; transcript bodies remain daemon-local. Returns one row per CONVERSATION by default (merged-conversation-view.md §5.2) — sessions sharing a thread group into `conversations`, each carrying its current member sessions. `view=flat` returns the raw `sessions` rows (the pre-grouped shape); `conversationKey` resolves one conversation’s members directly.","parameters":[{"schema":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"in":"query","name":"agentId","required":false},{"schema":{"type":"string","enum":["slack","telegram","webchat","discord","feishu","hook","dream","qq","googlechat"]},"in":"query","name":"platform","required":false},{"schema":{"type":"string","enum":["slack","telegram","webchat","discord","feishu","hook","dream","qq","googlechat","github","gitlab","gitea"]},"in":"query","name":"integration","required":false},{"schema":{"type":"string"},"in":"query","name":"channel","required":false},{"schema":{"type":"string"},"in":"query","name":"triggeredBy","required":false},{"schema":{"type":"string","pattern":"^[1-9]\\d*$"},"in":"query","name":"githubRepoId","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"default":50,"type":"integer","exclusiveMinimum":0,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"default":"grouped","type":"string","enum":["grouped","flat"]},"in":"query","name":"view","required":false},{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"query","name":"conversationKey","required":false},{"schema":{"type":"string","enum":["thinking","tool_call","awaiting_permission","idle"]},"in":"query","name":"activityState","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"sessionKey":{"type":"object","properties":{"platform":{"type":"string"},"channel":{"type":"string"},"thread":{"type":"string"}},"required":["platform","channel"],"additionalProperties":false},"agentId":{"type":"string"},"agentName":{"type":["string","null"]},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"triggeredBy":{"type":["string","null"]},"hookKind":{"anyOf":[{"type":"string","enum":["webhook","github","gitlab","gitea"]},{"type":"null"}]},"channelName":{"type":["string","null"]},"triggeredByName":{"type":["string","null"]},"threadUrl":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"effort":{"type":["string","null"]},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"daemonId":{"type":["string","null"]},"contentSetId":{"type":["string","null"]},"workspaceIsolation":{"anyOf":[{"type":"string","enum":["shared","session"]},{"type":"null"}]},"visibility":{"type":"string","enum":["private","org","external"]},"externalProvider":{"type":["string","null"]},"externalResolution":{"anyOf":[{"type":"string","enum":["pending","settled","invalid"]},{"type":"null"}]},"contentPurgedAt":{"type":["string","null"]},"activityState":{"type":"string","enum":["thinking","tool_call","awaiting_permission","idle"]}},"required":["sessionId","sessionKey","agentId","agentName","title","status","lastActivityAt","usage","triggeredBy","hookKind","channelName","triggeredByName","threadUrl","runtime","model","effort","fastMode","permissionMode","outputMode","daemonId","contentSetId","workspaceIsolation","visibility","externalProvider","externalResolution","contentPurgedAt","activityState"],"additionalProperties":false}},"conversations":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"]},"platform":{"type":["string","null"]},"channel":{"type":["string","null"]},"thread":{"type":["string","null"]},"sessions":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"sessionKey":{"type":"object","properties":{"platform":{"type":"string"},"channel":{"type":"string"},"thread":{"type":"string"}},"required":["platform","channel"],"additionalProperties":false},"agentId":{"type":"string"},"agentName":{"type":["string","null"]},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"]},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"triggeredBy":{"type":["string","null"]},"hookKind":{"anyOf":[{"type":"string","enum":["webhook","github","gitlab","gitea"]},{"type":"null"}]},"channelName":{"type":["string","null"]},"triggeredByName":{"type":["string","null"]},"threadUrl":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"effort":{"type":["string","null"]},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"daemonId":{"type":["string","null"]},"contentSetId":{"type":["string","null"]},"workspaceIsolation":{"anyOf":[{"type":"string","enum":["shared","session"]},{"type":"null"}]},"visibility":{"type":"string","enum":["private","org","external"]},"externalProvider":{"type":["string","null"]},"externalResolution":{"anyOf":[{"type":"string","enum":["pending","settled","invalid"]},{"type":"null"}]},"contentPurgedAt":{"type":["string","null"]},"activityState":{"type":"string","enum":["thinking","tool_call","awaiting_permission","idle"]}},"required":["sessionId","sessionKey","agentId","agentName","title","status","lastActivityAt","usage","triggeredBy","hookKind","channelName","triggeredByName","threadUrl","runtime","model","effort","fastMode","permissionMode","outputMode","daemonId","contentSetId","workspaceIsolation","visibility","externalProvider","externalResolution","contentPurgedAt","activityState"],"additionalProperties":false}},"memberSessionIds":{"type":"array","items":{"type":"string"}}},"required":["key","platform","channel","thread","sessions","memberSessionIds"],"additionalProperties":false}},"total":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"nextCursor":{"type":["string","null"]},"orgHasSessions":{"type":"boolean"},"accessSyncDegraded":{"type":"boolean"},"accessIssues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"reason":{"type":"string","enum":["authorization","app_authorization","quota","unavailable"]}},"required":["provider","reason"],"additionalProperties":false}}},"required":["total","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}":{"get":{"operationId":"getSession","summary":"Get session metadata","tags":["Sessions"],"description":"Returns CP-stored session metadata plus visible parent, sibling, and child session links; transcript bodies remain daemon-local.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"parentSession":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":["string","null"]},"platform":{"type":"string"},"title":{"type":["string","null"]}},"required":["id","agentId","agentName","platform","title"],"additionalProperties":false},{"type":"null"}]},"siblingSessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":["string","null"]},"platform":{"type":"string"},"title":{"type":["string","null"]}},"required":["id","agentId","agentName","platform","title"],"additionalProperties":false}},"childSessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":["string","null"]},"platform":{"type":"string"},"title":{"type":["string","null"]}},"required":["id","agentId","agentName","platform","title"],"additionalProperties":false}},"agentId":{"type":"string"},"agentName":{"type":["string","null"]},"launchId":{"type":["string","null"]},"platform":{"type":["string","null"]},"channel":{"type":["string","null"]},"thread":{"type":["string","null"]},"phase":{"type":"string"},"link":{"type":["string","null"]},"summary":{"type":["string","null"]},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"lastActivityAt":{"type":"string"},"usage":{"anyOf":[{"type":"object","properties":{"reportedAt":{"type":"string"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"contextUsed":{"type":"number"},"contextSize":{"type":"number"},"costAmount":{"type":"number"},"costCurrency":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"triggeredBy":{"type":["string","null"]},"hookKind":{"anyOf":[{"type":"string","enum":["webhook","github","gitlab","gitea"]},{"type":"null"}]},"channelName":{"type":["string","null"]},"triggeredByName":{"type":["string","null"]},"threadUrl":{"type":["string","null"]},"runtime":{"type":["string","null"]},"model":{"type":["string","null"]},"effort":{"type":["string","null"]},"fastMode":{"type":["boolean","null"]},"permissionMode":{"type":["string","null"]},"outputMode":{"type":["string","null"]},"daemonId":{"type":["string","null"]},"contentSetId":{"type":["string","null"]},"workspaceIsolation":{"anyOf":[{"type":"string","enum":["shared","session"]},{"type":"null"}]},"executorDaemonId":{"type":["string","null"]},"stayedHomeReason":{"anyOf":[{"type":"string","enum":["not_on_group","group_switch_off","shared_session","memory_daemon_homed","no_candidate","candidates_full","control_plane_unreachable","holder_least_loaded"]},{"type":"null"}]},"activityState":{"type":"string"},"visibility":{"type":"string","enum":["private","org","external"]},"externalProvider":{"type":["string","null"]},"externalResolution":{"anyOf":[{"type":"string","enum":["pending","settled","invalid"]},{"type":"null"}]},"feishuRegion":{"anyOf":[{"type":"string","enum":["feishu","lark"]},{"type":"null"}]},"visibilityState":{"type":"string","enum":["pending","applied"]},"canChangeVisibility":{"type":"boolean"},"canContinue":{"type":"boolean"},"continuationUnavailableReason":{"anyOf":[{"type":"string","enum":["unauthorized","content_purged","unsupported_platform","agent_moved","daemon_offline","unavailable"]},{"type":"null"}]},"accessSyncDegraded":{"type":"boolean"},"accessIssues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"reason":{"type":"string","enum":["authorization","app_authorization","quota","unavailable"]}},"required":["provider","reason"],"additionalProperties":false}},"participants":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"name":{"type":["string","null"]},"primary":{"type":"boolean"}},"required":["agentId","name","primary"],"additionalProperties":false}},{"type":"null"}]},"tenantScope":{"type":["string","null"]},"contentPurgedAt":{"type":["string","null"]},"contentPurgedReason":{"type":["string","null"]},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]}},"required":["id","parentSession","siblingSessions","childSessions","agentId","agentName","launchId","platform","channel","thread","phase","link","summary","title","status","lastActivityAt","usage","triggeredBy","hookKind","channelName","triggeredByName","threadUrl","runtime","model","effort","fastMode","permissionMode","outputMode","daemonId","contentSetId","workspaceIsolation","executorDaemonId","stayedHomeReason","activityState","visibility","externalProvider","externalResolution","feishuRegion","visibilityState","canChangeVisibility","canContinue","continuationUnavailableReason","accessSyncDegraded","participants","tenantScope","contentPurgedAt","contentPurgedReason","startedAt","endedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/messages":{"get":{"operationId":"getSessionMessages","summary":"Get session messages","tags":["Sessions"],"description":"Proxies a page of the session's chat history live from a daemon holding it — the recording daemon, or a member of the shared store it was written to; 503 when none is reachable.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","pattern":"^\\d+$"},"in":"query","name":"after","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"number"},"sender":{"type":"string"},"senderName":{"type":"string"},"senderAvatarUrl":{"type":"string","format":"uri"},"trustedAgentBot":{"type":"boolean"},"ts":{"type":"string"},"eventTimeUs":{"type":"number"},"postId":{"type":"string"},"kind":{"type":"string"},"text":{"type":"string"},"attachments":{"maxItems":1,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"},"mimeType":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"data":{"type":"string","minLength":4,"maxLength":218456}},"required":["name","mimeType","data"],"additionalProperties":false}},"toolCallId":{"type":"string"},"toolStatus":{"type":"string"},"toolKind":{"type":"string"},"body":{"type":"string"},"bodyTruncated":{"type":"boolean"},"bodyBytes":{"type":"number"}},"required":["seq","sender","ts","kind","text"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"liveCursor":{"type":["string","null"]},"liveMore":{"type":"boolean"}},"required":["sessionId","messages","nextCursor","liveCursor","liveMore"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/tool-body":{"get":{"operationId":"getSessionToolBody","summary":"Get a tool-call body","tags":["Sessions"],"description":"Proxies one byte slice of a tool call's untruncated ToolBody JSON live from a daemon holding the session; the console pages by offset until nextOffset is null. 503 when none is reachable.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"query","name":"toolCallId","required":true},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"toolCallId":{"type":"string"},"data":{"type":"string"},"totalBytes":{"type":"number"},"nextOffset":{"type":["number","null"]}},"required":["sessionId","toolCallId","data","totalBytes","nextOffset"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/visibility":{"put":{"operationId":"setSessionVisibility","summary":"Set session visibility","tags":["Sessions"],"description":"Reclassifies a session as private or org-visible. Allowed only for the session's recorded owner (identity match) — roles grant no re-classification rights. Tightening cascades to descendant sessions and stops future agent-memory capture once the owning daemons acknowledge; memory already distilled is not retracted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"type":"string","enum":["private","org"]}},"required":["visibility"],"additionalProperties":false}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"visibility":{"type":"string","enum":["private","org","external"]},"visibilityRev":{"type":"integer","minimum":0,"maximum":9007199254740991},"cascadedSessionIds":{"type":"array","items":{"type":"string"}},"state":{"type":"string","enum":["pending","applied"]}},"required":["id","visibility","visibilityRev","cascadedSessionIds","state"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/pull-request":{"get":{"operationId":"getSessionPullRequest","summary":"Get the session’s pull request","tags":["Sessions"],"description":"This session’s pull request: identity (repo, number, url, head/base) plus live state (checks, current reviews, unresolved review threads) proxied from GitHub in one GraphQL read. Identity comes from the owning hook run where one exists (`linkedBy: run`, which also carries the review facts a rate-limited answer falls back on); otherwise from the head branch of the checkout this session works in (`linkedBy: head-branch`, `linkBranch`, `linkScope`), so a pull request the agent opened mid-conversation is linked too — `linkScope: shared` means the branch came from the agent’s primary checkout, which every session on a shared-workspace agent works in, so the pull request is real but not exclusively this session’s; `linkAmbiguous` says the branch has more than one open pull request and this is the first of them. `autoMergeSessionPlaced` says whether an arm from this session names it — the pull request’s agent is this session’s and the serving daemon places arms by session — which is the one case in which this session’s own wake starts the pod a sleeping arm is refused for. GitHub being rate limited, denying the installation, or unreachable is data — `degraded` names which, identity survives, and the live lists are empty — because a panel that still names its PR beats an empty one. 404 when neither source names a pull request (no run and no pull request for that branch, a purged session, a workspace that is not a checkout, no daemon serving the agent) or when the deployment has no GitHub App configured; the console then draws its branch state and a create action instead. Review thread bodies are user content: proxied, never stored.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"query","name":"refresh","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"repoFullName":{"type":"string"},"pullNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"body":{"type":"string"},"state":{"anyOf":[{"type":"string","enum":["open","closed","merged"]},{"type":"null"}]},"isDraft":{"type":["boolean","null"]},"url":{"type":"string"},"headRef":{"type":"string"},"baseRef":{"type":"string"},"additions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"deletions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reviewDecision":{"anyOf":[{"type":"string","enum":["approved","changes_requested","review_required"]},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"state":{"type":"string","enum":["success","failure","pending","skipped","neutral"]},"detail":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["name","state","detail","startedAt","completedAt","url"],"additionalProperties":false}},"checksTruncated":{"type":"boolean"},"reviews":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"state":{"type":"string","enum":["approved","changes_requested","commented","dismissed","pending"]},"isBot":{"type":"boolean"}},"required":["author","state","isBot"],"additionalProperties":false}},"threads":{"type":"array","items":{"type":"object","properties":{"location":{"type":"string"},"body":{"type":"string"},"author":{"type":"string"},"isOutdated":{"type":"boolean"}},"required":["location","body","author","isOutdated"],"additionalProperties":false}},"unresolvedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"threadsTruncated":{"type":"boolean"},"autoMergeArmed":{"type":["boolean","null"]},"autoMergePlacement":{"anyOf":[{"type":"string","enum":["sandbox","daemon"]},{"type":"null"}]},"autoMergeWaitingOn":{"type":["string","null"]},"autoMergeError":{"type":["string","null"]},"autoMergeSessionPlaced":{"type":"boolean"},"canArmAutoMerge":{"type":"boolean"},"degraded":{"type":"boolean"},"degradedReason":{"anyOf":[{"type":"string","enum":["rate_limited","denied","unreachable"]},{"type":"null"}]},"agentReview":{"anyOf":[{"type":"string","enum":["approved","changes_requested","commented"]},{"type":"null"}]},"linkedBy":{"type":"string","enum":["run","head-branch"]},"linkBranch":{"type":["string","null"]},"linkScope":{"anyOf":[{"type":"string","enum":["session","shared"]},{"type":"null"}]},"linkAmbiguous":{"type":"boolean"}},"required":["repoFullName","pullNumber","title","body","state","isDraft","url","headRef","baseRef","additions","deletions","reviewDecision","checks","checksTruncated","reviews","threads","unresolvedCount","threadsTruncated","autoMergeArmed","autoMergePlacement","autoMergeWaitingOn","autoMergeError","autoMergeSessionPlaced","canArmAutoMerge","degraded","degradedReason","agentReview","linkedBy","linkBranch","linkScope","linkAmbiguous"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/pull-request/auto-merge":{"post":{"operationId":"setSessionPullRequestAutoMerge","summary":"Arm or disarm auto-merge on the session’s pull request","tags":["Sessions"],"description":"Arms or disarms merge-when-ready (squash) for this session’s pull request. The watcher runs at the EDGE — in a sandbox pod when the agent’s work runs in pods (an isolated session’s own pod when armed from a session that has one, on a daemon advertising `auto-merge-session-v1`; otherwise the agent’s), else in the owning daemon’s process — and polls GitHub until the pull request is open, undrafted, conflict-free, with no failing or running check and no requested changes, then squash-merges the head it judged. It is deliberately NOT GitHub’s own auto-merge: `enablePullRequestAutoMerge` refuses every pull request that is not BLOCKED, so on a repository without required status checks it can never be armed at all. A pull request is watched in one place however many sessions name it: arming one already watched returns that watcher’s state, and disarming finds it wherever it runs. Nothing is persisted: the armed set is in memory at the edge, so a reclaimed sandbox, a retired session’s pod or a restarted daemon forgets it and the box reads back unchecked. Arming needs the owning agent’s clamped grant to carry `pull_requests: write`, so a read- or comment-tier agent is refused (403); idempotent — asking for the state it is already in returns that state. 404 mirrors the GET. 409 with a `code` for every refusal the edge names: `AUTO_MERGE_SANDBOX_ASLEEP` (the pod the watcher belongs in is down — an isolated session’s own, else the agent’s — so start that sandbox first), `AUTO_MERGE_ALREADY_MERGEABLE` (the pull request can be merged now, and arming would merge it on the first tick with no confirmation — use the Merge route, which the console confirms), `AUTO_MERGE_UNSUPPORTED_IMAGE` (a sandbox from an image predating the watcher — resume it), `DAEMON_FEATURE_MISSING`, `NO_DAEMON`. 503 when the daemon is unreachable.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"armed":{"type":"boolean"},"placement":{"anyOf":[{"type":"string","enum":["sandbox","daemon"]},{"type":"null"}]},"waitingOn":{"type":["string","null"]},"error":{"type":["string","null"]}},"required":["armed","placement","waitingOn","error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/pull-request/merge":{"post":{"operationId":"mergeSessionPullRequest","summary":"Merge the session’s pull request","tags":["Sessions"],"description":"Merges this session’s pull request (squash) — the same identity the GET resolves, from the owning run or the session branch — using an installation token clamped to the owning agent’s repository tier (the write requires `pull_requests: write`, so a read- or comment-tier agent is refused 403). Idempotent: an already-merged pull request succeeds without a mutation. 404 mirrors the GET; 409 relays GitHub declining the merge (not mergeable, checks failing); 429 is GitHub rate limiting; 502 is GitHub unreachable.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"merged":{"type":"boolean"}},"required":["merged"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/sessions/{id}/sandbox-keep-alive":{"post":{"operationId":"keepSessionSandboxAlive","summary":"Hold this session’s sandbox while its page is open","tags":["Sessions"],"description":"Renews an open console page’s lease on the agent’s sandbox pod, so the idle sweep does not suspend work the page is watching. The DAEMON decides whether to hold, from facts the console cannot assert: uncommitted files in this session’s worktree, or an armed merge-when-ready watcher — which for a cluster agent is a process inside the pod it was armed in, so a suspend would silently disarm it. The answer says which reasons applied and for how long the hold stands; the console renews inside that window while its document is visible, and the hold lapses within one TTL when the page closes, the tab goes to the background, or the machine sleeps. Nothing is persisted, there is nothing to release, and a suspended pod is never woken by this call (`asleep: true`). `placement: daemon` means the agent runs no sandbox at all, which is an answer rather than an error. 404 mirrors the session reads; 409 when no daemon serves the agent or it is too old to hold a lease; 503 when its daemon is unreachable.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"held":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string","enum":["uncommitted-files","auto-merge-armed"]}},"ttlMs":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"placement":{"anyOf":[{"type":"string","enum":["sandbox","daemon"]},{"type":"null"}]},"asleep":{"type":"boolean"}},"required":["held","reasons","ttlMs","placement","asleep"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/stream":{"get":{"operationId":"streamSessionEvents","summary":"Live session event stream","tags":["Stream"],"description":"Server-sent event feed relaying session milestones and body-free transcript activity for the org’s daemons.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/orgs/{orgId}/github/app":{"get":{"operationId":"getGithubApp","summary":"GitHub App status","tags":["GitHub"],"description":"Whether github-app workspaces are enabled on this deployment, and a one-shot org-bound link to install the App on GitHub. Minting the link is a connection change — viewers get 403.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":["string","null"]},"installUrl":{"type":["string","null"]}},"required":["enabled","slug","installUrl"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/github/installations":{"get":{"operationId":"listGithubInstallations","summary":"List GitHub installations","tags":["GitHub"],"description":"The org's live (non-revoked) installations of the deployment GitHub App — the repo picker's first level. Includes the persisted installation-effective Checks permission separately from GitHub's coarse current/outdated App-upgrade verdict; a transient verdict read reports `unknown` without hiding the durable roster. Org-level infrastructure: visible to every member, never restricted.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"installationId":{"type":"number"},"accountLogin":{"type":"string"},"accountType":{"type":"string"},"repositorySelection":{"type":"string"},"suspended":{"type":"boolean"},"permissionsStatus":{"type":"string","enum":["current","outdated","unknown"]},"pullRequestsPermission":{"type":"string","enum":["read","write","missing","unknown"]},"checksPermission":{"type":"string","enum":["write","missing","unknown"]},"settingsUrl":{"type":"string","format":"uri"},"createdAt":{"type":"string"}},"required":["id","installationId","accountLogin","accountType","repositorySelection","suspended","permissionsStatus","pullRequestsPermission","checksPermission","settingsUrl","createdAt"],"additionalProperties":false}}}}}}}},"/v1/orgs/{orgId}/github/installations/sync":{"post":{"operationId":"syncGithubInstallations","summary":"Sync GitHub installations","tags":["GitHub"],"description":"Refresh this organization's existing installation claims from GitHub, mark vanished ones revoked, and update the current/outdated permission verdict. Unknown installations are never claimed by Sync.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"installationId":{"type":"number"},"accountLogin":{"type":"string"},"accountType":{"type":"string"},"repositorySelection":{"type":"string"},"suspended":{"type":"boolean"},"permissionsStatus":{"type":"string","enum":["current","outdated","unknown"]},"pullRequestsPermission":{"type":"string","enum":["read","write","missing","unknown"]},"checksPermission":{"type":"string","enum":["write","missing","unknown"]},"settingsUrl":{"type":"string","format":"uri"},"createdAt":{"type":"string"}},"required":["id","installationId","accountLogin","accountType","repositorySelection","suspended","permissionsStatus","pullRequestsPermission","checksPermission","settingsUrl","createdAt"],"additionalProperties":false}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/github/installations/{id}":{"delete":{"operationId":"uninstallGithubInstallation","summary":"Uninstall a GitHub App installation","tags":["GitHub"],"description":"Uninstall the deployment GitHub App from this account (AgentConnect organization owners only), then mark its local provenance revoked and re-converge the organization’s GitHub hook rules. The provenance row is retained so a later reinstall can self-heal existing agents.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/github/installations/{id}/repositories":{"get":{"operationId":"listGithubInstallationRepositories","summary":"List installation repositories","tags":["GitHub"],"description":"Repositories the installation is granted (paged, max 100/page). With the per-user authorization gate configured, public repositories remain visible while private repositories are filtered to those the CALLER can read on GitHub. Without a linked GitHub identity, only the public subset is returned and `privateReposHidden` is true — no private repository names reach the console. GitHub offers NO server-side search on this listing — the console filters client-side.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":100,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"perPage","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"repos":{"type":"array","items":{"type":"object","properties":{"repoId":{"type":"string"},"fullName":{"type":"string"},"private":{"type":"boolean"},"defaultBranch":{"type":"string"},"description":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["repoId","fullName","private","defaultBranch","description","updatedAt"],"additionalProperties":false}},"totalCount":{"type":"number"},"privateReposHidden":{"type":"boolean"}},"required":["repos","totalCount","privateReposHidden"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/github/installations/{id}/repositories/{owner}/{repo}":{"get":{"operationId":"getGithubInstallationRepository","summary":"Resolve an installation repository","tags":["GitHub"],"description":"Resolve one owner/repository name through this GitHub App installation. This covers private repositories and repositories beyond the first page of the picker listing without exposing repositories outside the installation grant. The owner must be the installation account: an installation token reads any public repository, so a repository on another account is reported as absent rather than as App-backed.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"repoId":{"type":"string"},"fullName":{"type":"string"},"private":{"type":"boolean"},"defaultBranch":{"type":"string"},"description":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["repoId","fullName","private","defaultBranch","description","updatedAt"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/github/installations/{id}/repositories/{owner}/{repo}/branches":{"get":{"operationId":"listGithubRepositoryBranches","summary":"List repository branches","tags":["GitHub"],"description":"Branch names for the picker (first 100). Uses a contents:read token scoped to the one repository.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/github/installations/{id}/repositories/{owner}/{repo}/access":{"get":{"operationId":"getGithubRepositoryAccess","summary":"My access to a repository","tags":["GitHub"],"description":"The caller's own effective GitHub permission on the repository (identity assertion via the sign-in identity — no user OAuth). The console uses it to gate the Allow-push toggle and surface no-access repos before create.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"owner","required":true},{"schema":{"type":"string"},"in":"path","name":"repo","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"permission":{"type":"string","enum":["admin","write","read","none"]},"canRead":{"type":"boolean"},"canWrite":{"type":"boolean"},"identityRequired":{"type":"boolean"}},"required":["permission","canRead","canWrite","identityRequired"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/oauth/start":{"post":{"operationId":"startGitlabOauth","summary":"Start a GitLab.com OAuth connection","tags":["GitLab"],"description":"Mints a one-shot authorization state bound to this organization and the calling user, and returns the URL the browser must visit to continue on GitLab.com.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnPath":{"type":"string","maxLength":512}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/connections":{"get":{"operationId":"listGitlabConnections","summary":"List GitLab.com connections","tags":["GitLab"],"description":"The organization-owned GitLab.com OAuth connections: administration identities only, no token material.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"gitlabUserId":{"type":"string"},"gitlabUsername":{"type":"string"},"state":{"type":"string","enum":["connected","reauth_required","disconnected"]},"scopes":{"type":"array","items":{"type":"string"}},"connectedBy":{"type":["string","null"]},"mine":{"type":"boolean"},"accessExpiresAt":{"type":["string","null"]},"assignedProjects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instanceUrl":{"type":"string"},"instanceVersion":{"type":["string","null"]},"instanceVersionSupported":{"type":["boolean","null"]},"instanceVersionFloor":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","gitlabUserId","gitlabUsername","state","scopes","connectedBy","mine","accessExpiresAt","assignedProjects","instanceUrl","instanceVersion","instanceVersionSupported","instanceVersionFloor","createdAt"],"additionalProperties":false}}},"required":["connections"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/connections/{id}/projects":{"get":{"operationId":"listGitlabConnectionProjects","summary":"Search accessible GitLab.com projects","tags":["GitLab"],"description":"Server-side paginated search of the connection's accessible projects (§10.1). Metadata only; installability is enforced at project selection.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","maxLength":256},"in":"query","name":"search","required":false},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"string"},"path":{"type":"string"},"defaultBranch":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"]}},"required":["projectId","path","defaultBranch","lastActivityAt"],"additionalProperties":false}},"nextPage":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["projects","nextPage"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/accounts":{"get":{"operationId":"listGitlabAccounts","summary":"List the organization’s GitLab bot accounts","tags":["GitLab"],"description":"Every service account this organization owns on GitLab.com (§7.2), with the agent it acts for, its top-level group, its health, and the bound projects it is a member of. The Integrations card keys its rows by this (§18.1). `converging` reports whether membership convergence still owes the organization work, so the console can stop asking once it does not. Visibility-gated: a bot belonging to an agent the caller cannot see is absent, exactly as that agent is. Never token material.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"rootGroupId":{"type":"string"},"rootGroupPath":{"type":["string","null"]},"username":{"type":"string"},"displayName":{"type":["string","null"]},"userId":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending","service_account_creation_forbidden"]},"stateReason":{"type":["string","null"]},"lifecycle":{"type":"string","enum":["active","retiring"]},"bindingIds":{"type":"array","items":{"type":"string"}}},"required":["id","agentId","rootGroupId","rootGroupPath","username","displayName","userId","state","stateReason","lifecycle","bindingIds"],"additionalProperties":false}},"converging":{"type":"boolean"}},"required":["accounts","converging"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/projects":{"get":{"operationId":"listGitlabProjects","summary":"List managed GitLab projects","tags":["GitLab"],"description":"The organization-owned project bindings with their §8.2 lifecycle states.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"projectPath":{"type":"string"},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"installerConnectionId":{"type":["string","null"]},"accounts":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"username":{"type":"string"},"displayName":{"type":["string","null"]},"userId":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending","service_account_creation_forbidden"]},"stateReason":{"type":["string","null"]}},"required":["agentId","username","displayName","userId","state","stateReason"],"additionalProperties":false}},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"credentialEpoch":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","projectId","projectPath","defaultBranch","state","stateReason","installerConnectionId","accounts","webhookState","credentialEpoch","createdAt"],"additionalProperties":false}}},"required":["bindings"],"additionalProperties":false}}}}}},"post":{"operationId":"createGitlabProject","summary":"Bind a GitLab.com project","tags":["GitLab"],"description":"Re-fetches the selected project, requires current Maintainer-or-Owner effective membership, acquires the deployment-global project claim, and creates the binding in the provisioning state (§10.1–§10.2).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","pattern":"^[1-9]\\d*$"}},"required":["connectionId","projectId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"projectPath":{"type":"string"},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"installerConnectionId":{"type":["string","null"]},"accounts":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"username":{"type":"string"},"displayName":{"type":["string","null"]},"userId":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending","service_account_creation_forbidden"]},"stateReason":{"type":["string","null"]}},"required":["agentId","username","displayName","userId","state","stateReason"],"additionalProperties":false}},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"credentialEpoch":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","projectId","projectPath","defaultBranch","state","stateReason","installerConnectionId","accounts","webhookState","credentialEpoch","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/projects/{id}/repair":{"post":{"operationId":"repairGitlabProject","summary":"Repair a managed GitLab project","tags":["GitLab"],"description":"Re-runs the §10.2 provisioning convergence: refresh identity, service account, credentials, and the managed webhook.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"projectPath":{"type":"string"},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"installerConnectionId":{"type":["string","null"]},"accounts":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"username":{"type":"string"},"displayName":{"type":["string","null"]},"userId":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending","service_account_creation_forbidden"]},"stateReason":{"type":["string","null"]}},"required":["agentId","username","displayName","userId","state","stateReason"],"additionalProperties":false}},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"credentialEpoch":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","projectId","projectPath","defaultBranch","state","stateReason","installerConnectionId","accounts","webhookState","credentialEpoch","createdAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/projects/{id}/transfer":{"post":{"operationId":"transferGitlabProject","summary":"Take over administration of a GitLab project","tags":["GitLab"],"description":"Moves administration of a project whose administering account can no longer act to the caller's own connected GitLab account (§9.4). The Control Plane re-verifies the caller's CURRENT Maintainer-or-Owner membership live, through the caller's own connection, then re-runs the §10.2 convergence under the new account. Eligible in any binding state — including a `cleanup_pending` one, whose interrupted removal can then finish under the new account (§19.4); that state is only reassigned, never re-provisioned. A project whose administering account is still connected and is not degraded is refused. Every refusal carries a machine-readable `code`.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"projectPath":{"type":"string"},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"installerConnectionId":{"type":["string","null"]},"accounts":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"username":{"type":"string"},"displayName":{"type":["string","null"]},"userId":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending","service_account_creation_forbidden"]},"stateReason":{"type":["string","null"]}},"required":["agentId","username","displayName","userId","state","stateReason"],"additionalProperties":false}},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"credentialEpoch":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","projectId","projectPath","defaultBranch","state","stateReason","installerConnectionId","accounts","webhookState","credentialEpoch","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/projects/{id}":{"delete":{"operationId":"deleteGitlabProject","summary":"Disconnect a managed GitLab project","tags":["GitLab"],"description":"Disables local authority, then removes the managed webhook, revokes the managed tokens, and deletes the Project Service Account (§19.4). Incomplete external cleanup leaves the binding cleanup_pending and keeps the deployment-global claim.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]}},"required":["removed"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitlab/connections/{id}":{"delete":{"operationId":"disconnectGitlabConnection","summary":"Disconnect or remove a GitLab.com connection","tags":["GitLab"],"description":"On a live connection: revokes the OAuth grant when possible, removes the stored token pair, and keeps the row so its projects can still be listed — project bindings are never deleted implicitly (§9.4). On an already-disconnected connection that administers no projects: removes the row, under a lock that makes a racing project create meet the refusal rather than be detached. Removal is refused with 409 while any project is still assigned to it.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"},"connection":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"gitlabUserId":{"type":"string"},"gitlabUsername":{"type":"string"},"state":{"type":"string","enum":["connected","reauth_required","disconnected"]},"scopes":{"type":"array","items":{"type":"string"}},"connectedBy":{"type":["string","null"]},"mine":{"type":"boolean"},"accessExpiresAt":{"type":["string","null"]},"assignedProjects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instanceUrl":{"type":"string"},"instanceVersion":{"type":["string","null"]},"instanceVersionSupported":{"type":["boolean","null"]},"instanceVersionFloor":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","gitlabUserId","gitlabUsername","state","scopes","connectedBy","mine","accessExpiresAt","assignedProjects","instanceUrl","instanceVersion","instanceVersionSupported","instanceVersionFloor","createdAt"],"additionalProperties":false},{"type":"null"}]}},"required":["removed","connection"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/connections":{"post":{"operationId":"connectGitea","summary":"Connect Gitea with a bot token","tags":["Gitea"],"description":"Verifies a bot user’s personal access token against the instance (§4.1): reads the user, applies the 1.23 floor, probes the required scopes (read:user, write:repository, write:issue, read:organization), refuses a bot already serving another connection on this deployment and a second connection in this organization, then seals the token. The token is write-only and never returned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512}},"required":["token"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"botUserId":{"type":"string"},"botUsername":{"type":"string"},"botDisplayName":{"type":["string","null"]},"state":{"type":"string","enum":["connected","token_rejected","disconnecting"]},"connectedBy":{"type":["string","null"]},"credentialEpoch":{"type":"string"},"boundRepositories":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instanceUrl":{"type":"string"},"instanceVersion":{"type":["string","null"]},"instanceVersionSupported":{"type":["boolean","null"]},"instanceVersionFloor":{"type":"string"},"requiredScopes":{"type":"array","items":{"type":"string"}},"lastVerifiedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","botUserId","botUsername","botDisplayName","state","connectedBy","credentialEpoch","boundRepositories","instanceUrl","instanceVersion","instanceVersionSupported","instanceVersionFloor","requiredScopes","lastVerifiedAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"get":{"operationId":"listGiteaConnections","summary":"List Gitea connections","tags":["Gitea"],"description":"The organization’s Gitea bot connection (at most one): identity facts, instance facts and the required scopes — no token material.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"botUserId":{"type":"string"},"botUsername":{"type":"string"},"botDisplayName":{"type":["string","null"]},"state":{"type":"string","enum":["connected","token_rejected","disconnecting"]},"connectedBy":{"type":["string","null"]},"credentialEpoch":{"type":"string"},"boundRepositories":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instanceUrl":{"type":"string"},"instanceVersion":{"type":["string","null"]},"instanceVersionSupported":{"type":["boolean","null"]},"instanceVersionFloor":{"type":"string"},"requiredScopes":{"type":"array","items":{"type":"string"}},"lastVerifiedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","botUserId","botUsername","botDisplayName","state","connectedBy","credentialEpoch","boundRepositories","instanceUrl","instanceVersion","instanceVersionSupported","instanceVersionFloor","requiredScopes","lastVerifiedAt","createdAt"],"additionalProperties":false}},"instanceUrl":{"type":"string"}},"required":["connections","instanceUrl"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/connections/{id}/token":{"post":{"operationId":"replaceGiteaToken","summary":"Replace the Gitea bot token","tags":["Gitea"],"description":"Runs the connect checks against the new token, requires the same numeric bot user, then switches the sealed value atomically and advances the credential epoch so daemon caches purge the old value (§4.3). Bindings degraded by a rejected token are re-converged; the old token is revoked by a human in Gitea.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512}},"required":["token"]}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"botUserId":{"type":"string"},"botUsername":{"type":"string"},"botDisplayName":{"type":["string","null"]},"state":{"type":"string","enum":["connected","token_rejected","disconnecting"]},"connectedBy":{"type":["string","null"]},"credentialEpoch":{"type":"string"},"boundRepositories":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instanceUrl":{"type":"string"},"instanceVersion":{"type":["string","null"]},"instanceVersionSupported":{"type":["boolean","null"]},"instanceVersionFloor":{"type":"string"},"requiredScopes":{"type":"array","items":{"type":"string"}},"lastVerifiedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","botUserId","botUsername","botDisplayName","state","connectedBy","credentialEpoch","boundRepositories","instanceUrl","instanceVersion","instanceVersionSupported","instanceVersionFloor","requiredScopes","lastVerifiedAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/connections/{id}":{"delete":{"operationId":"disconnectGitea","summary":"Disconnect Gitea","tags":["Gitea"],"description":"Walks every managed repository’s removal path first (§6): each managed webhook is deleted by its recorded id and its claim released. A binding whose cleanup cannot complete — a rejected token, or a bot that lost admin — parks in cleanup_pending and keeps the connection row until a replacement token or a manual webhook removal clears it; only then is the row and its sealed token removed.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"},"pendingRepositories":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connection":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"botUserId":{"type":"string"},"botUsername":{"type":"string"},"botDisplayName":{"type":["string","null"]},"state":{"type":"string","enum":["connected","token_rejected","disconnecting"]},"connectedBy":{"type":["string","null"]},"credentialEpoch":{"type":"string"},"boundRepositories":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instanceUrl":{"type":"string"},"instanceVersion":{"type":["string","null"]},"instanceVersionSupported":{"type":["boolean","null"]},"instanceVersionFloor":{"type":"string"},"requiredScopes":{"type":"array","items":{"type":"string"}},"lastVerifiedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","botUserId","botUsername","botDisplayName","state","connectedBy","credentialEpoch","boundRepositories","instanceUrl","instanceVersion","instanceVersionSupported","instanceVersionFloor","requiredScopes","lastVerifiedAt","createdAt"],"additionalProperties":false},{"type":"null"}]}},"required":["removed","pendingRepositories","connection"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/connections/{id}/repositories":{"get":{"operationId":"listGiteaConnectionRepositories","summary":"List the repositories the Gitea bot administers","tags":["Gitea"],"description":"The picker (§6): every repository the bot can reach through its own listing and each organization it belongs to, kept only where the bot holds admin, keyed by numeric id. Metadata only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"repositories":{"type":"array","items":{"type":"object","properties":{"repoId":{"type":"string"},"path":{"type":"string"},"cloneUrl":{"type":["string","null"]},"defaultBranch":{"type":["string","null"]},"private":{"type":"boolean"}},"required":["repoId","path","cloneUrl","defaultBranch","private"],"additionalProperties":false}}},"required":["repositories"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/repositories":{"get":{"operationId":"listGiteaRepositories","summary":"List managed Gitea repositories","tags":["Gitea"],"description":"The organization-owned repository bindings with their §5 lifecycle states and the managed webhook’s state.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"repoId":{"type":"string"},"repoPath":{"type":"string"},"cloneUrl":{"type":["string","null"]},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"lastVerifiedDeliveryAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","connectionId","repoId","repoPath","cloneUrl","defaultBranch","state","stateReason","webhookState","lastVerifiedDeliveryAt","createdAt"],"additionalProperties":false}}},"required":["bindings"],"additionalProperties":false}}}}}},"post":{"operationId":"createGiteaRepository","summary":"Bind a Gitea repository ahead of use","tags":["Gitea"],"description":"Optional: a repository is bound on first use when a trigger, an agent workspace or an additional-repository grant names it (§6), and this route binds one ahead of that. It re-fetches the repository by numeric id through the organization’s connection, requires the bot to hold admin on it (§4.4), acquires the deployment-global repository claim, creates the binding and runs the §6 saga: the managed webhook is installed when an enabled trigger wants ingress, tested, and the binding is ready — with the webhook_unverified warning when the relay never observed the test delivery. A repository that is already bound answers 409.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repoId":{"type":"string","pattern":"^[1-9]\\d*$"}},"required":["repoId"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"repoId":{"type":"string"},"repoPath":{"type":"string"},"cloneUrl":{"type":["string","null"]},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"lastVerifiedDeliveryAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","connectionId","repoId","repoPath","cloneUrl","defaultBranch","state","stateReason","webhookState","lastVerifiedDeliveryAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/repositories/{id}/repair":{"post":{"operationId":"repairGiteaRepository","summary":"Repair a managed Gitea repository","tags":["Gitea"],"description":"Re-runs the §6 convergence: refresh the repository facts, re-check the bot’s admin, and install or reconcile the managed webhook.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"repoId":{"type":"string"},"repoPath":{"type":"string"},"cloneUrl":{"type":["string","null"]},"defaultBranch":{"type":["string","null"]},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]},"webhookState":{"type":"string","enum":["not_needed","installed","repairing","failed"]},"lastVerifiedDeliveryAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","connectionId","repoId","repoPath","cloneUrl","defaultBranch","state","stateReason","webhookState","lastVerifiedDeliveryAt","createdAt"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/repositories/{id}/rotate-webhook-secret":{"post":{"operationId":"rotateGiteaWebhookSecret","summary":"Rotate a managed Gitea webhook’s signing secret","tags":["Gitea"],"description":"A webhook’s secret is set at creation only, so the key is rotated by replacing the webhook (§7): a successor is created under a sealed successor key with the full subscription, both keys reach the relays, the old webhook is deactivated and a test delivery is fired at the successor. The old webhook is deleted and the key promoted once the relay verifies one delivery under the successor — `promoted` reports whether that already happened.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"rotated":{"type":"boolean"},"promoted":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["rotated","promoted","reason"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/gitea/repositories/{id}":{"delete":{"operationId":"deleteGiteaRepository","summary":"Unbind a managed Gitea repository","tags":["Gitea"],"description":"Disables local authority, deletes the managed webhook by its recorded id and releases the deployment-global claim (§6). Refused with 409 while a trigger, an agent workspace or an additional-repository grant still references the repository — the binding was bound on first use and is never unbound on last use, so this is the one removal. A rejected token parks the binding in cleanup_pending until a replacement token or a manual webhook removal clears it.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"},"state":{"type":"string","enum":["provisioning","ready","admin_degraded","runtime_degraded","cleanup_pending"]},"stateReason":{"type":["string","null"]}},"required":["removed"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/git/resolve":{"get":{"operationId":"resolveGitRepo","summary":"Resolve a git address","tags":["Agents"],"description":"Preview what writing this address as an agent workspace would derive for the calling user: who vouches for it (GitHub App installation, managed GitLab project, or an anonymous read-only clone), the caller’s access ceiling, the canonical cloneable address, and the default branch. Refusals mirror the write paths.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":512},"in":"query","name":"gitRepo","required":true},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["github","gitlab","gitea","anonymous"]},"gitRepo":{"type":"string"},"access":{"type":"string","enum":["read","write"]},"defaultBranch":{"type":"string"},"host":{"type":"string","enum":["github","gitlab","gitea","other"]}},"required":["provider","gitRepo","access"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/agents/{agentId}/icon":{"put":{"operationId":"uploadAgentIcon","summary":"Upload an agent icon","tags":["Agents"],"description":"Store a user-uploaded avatar (PNG/JPEG/WebP) for the agent and set its icon to `image`. Owner/editor only.","requestBody":{"required":true,"content":{"image/png":{"schema":{}},"image/jpeg":{"schema":{}},"image/webp":{"schema":{}}}},"parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"icon":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},"iconUrl":{"type":["string","null"]}},"required":["icon","iconUrl"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"415":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentIcon","summary":"Delete an agent icon","tags":["Agents"],"description":"Remove the uploaded avatar and reset the agent to a random glyph. Owner/editor only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"agentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"icon":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},"iconUrl":{"type":["string","null"]}},"required":["icon","iconUrl"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/icon":{"put":{"operationId":"uploadOrganizationIcon","summary":"Upload the organization icon","tags":["Organizations"],"description":"Store a user-uploaded icon (PNG/JPEG/WebP) for the org and set its icon to `image`. Owner only.","requestBody":{"required":true,"content":{"image/png":{"schema":{}},"image/jpeg":{"schema":{}},"image/webp":{"schema":{}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"icon":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},"iconUrl":{"type":["string","null"]}},"required":["icon","iconUrl"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}},"415":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteOrganizationIcon","summary":"Delete the organization icon","tags":["Organizations"],"description":"Remove the uploaded org icon and reset it to a generated default. Owner only.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"icon":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["runtime"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["glyph"]},"glyph":{"type":"string","enum":["agentconnect","bot","cpu","terminal","code","rocket","zap","bug","git-branch","message-square","sparkles","brain","wrench","ship","box","hexagon","compass","atom","flame","star","heart","globe","database","shield","feather"]},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["kind","glyph","color"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image"]}},"required":["kind"],"additionalProperties":false}]},"iconUrl":{"type":["string","null"]}},"required":["icon","iconUrl"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["error","statusCode","message"],"additionalProperties":false}}}}}}},"/v1/orgs/{orgId}/usage":{"get":{"operationId":"getUsage","summary":"Get token usage","tags":["Usage"],"description":"Sums persisted token usage over the half-open [from, to) window. Organization owners receive complete agent, model, and time-series attribution; other members receive access-scoped attribution and an unattributed residual. Totals and metering-source totals stay organization-wide. Optionally scoped to one metering source.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","enum":["daemon","gateway"]},"in":"query","name":"source","required":false},{"schema":{"default":0,"type":"integer","minimum":-900,"maximum":900},"in":"query","name":"tz","required":false},{"schema":{"type":"string"},"in":"path","name":"orgId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"accessSyncDegraded":{"type":"boolean"},"accessIssues":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"reason":{"type":"string","enum":["authorization","app_authorization","quota","unavailable"]}},"required":["provider","reason"],"additionalProperties":false}},"totals":{"type":"object","properties":{"sessions":{"type":"number"},"totalTokens":{"type":"number"},"costAmount":{"type":"string"},"costCurrency":{"type":["string","null"]}},"required":["sessions","totalTokens","costAmount","costCurrency"],"additionalProperties":false},"agents":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"sessions":{"type":"number"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"costAmount":{"type":"string"}},"required":["agentId","sessions","totalTokens","inputTokens","outputTokens","thoughtTokens","cachedReadTokens","cachedWriteTokens","costAmount"],"additionalProperties":false}},"models":{"type":"array","items":{"type":"object","properties":{"sessions":{"type":"number"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"costAmount":{"type":"string"},"model":{"type":["string","null"]}},"required":["sessions","totalTokens","inputTokens","outputTokens","thoughtTokens","cachedReadTokens","cachedWriteTokens","costAmount","model"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"sessions":{"type":"number"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"costAmount":{"type":"string"},"source":{"type":"string","enum":["daemon","gateway"]}},"required":["sessions","totalTokens","inputTokens","outputTokens","thoughtTokens","cachedReadTokens","cachedWriteTokens","costAmount","source"],"additionalProperties":false}},"unattributed":{"type":"object","properties":{"sessions":{"type":"number"},"totalTokens":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"thoughtTokens":{"type":"number"},"cachedReadTokens":{"type":"number"},"cachedWriteTokens":{"type":"number"},"costAmount":{"type":"string"}},"required":["sessions","totalTokens","inputTokens","outputTokens","thoughtTokens","cachedReadTokens","cachedWriteTokens","costAmount"],"additionalProperties":false},"series":{"type":"object","properties":{"bucket":{"type":"string","enum":["hour","day"]},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"costAmount":{"type":"string"},"byAgent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"byModel":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["start","costAmount","byAgent","byModel"],"additionalProperties":false}}},"required":["bucket","points"],"additionalProperties":false}},"required":["from","to","totals","agents","models","sources","series"],"additionalProperties":false}}}}}}}},"servers":[{"url":"https://api.agentconnect.md"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Decisions","description":"Reusable typed questions and daemon-owned previews."},{"name":"Deployment","description":"Secret-free runtime metadata for deployment clients."},{"name":"Organizations","description":"The caller’s organizations — list, create, rename, delete."},{"name":"Profile","description":"The signed-in user’s own profile."},{"name":"Members","description":"Organization membership and roles."},{"name":"Daemons","description":"Edge daemons — the message + agent-execution units. Enrollment tokens and lifecycle."},{"name":"Member sets","description":"Named sets of daemons an agent’s duty may be claimed within — the failover unit."},{"name":"Provider keys","description":"Organization provider credentials. Owners may save or remove keys; all members may read configuration status. Values are write-only."},{"name":"Agents","description":"Agent definitions — CRUD and connect/launch."},{"name":"Agent workspace","description":"Read an agent’s daemon-local workspace (files, git status/pull)."},{"name":"Sessions","description":"Conversation sessions and their message history."},{"name":"Integrations","description":"IM-platform integrations (Slack / Telegram / Discord) and their channels."},{"name":"Bots","description":"Durable platform bot identities."},{"name":"MCP providers","description":"Org-level MCP providers — upstream tool servers the CP proxies through a relay to agents."},{"name":"Skill sources","description":"Org-level public GitHub skill sources — metadata the daemon binds to a numeric repository identity, acquires as a bounded snapshot, and installs with its bundled exact CLI."},{"name":"Organization knowledge","description":"Accepted organization knowledge, managed Agent Skills bundles, and Dream suggestions."},{"name":"Organization variables & secrets","description":"Organization-owned environment variables and secrets, defined once and assigned to all or selected agents. Owner-only. Secret values are write-only — accepted on create/replace and never returned."},{"name":"External memory","description":"Owner-reviewed external-memory plugin installations and org connections."},{"name":"Crons","description":"Scheduled agent runs."},{"name":"Hooks","description":"Inbound-webhook triggers — an external POST to a relay ingress URL fires an agent turn."},{"name":"Usage","description":"Token-usage reporting."},{"name":"Stream","description":"Server-sent event stream for live console updates."},{"name":"GitHub","description":"GitHub App installations powering github-app workspaces (repo picker + short-lived git credentials)."},{"name":"GitLab","description":"GitLab.com OAuth connections — the administration identity for project discovery and provisioning."}]}