{"openapi":"3.1.2","info":{"title":"Associates AI","version":"1","description":"The Associates AI REST API. Authenticate with a personal access token created on the API tokens page of your dashboard."},"servers":[{"url":"https:\/\/associatesai.team\/api\/v1"}],"security":[{"http":[]}],"paths":{"\/instances\/{instanceId}\/agents":{"get":{"operationId":"agent.index","description":"Required token scope: `agents:read`.","summary":"List all agents for an instance","tags":["Agent"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"agent.store","description":"Required token scope: `agents:write`.","summary":"Create a new agent","tags":["Agent"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"default_model":{"type":"string","default":""},"template_type":{"type":"string","default":"custom"},"extends_agent":{"type":"string"}}}}}},"responses":{"201":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}":{"get":{"operationId":"agent.show","description":"Required token scope: `agents:read`.","summary":"Get a single agent by ID","tags":["Agent"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["array","null"],"items":{}}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Agent not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"agent.destroy","description":"Required token scope: `agents:write`.","summary":"Delete an agent","tags":["Agent"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/access":{"get":{"operationId":"agentAccess.show","description":"Required token scope: `messaging:read`.","tags":["AgentAccess"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"agentAccess.store","description":"Required token scope: `messaging:write`.","tags":["AgentAccess"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"kind":{"$ref":"#\/components\/schemas\/AgentAccessKind"},"user_id":{"type":["integer","null"]}},"required":["kind"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/access\/{entryId}":{"delete":{"operationId":"agentAccess.destroy","description":"Required token scope: `messaging:write`.","tags":["AgentAccess"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"entryId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/messages":{"post":{"operationId":"agentChat.send","description":"Required token scope: `chat:write`.","tags":["AgentChat"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"conversation_id":{"type":["string","null"]}},"required":["message"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","needs_approval","done","running"]},"conversation_id":{"type":["string","null"]},"message_id":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"]}},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"state":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","text","state","expires_at"]}}},"required":["status","conversation_id","message_id","rows","approvals"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messages\/{messageId}":{"get":{"operationId":"agentChat.reply","description":"Required token scope: `chat:write`.","tags":["AgentChat"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","needs_approval","done","running"]},"conversation_id":{"type":["string","null"]},"message_id":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"]}},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"state":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","text","state","expires_at"]}}},"required":["status","conversation_id","message_id","rows","approvals"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/conversations\/{conversationId}\/reply":{"get":{"operationId":"agentChat.replyByConversation","description":"Required token scope: `chat:write`.","tags":["AgentChat"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","needs_approval","done","running"]},"conversation_id":{"type":["string","null"]},"message_id":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"]}},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"state":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","text","state","expires_at"]}}},"required":["status","conversation_id","message_id","rows","approvals"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/conversations":{"get":{"operationId":"agentChat.conversations","description":"Required token scope: `chat:write`.","tags":["AgentChat"],"parameters":[{"name":"instance_id","in":"query","schema":{"type":["string","null"]}},{"name":"limit","in":"query","schema":{"type":["integer","null"]}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"conversations":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"instance_id":{"type":"string"},"agent_id":{"type":"string"},"conversation_id":{"type":"string"},"title":{"type":"string"},"last_status":{"type":["string","null"],"enum":["failed","needs_approval","done","running",null]},"updated_at":{"type":["string","null"]}},"required":["instance_id","agent_id","conversation_id","title","last_status","updated_at"]}},{"type":"array","items":{"type":"object","properties":{"instance_id":{"type":"string"},"agent_id":{"type":"string"},"conversation_id":{"type":"string"},"title":{"type":"string"},"last_status":{"type":["string","null"],"enum":["failed","needs_approval","done","running",null]},"updated_at":{"type":["string","null"]}},"required":["instance_id","agent_id","conversation_id","title","last_status","updated_at"]}}]}},"required":["conversations"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/conversations\/{conversationId}\/approvals\/{approvalId}":{"post":{"operationId":"agentChat.decide","description":"Required token scope: `chat:write`.","tags":["AgentChat"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"decision":{"type":"string"}},"required":["decision"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["denied","working"]},"removed_message_id":{"type":["integer","null"]}},"required":["state","removed_message_id"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/config":{"get":{"operationId":"agentConfig.show","description":"Required token scope: `agents:read`.","summary":"Get agent config (is_custom, template_type, workspace files)","tags":["AgentConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"is_custom":{"type":"boolean"},"template_type":{"type":["string","null"]},"files":{"type":"array","items":{}}},"required":["is_custom","template_type","files"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/config\/files\/{file}":{"put":{"operationId":"agentConfig.saveFile","description":"Required token scope: `agents:write`.","summary":"Save a single workspace file","tags":["AgentConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"File saved."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"agentConfig.deleteFile","description":"Required token scope: `agents:write`.","summary":"Delete a single workspace file (overlay only on managed agents)","tags":["AgentConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"File deleted."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/config\/customize":{"post":{"operationId":"agentConfig.customize","description":"Required token scope: `agents:write`.","summary":"Convert a managed agent to custom mode","tags":["AgentConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Agent converted to custom mode."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/config\/template":{"put":{"operationId":"agentConfig.changeTemplate","description":"Required token scope: `agents:write`.","summary":"Change a managed agent's template type","tags":["AgentConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Template changed."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"string"}},"required":["error","errors"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/model-config":{"get":{"operationId":"agentModelConfig.show","description":"Required token scope: `agents:read`.","tags":["AgentModelConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["object","null"],"properties":{"default_model":{"type":["string","null"]},"allowed_models":{"type":"array","items":{}}},"required":["default_model","allowed_models"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Agent not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"put":{"operationId":"agentModelConfig.update","description":"Required token scope: `agents:write`.","summary":"Update model config for an agent","tags":["AgentModelConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"default_model":{"type":"string"},"allowed_models":{"type":"string"}},"required":["default_model"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/secrets":{"get":{"operationId":"agentSecret.index","description":"Required token scope: `secrets:read`.","summary":"List resolved agent secrets (key names only, never values)","tags":["AgentSecret"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/secrets\/{key}":{"put":{"operationId":"agentSecret.store","description":"Required token scope: `secrets:write`.","summary":"Create or update an agent user secret","tags":["AgentSecret"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"value":{"type":["string","null"]},"allowed_hosts":{"type":["array","null"],"items":{"type":"string"}},"clear_allowed_hosts":{"type":["boolean","null"]}}}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"message":{"type":"string","const":"Secret saved."},"warnings":{"type":"array","items":{}}},"required":["message","warnings"]},{"type":"object","properties":{"message":{"type":"string","const":"Allowed hosts updated."},"warnings":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0}},"required":["message","warnings"]}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"agentSecret.destroy","description":"Required token scope: `secrets:write`.","summary":"Delete an agent user secret","tags":["AgentSecret"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/model-config":{"get":{"operationId":"companyConfig.showModelConfig","description":"Required token scope: `config:read`.\n\n`allowed_models` is sourced from S3 (the new authoritative store).\nThe legacy `allowed_models_by_provider` field is preserved in the\nresponse shape for API back-compat but always returns []; the nested\nby-provider format does not exist in S3.","summary":"Get model config for the company","tags":["CompanyConfig"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"allowed_models":{"type":"string"},"allowed_models_by_provider":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0}},"required":["allowed_models","allowed_models_by_provider"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"put":{"operationId":"companyConfig.updateModelConfig","description":"Required token scope: `config:write`.\n\nDrives the same orchestration as the dashboard: narrowing the company\nlist also prunes per-instance overrides and (when a `replacement_model`\nis provided) reassigns agent defaults that were pointing at a removed\nmodel. Without `replacement_model`, a 409 surfaces the affected agents\nso the caller can retry with the choice the dashboard would prompt for.","summary":"Update model config for the company","tags":["CompanyConfig"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"allowed_models":{"type":"array","items":{"type":"string"},"minItems":1},"replacement_model":{"type":["string","null"]}},"required":["allowed_models"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"409":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/provider-credentials":{"get":{"operationId":"companyConfig.listProviderCredentials","description":"Required token scope: `config:read`.","summary":"List provider credential key names (never values)","tags":["CompanyConfig"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/provider-credentials\/{provider}":{"put":{"operationId":"companyConfig.saveProviderCredential","description":"Required token scope: `config:write`.","summary":"Create or update a provider credential","tags":["CompanyConfig"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Credential saved."}},"required":["message"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"companyConfig.deleteProviderCredential","description":"Required token scope: `config:write`.","summary":"Delete a provider credential","tags":["CompanyConfig"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/secrets":{"get":{"operationId":"companySecret.index","description":"Required token scope: `secrets:read`.","summary":"List company user secret key names (never values)","tags":["CompanySecret"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/secrets\/{key}":{"put":{"operationId":"companySecret.store","description":"Required token scope: `secrets:write`.","summary":"Create or update a company user secret","tags":["CompanySecret"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"value":{"type":["string","null"]},"allowed_hosts":{"type":["array","null"],"items":{"type":"string"}},"clear_allowed_hosts":{"type":["boolean","null"]}}}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"message":{"type":"string","const":"Secret saved."},"warnings":{"type":"array","items":{}}},"required":["message","warnings"]},{"type":"object","properties":{"message":{"type":"string","const":"Allowed hosts updated."},"warnings":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0}},"required":["message","warnings"]}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"companySecret.destroy","description":"Required token scope: `secrets:write`.","summary":"Delete a company user secret","tags":["CompanySecret"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/deploys":{"post":{"operationId":"deploy.store","description":"Required token scope: `deploys:write`.","summary":"Deploy all pending changes for the current client","tags":["Deploy"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Deploy initiated."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/deploys\/pending":{"delete":{"operationId":"deploy.discardPending","description":"Required token scope: `deploys:write`.","summary":"Discard all pending changes for the current client","tags":["Deploy"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"discarded_count":{"type":"integer","const":0}},"required":["discarded_count"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"get":{"operationId":"deploy.pending","description":"Required token scope: `deploys:read`.","summary":"List pending changes per server, each with the change_id discardChange takes","tags":["Deploy"],"parameters":[{"name":"instance_id","in":"query","schema":{"type":["string","null"]}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"instances":{"type":"string"}},"required":["instances"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/pending-changes\/discard":{"post":{"operationId":"deploy.discardChange","description":"Required token scope: `deploys:write`.","summary":"Discard one pending change and keep the rest","tags":["Deploy"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"change_id":{"type":"string"}},"required":["change_id"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Change discarded."}},"required":["message"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/deploys\/history":{"get":{"operationId":"deploy.history","description":"Required token scope: `deploys:read`.","summary":"List deploy history across all instances for the current client; `server`, `limit` and `before` (a deploy_timestamp) narrow and page it","tags":["Deploy"],"parameters":[{"name":"server","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"before","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/deploys\/{deployId}":{"get":{"operationId":"deploy.show","description":"Required token scope: `deploys:read`.","summary":"Get details of a specific deploy execution","tags":["Deploy"],"parameters":[{"name":"deployId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["object","null"],"properties":{"execution_arn":{"type":"string"},"status":{"type":"string","const":"rolled_back"},"started_at":{"type":["string","null"]},"stopped_at":{"type":["string","null"]},"events":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"step":{"type":"string"},"detail":{"type":"string"},"status":{"type":"string"},"duration":{"type":"string"}},"required":["timestamp","step","detail","status","duration"]}}},"required":["execution_arn","status","started_at","stopped_at","events"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Deploy not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/engineering-workflow":{"get":{"operationId":"engineeringWorkflow.show","description":"Required token scope: `agents:read`.","tags":["EngineeringWorkflow"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"503":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Greenlight settings are temporarily unavailable; try again shortly."}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"string"}},"required":["error","errors"]}}}},"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"put":{"operationId":"engineeringWorkflow.update","description":"Required token scope: `agents:write`.","tags":["EngineeringWorkflow"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"503":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Greenlight settings are temporarily unavailable; try again shortly."}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"string"}},"required":["error","errors"]}}}},"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/engineering-workflow\/agents\/{agentId}\/role":{"put":{"operationId":"engineeringWorkflow.setRole","description":"Required token scope: `agents:write`.","tags":["EngineeringWorkflow"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"role":{"type":["string","null"]}}}}}},"responses":{"503":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Greenlight settings are temporarily unavailable; try again shortly."}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/engineering-workflow\/agents\/{agentId}\/github-app":{"post":{"operationId":"engineeringWorkflow.useGithubApp","description":"Required token scope: `agents:write`.","tags":["EngineeringWorkflow"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"from_agent":{"type":"string"}},"required":["from_agent"]}}}},"responses":{"503":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Greenlight settings are temporarily unavailable; try again shortly."}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/engineering-workflow\/agents\/{agentId}\/github-app\/webhook-secret":{"put":{"operationId":"engineeringWorkflow.setGithubAppWebhookSecret","description":"Required token scope: `agents:write`.","tags":["EngineeringWorkflow"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"secret":{"type":"string","maxLength":512}},"required":["secret"]}}}},"responses":{"503":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Greenlight settings are temporarily unavailable; try again shortly."}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances":{"get":{"operationId":"instance.index","description":"Required token scope: `instances:read`.","summary":"List all instances for the current client","tags":["Instance"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"instance.store","description":"Required token scope: `instances:write`.","summary":"Create a new instance","tags":["Instance"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","maxLength":64},"diagnostics_trace_enabled":{"type":"boolean"},"runtime_backend":{"type":"string","enum":["always_on"]},"size":{"type":"string","enum":["standard_small","standard_medium","standard_large","standard_xl","performance_small","performance_medium","performance_large","performance_xl"]},"disk_size_gb":{"type":"integer","minimum":20,"maximum":1000}},"required":["display_name","size","disk_size_gb"]}}}},"responses":{"201":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}":{"get":{"operationId":"instance.show","description":"Required token scope: `instances:read`.","summary":"Get a single instance by ID","tags":["Instance"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Instance not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"put":{"operationId":"instance.update","description":"Required token scope: `instances:write`.","summary":"Update an existing instance","tags":["Instance"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","maxLength":64},"size":{"type":"string","enum":["standard_small","standard_medium","standard_large","standard_xl","performance_small","performance_medium","performance_large","performance_xl"]},"disk_size_gb":{"type":"integer","minimum":20,"maximum":1000},"runtime_backend":{"type":"string","enum":["always_on","sleeps_when_idle"]},"diagnostics_trace_enabled":{"type":"boolean"},"agent_max_concurrent":{"type":["integer","null"],"minimum":4,"maximum":20},"subagent_max_concurrent":{"type":["integer","null"],"minimum":2,"maximum":8}}}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"instance.destroy","description":"Required token scope: `instances:write`.","summary":"Delete an instance","tags":["Instance"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/shutdown":{"post":{"operationId":"instance.shutdown","description":"Required token scope: `deploys:write`.","summary":"Shut down an instance","tags":["Instance"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Shutdown initiated."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/force-deploy":{"post":{"operationId":"instance.forceDeploy","description":"Required token scope: `deploys:write`.","summary":"Force a full redeploy of an instance","tags":["Instance"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Force deploy initiated."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/model-config":{"get":{"operationId":"v1.instances.model-config.show","description":"Required token scope: `instances:read`.","tags":["InstanceModelConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["object","null"],"properties":{"allowed_models":{"type":"array","items":{}}},"required":["allowed_models"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Instance not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"put":{"operationId":"v1.instances.model-config.update","description":"Required token scope: `instances:write`.\n\nBody: { allowed_models: string[] | null, replacement_model?: string | null }\n- allowed_models null or []: clears the override (instance inherits company list)\n- allowed_models non-empty array: sets the override (must be subset of company list)\n- replacement_model (optional): when narrowing removes a model that an\n  agent has as its default, the agent is auto-reassigned to this model\n  in the same call. Without it, `affected_agents` in the response\n  surfaces who would break and the caller must follow up per-agent.","summary":"Update the instance-level allowed_models override","tags":["InstanceModelConfig"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"allowed_models":{"type":["array","null"],"items":{"type":"string"}},"replacement_model":{"type":["string","null"]}},"required":["allowed_models"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"string"},"affected_agents":{"type":"array","items":{"type":"object","properties":{"instance_id":{"type":"string"},"instance_display_name":{"type":"string"},"agent_id":{"type":["string","null"]},"default_model":{"type":["string","null"]}},"required":["instance_id","instance_display_name","agent_id","default_model"]}}},"required":["result","affected_agents"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/memory\/export":{"get":{"operationId":"memory.export","description":"Required token scope: `memories:read`.","summary":"Export all memories (up to 1000)","tags":["Memory"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0}]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/memory\/entities":{"get":{"operationId":"memory.entities","description":"Required token scope: `memories:read`.","summary":"List all entities","tags":["Memory"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/memory\/entities\/{entityId}":{"get":{"operationId":"memory.entity","description":"Required token scope: `memories:read`.","summary":"Get a single entity by ID","tags":["Memory"],"parameters":[{"name":"entityId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/memory\/recall-traces":{"get":{"operationId":"memory.recallTraces","description":"Required token scope: `memories:read`.","summary":"List recall traces","tags":["Memory"],"parameters":[{"name":"session_id","in":"query","schema":{"type":"string"}},{"name":"memory_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/memory":{"get":{"operationId":"memory.index","description":"Required token scope: `memories:read`.","summary":"Search\/list memories","tags":["Memory"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","default":""}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/memory\/{memoryId}":{"get":{"operationId":"memory.show","description":"Required token scope: `memories:read`.","summary":"Get a single memory by ID","tags":["Memory"],"parameters":[{"name":"memoryId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging":{"get":{"operationId":"messaging.show","description":"Required token scope: `messaging:read`.","summary":"Get messaging config for an instance","tags":["Messaging"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"telegram_user_ids":{"type":"object","additionalProperties":{}},"slack_user_ids":{"type":"object","additionalProperties":{}},"discord_user_ids":{"type":"object","additionalProperties":{}},"agents":{"type":"string"},"summary":{"type":"object","properties":{"telegram":{"type":"object","properties":{"enabled":{"type":"string"}},"required":["enabled"]},"slack":{"type":"object","properties":{"enabled":{"type":"string"}},"required":["enabled"]},"discord":{"type":"object","properties":{"enabled":{"type":"string"}},"required":["enabled"]}},"required":["telegram","slack","discord"]}},"required":["telegram_user_ids","slack_user_ids","discord_user_ids","agents","summary"]},{"type":"object","properties":{"telegram_user_ids":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"slack_user_ids":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"discord_user_ids":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"agents":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"summary":{"type":"object","properties":{"telegram":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"slack":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"discord":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"required":["telegram","slack","discord"]}},"required":["telegram_user_ids","slack_user_ids","discord_user_ids","agents","summary"]}]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"put":{"operationId":"messaging.update","description":"Required token scope: `messaging:write`.","summary":"Update messaging config for an instance","tags":["Messaging"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"telegram_user_ids":{"type":"object","additionalProperties":{}},"slack_user_ids":{"type":"object","additionalProperties":{}},"discord_user_ids":{"type":"object","additionalProperties":{}},"agents":{"type":"string"},"summary":{"type":"object","properties":{"telegram":{"type":"object","properties":{"enabled":{"type":"string"}},"required":["enabled"]},"slack":{"type":"object","properties":{"enabled":{"type":"string"}},"required":["enabled"]},"discord":{"type":"object","properties":{"enabled":{"type":"string"}},"required":["enabled"]}},"required":["telegram","slack","discord"]}},"required":["telegram_user_ids","slack_user_ids","discord_user_ids","agents","summary"]},{"type":"object","properties":{"telegram_user_ids":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"slack_user_ids":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"discord_user_ids":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"agents":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0},"summary":{"type":"object","properties":{"telegram":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"slack":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"discord":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"required":["telegram","slack","discord"]}},"required":["telegram_user_ids","slack_user_ids","discord_user_ids","agents","summary"]}]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging\/agents\/{agentId}\/identity":{"put":{"operationId":"messaging.updateAgentIdentity","description":"Required token scope: `messaging:write`.\n\nEmpty strings clear the corresponding stored value. Service-side\nValidationException (length \/ scheme rules) bubbles to Laravel's\ndefault 422 handler.","summary":"Set or clear the per-agent identity (display name + avatar URL)","tags":["Messaging"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]}},"required":["name","avatar_url"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string"},"name":{"type":"string"},"avatar_url":{"type":"string"}},"required":["agent_id","name","avatar_url"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging\/agents\/{agentId}\/identity\/avatar":{"post":{"operationId":"messaging.uploadAgentAvatar","description":"Required token scope: `messaging:write`.\n\nOptional `name` field re-saves the display name in the same call.\nIf omitted, the existing IDENTITY_NAME is left untouched; an empty\nstring clears it.","summary":"Upload a binary avatar image for an agent and persist it as the\nagent's IDENTITY_AVATAR_URL. Multipart upload, JPEG\/PNG, \u22642 MB \u2014\nservice validates the content via finfo and returns the public URL","tags":["Messaging"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","properties":{"avatar":{"type":"string","format":"binary","contentMediaType":"application\/octet-stream"},"name":{"type":["string","null"]}},"required":["avatar"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string"}},"required":["agent_id"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/me\/connections":{"get":{"operationId":"v1.me.connections.index","description":"Required token scope: `connections:read`.","tags":["MyConnections"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"v1.me.connections.store","description":"Required token scope: `connections:write`.","tags":["MyConnections"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"service":{"type":"string","maxLength":64}},"required":["service"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/me\/connections\/{id}":{"delete":{"operationId":"v1.me.connections.destroy","description":"Required token scope: `connections:write`.","tags":["MyConnections"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/openai-connection":{"get":{"operationId":"openAiConnection.status","description":"Required token scope: `config:read`.","tags":["OpenAiConnection"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"servers":{"type":"array","items":{}}},"required":["connected","servers"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"openAiConnection.disconnect","description":"Required token scope: `config:write`.","tags":["OpenAiConnection"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"message":{"type":"string","enum":["ChatGPT was disconnected from every server in this organization, because they shared one login. Deploy each server to apply it.","ChatGPT disconnected from this server. Deploy it to apply the change."]}},"required":["connected","message"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/openai-connection\/start":{"post":{"operationId":"openAiConnection.start","description":"Required token scope: `config:write`.","tags":["OpenAiConnection"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"device_auth_id":{"type":["string","null"]},"user_code":{"type":["string","null"]},"verification_url":{"type":"string","const":"https:\/\/auth.openai.com\/codex\/device"},"interval":{},"expires_at":{"type":"string"}},"required":["device_auth_id","user_code","verification_url","interval","expires_at"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/company\/openai-connection\/poll":{"post":{"operationId":"openAiConnection.poll","description":"Required token scope: `config:write`.","tags":["OpenAiConnection"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"device_auth_id":{"type":"string"},"user_code":{"type":"string"}},"required":["device_auth_id","user_code"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"email":{"type":["string","null"]},"plan_type":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["status","email","plan_type","message"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/pages\/{name}\/files":{"get":{"operationId":"pageFiles.index","description":"Required token scope: `apps:read`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"pageFiles.store","description":"Required token scope: `apps:write`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/pages\/{name}\/files\/retention":{"put":{"operationId":"pageFiles.retention","description":"Required token scope: `apps:write`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/pages\/{name}\/files\/{id}\/complete":{"post":{"operationId":"pageFiles.complete","description":"Required token scope: `apps:write`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/pages\/{name}\/files\/{id}":{"get":{"operationId":"pageFiles.show","description":"Required token scope: `apps:read`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"pageFiles.destroy","description":"Required token scope: `apps:write`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/pages\/{name}\/files\/{id}\/restore":{"post":{"operationId":"pageFiles.restore","description":"Required token scope: `apps:write`.","tags":["PageFiles"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/proposals":{"get":{"operationId":"proposal.index","description":"Required token scope: `instances:read`.","tags":["Proposal"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"proposals":{"type":"string"}},"required":["proposals"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/proposals\/{uuid}\/decision":{"post":{"operationId":"proposal.decide","description":"Required token scope: `deploys:write`.","tags":["Proposal"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"uuid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","deny"]},"revision":{"type":"integer","minimum":0}},"required":["decision","revision"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]},{"type":"string"}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/skills":{"get":{"operationId":"skill.catalog","description":"Required token scope: `skills:read`.","summary":"List all skills for the team (company catalog)","tags":["Skill"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/Skill"}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills":{"get":{"operationId":"skill.index","description":"Required token scope: `skills:read`.","summary":"List skills for a specific agent","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"owner_type":{"type":"string"},"owner_id":{"type":["string","null"]},"instance_id":{"type":["string","null"]},"agent_id":{"type":["string","null"]},"s3_path":{"type":"string"},"is_custom":{"type":"boolean"},"template_name":{"type":["string","null"]},"converted_from":{"type":["array","null"],"items":{}},"enabled":{"type":"boolean"},"deployed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"plugin":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"commit":{"type":["string","null"]}},"required":["id","name","commit"]}},"required":["id","name","description","owner_type","owner_id","instance_id","agent_id","s3_path","is_custom","template_name","converted_from","enabled","deployed_at","created_at","updated_at","deleted_at","plugin"]}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"skill.store","description":"Required token scope: `skills:write`.","summary":"Add a skill to an agent","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["template","scratch","existing"]}},"required":["mode"]}}}},"responses":{"201":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"$ref":"#\/components\/schemas\/Skill"},{"type":"object","properties":{"skills":{"type":"array","items":{"$ref":"#\/components\/schemas\/Skill"}}},"required":["skills"]}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills\/{name}":{"get":{"operationId":"skill.show","description":"Required token scope: `skills:read`.","summary":"Get a single skill by name","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"skill":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"owner_type":{"type":"string"},"owner_id":{"type":["string","null"]},"instance_id":{"type":["string","null"]},"agent_id":{"type":["string","null"]},"s3_path":{"type":"string"},"is_custom":{"type":"boolean"},"template_name":{"type":["string","null"]},"converted_from":{"type":["array","null"],"items":{}},"enabled":{"type":"boolean"},"deployed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"plugin":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"commit":{"type":["string","null"]}},"required":["id","name","commit"]}},"required":["id","name","description","owner_type","owner_id","instance_id","agent_id","s3_path","is_custom","template_name","converted_from","enabled","deployed_at","created_at","updated_at","deleted_at","plugin"]},"files":{"type":"array","items":{}}},"required":["skill","files"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"skill.destroy","description":"Required token scope: `skills:write`.","summary":"Delete or remove a skill from an agent","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills\/{name}\/files\/{file}":{"put":{"operationId":"skill.saveFile","description":"Required token scope: `skills:write`.","summary":"Save a file within a skill","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"File saved."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"skill.deleteFile","description":"Required token scope: `skills:write`.","summary":"Delete one file from a custom skill (staged until deploy)","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"file","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"File deleted."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills\/{name}\/files-upload":{"post":{"operationId":"skill.uploadFile","description":"Required token scope: `skills:write`.\n\nMultipart endpoint: clients post a `file` field plus a `path` field\nnaming the relative location inside the skill (e.g. `assets\/logo.png`,\n`references\/data.csv`). SKILL.md is rejected on purpose \u2014 it must use\nthe JSON-string `saveFile` endpoint above.\n\nFiles up to 200 MB are accepted; non-SKILL.md files are not subject to\nthe 200 KB SKILL.md cap.","summary":"Upload a binary (or arbitrary) file into a skill","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","contentMediaType":"application\/octet-stream","description":"Maximum file size: 204800 kilobytes."},"path":{"type":"string"}},"required":["file","path"]}}}},"responses":{"201":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"File uploaded."},"path":{"type":"string"},"bytes":{"type":"string"}},"required":["message","path","bytes"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills\/{name}\/customize":{"post":{"operationId":"skill.customize","description":"Required token scope: `skills:write`.","summary":"Convert a managed skill to custom mode","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Skill converted to custom mode."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills\/{name}\/promote":{"post":{"operationId":"skill.promote","description":"Required token scope: `skills:write`.","summary":"Promote a user-owned skill to company-owned","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Skill promoted to company level."}},"required":["message"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/skills\/{name}\/toggle":{"patch":{"operationId":"skill.toggle","description":"Required token scope: `skills:write`.","summary":"Toggle a skill's enabled status","tags":["Skill"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Skill toggled."}},"required":["message"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Skill not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/plugins":{"get":{"operationId":"skillPlugin.index","description":"Required token scope: `skills:read`.","tags":["SkillPlugin"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"path":{"type":"string"}},"required":["error","error_code","path"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"skillPlugin.store","description":"Required token scope: `skills:write`.","tags":["SkillPlugin"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":512},"ref":{"type":["string","null"],"maxLength":255},"skills_path":{"type":["string","null"],"maxLength":255},"instance_id":{"type":"string"},"agent_id":{"type":"string"}},"required":["url","instance_id","agent_id"]}}}},"responses":{"201":{"description":"","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/plugins\/{pluginId}":{"get":{"operationId":"skillPlugin.show","description":"Required token scope: `skills:read`.","tags":["SkillPlugin"],"parameters":[{"name":"pluginId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"path":{"type":"string"}},"required":["error","error_code","path"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"patch":{"operationId":"skillPlugin.update","description":"Required token scope: `skills:write`.","summary":"`ref` follows a branch or tag, or pins a full commit id; null follows the default branch. `pin_current` holds the commit in use","tags":["SkillPlugin"],"parameters":[{"name":"pluginId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"ref":{"type":["string","null"],"maxLength":255},"pin_current":{"type":"boolean"}}}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"skillPlugin.destroy","description":"Required token scope: `skills:write`.","tags":["SkillPlugin"],"parameters":[{"name":"pluginId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No content","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"path":{"type":"string"}},"required":["error","error_code","path"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/plugins\/{pluginId}\/refresh":{"post":{"operationId":"skillPlugin.refresh","description":"Required token scope: `skills:write`.","tags":["SkillPlugin"],"parameters":[{"name":"pluginId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"path":{"type":"string"}},"required":["error","error_code","path"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/agents\/{agentId}\/plugins\/{pluginId}":{"put":{"operationId":"skillPlugin.assign","description":"Required token scope: `skills:write`.","tags":["SkillPlugin"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pluginId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"path":{"type":"string"}},"required":["error","error_code","path"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"skillPlugin.unassign","description":"Required token scope: `skills:write`.","tags":["SkillPlugin"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pluginId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No content","content":{"application\/json":{"schema":{"type":["string","null"]}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Plugin not found."}},"required":["error"]}}}},"422":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"path":{"type":"string"}},"required":["error","error_code","path"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging\/agents\/{agentId}\/slack":{"get":{"operationId":"slackOnboarding.show","description":"Required token scope: `messaging:read`.","summary":"Snapshot the current wizard step + captured app\/team identifiers","tags":["SlackOnboarding"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"step":{"type":"string","const":"intro"},"app_id":{"type":"null"},"app_name":{"type":"null"},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"install"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"app_token"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"reset"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"done"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]}]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"slackOnboarding.disconnect","description":"Required token scope: `messaging:write`.","summary":"Wipe all Slack credentials so the wizard returns to the intro step","tags":["SlackOnboarding"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"step":{"type":"string","const":"intro"},"app_id":{"type":"null"},"app_name":{"type":"null"},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"install"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"app_token"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"reset"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"done"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]}]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging\/agents\/{agentId}\/slack\/config-token":{"post":{"operationId":"slackOnboarding.submitConfigToken","description":"Required token scope: `messaging:write`.","summary":"Step 1: paste the config token, create the Slack app, capture credentials","tags":["SlackOnboarding"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"config_token":{"type":"string"}},"required":["config_token"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"step":{"type":"string","const":"intro"},"app_id":{"type":"null"},"app_name":{"type":"null"},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"install"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"app_token"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"reset"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"done"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging\/agents\/{agentId}\/slack\/app-token":{"post":{"operationId":"slackOnboarding.submitAppToken","description":"Required token scope: `messaging:write`.","summary":"Step 2: paste the xapp-* app-level token, verify it, persist it","tags":["SlackOnboarding"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"app_token":{"type":"string"}},"required":["app_token"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"step":{"type":"string","const":"intro"},"app_id":{"type":"null"},"app_name":{"type":"null"},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"install"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"app_token"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"reset"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"done"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/messaging\/agents\/{agentId}\/slack\/oauth\/complete":{"post":{"operationId":"slackOnboarding.completeOAuth","description":"Required token scope: `messaging:write`.","summary":"Step 4 (callback): exchange OAuth code for credentials and persist","tags":["SlackOnboarding"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"redirect_uri":{"type":"string"}},"required":["code","redirect_uri"]}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"anyOf":[{"type":"object","properties":{"step":{"type":"string","const":"intro"},"app_id":{"type":"null"},"app_name":{"type":"null"},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"install"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"app_token"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"reset"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":"null"}},"required":["step","app_id","app_name","team_id"]},{"type":"object","properties":{"step":{"type":"string","const":"done"},"app_id":{"type":["string","null"]},"app_name":{"type":["string","null"]},"team_id":{"type":["string","null"]}},"required":["step","app_id","app_name","team_id"]}]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/webhooks":{"get":{"operationId":"webhook.index","description":"Required token scope: `webhooks:read`.","summary":"List all webhooks for an instance","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"webhook.store","description":"Required token scope: `webhooks:write`.","summary":"Create a new webhook","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/webhooks\/{webhookId}":{"put":{"operationId":"webhook.update","description":"Required token scope: `webhooks:write`.","summary":"Update an existing webhook","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Webhook not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"webhook.destroy","description":"Required token scope: `webhooks:write`.","summary":"Delete a webhook","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/webhooks\/{webhookId}\/toggle":{"patch":{"operationId":"webhook.toggle","description":"Required token scope: `webhooks:write`.","summary":"Toggle a webhook's enabled status","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"array","items":{}}}}},"404":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","const":"Webhook not found."}},"required":["error"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/webhooks\/{webhookId}\/regenerate-secret":{"post":{"operationId":"webhook.regenerateSecret","description":"Required token scope: `webhooks:write`.","summary":"Regenerate a webhook's secret","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/instances\/{instanceId}\/webhooks\/{webhookId}\/switch-to-managed":{"get":{"operationId":"webhook.switchPreview","description":"Required token scope: `webhooks:read`.","summary":"Preview a legacy QA webhook's current text next to the managed text","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"current":{"type":"object","properties":{"filter":{"type":"string"},"transform":{"type":"string"},"deliver":{"type":"boolean"}},"required":["filter","transform","deliver"]},"managed":{"type":"object","properties":{"filter":{"type":"string"},"transform":{"type":"string"},"deliver":{"type":"boolean"}},"required":["filter","transform","deliver"]}},"required":["current","managed"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"webhook.switchToManaged","description":"Required token scope: `webhooks:write`.","summary":"Convert a legacy QA webhook to a Greenlight-managed one","tags":["Webhook"],"parameters":[{"name":"instanceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"confirm":{"enum":["yes","on","1",1,"true",true]}}}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}}},"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"AgentAccessKind":{"type":"string","enum":["person","team","unlinked","slack_workspace"],"title":"AgentAccessKind"},"Skill":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"owner_type":{"type":"string"},"owner_id":{"type":["string","null"]},"instance_id":{"type":["string","null"]},"agent_id":{"type":["string","null"]},"s3_path":{"type":"string"},"is_custom":{"type":"boolean"},"template_name":{"type":["string","null"]},"converted_from":{"type":["array","null"],"items":{}},"enabled":{"type":"boolean"},"deployed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id","name","description","owner_type","owner_id","instance_id","agent_id","s3_path","is_custom","template_name","converted_from","enabled","deployed_at","created_at","updated_at","deleted_at"],"title":"Skill"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}}}