openapi: 3.1.0 info: title: Agent Controller API version: 1.0.0 description: | HTTP API for managing clients and proxied agent operations. **Roles:** operations documented as admin-only are also available to the `manager` role, except tenant / system settings, identity app management (`/apps`) and managing the accounts (and tokens) of managers and admins, which stay reserved to admins. contact: name: ForePath email: hi@forepath.io url: https://forepath.io servers: - url: http://localhost:3100/api description: Local development - url: http://localhost:3100 description: Root (OpenTelemetry metrics; outside /api prefix) security: - bearerAuth: [] - mutualTLS: [] - certificateAssertion: [] paths: /auth/login: post: summary: Login (users auth only) description: | Interactive console login with account password only. Personal access tokens are not accepted; use POST /auth/token instead. operationId: login security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LoginDto' responses: '200': description: JWT access token and user info content: application/json: schema: $ref: '#/components/schemas/LoginResponse' '401': description: | Invalid credentials, account locked, email not confirmed, or two-factor authentication required. When the password is valid but the email is not confirmed, the body includes `code: EMAIL_NOT_CONFIRMED` so the client can resume confirmation. When a second factor is required, the body includes `code: LOGIN_2FA_REQUIRED` and `method: email|totp`. Retry with the same email/password plus `code`. When a submitted code is wrong or expired, the body includes `code: LOGIN_2FA_INVALID` (show the message; do not treat as a fresh challenge). When the login-2FA email cannot be sent, the API returns 503 instead of a challenge. /auth/2fa: get: summary: Get current user two-factor status (users auth only) operationId: getTwoFactorStatus responses: '200': description: Two-factor status for the authenticated user content: application/json: schema: $ref: '#/components/schemas/TwoFactorStatusDto' '401': description: Not authenticated /auth/2fa/email/enable: post: summary: Enable email two-factor authentication (users auth only) description: | Without `code`, sends a verification email. With a valid `code`, enables email 2FA. operationId: enableEmail2fa requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/EnableEmail2faDto' responses: '200': description: Email 2FA pending confirmation or enabled '400': description: Invalid verification code '401': description: Not authenticated /auth/2fa/email: delete: summary: Disable email two-factor authentication (users auth only) description: Requires the account password (step-up) before disabling. operationId: disableEmail2fa requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CurrentPasswordDto' responses: '200': description: Email 2FA disabled '401': description: Not authenticated or incorrect password /auth/2fa/totp/setup: post: summary: Start authenticator (TOTP) enrollment (users auth only) description: | Generates a provisional TOTP secret. Requires the account password (step-up). Rejected with 400 when authenticator is already enabled; disable the current authenticator first (requires a valid TOTP code). operationId: setupTotp requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CurrentPasswordDto' responses: '200': description: Provisional TOTP secret and otpauth URL content: application/json: schema: $ref: '#/components/schemas/TotpSetupResponseDto' '400': description: Authenticator already enabled '401': description: Not authenticated or incorrect password /auth/2fa/totp/confirm: post: summary: Confirm authenticator enrollment with a TOTP code (users auth only) description: | Enables authenticator 2FA after setup (password step-up already completed on setup). Invalidates existing sessions (token version bump) and returns a fresh interactive JWT. operationId: confirmTotp requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ConfirmTotpDto' responses: '200': description: Authenticator enabled; returns a new access token content: application/json: schema: $ref: '#/components/schemas/ChangePasswordResponse' '400': description: Invalid code, setup not started, or authenticator already enabled '401': description: Not authenticated /auth/2fa/totp: delete: summary: Disable authenticator (requires current TOTP code) description: | Disables authenticator 2FA and invalidates existing sessions (token version bump). Returns a fresh interactive JWT for the current session. operationId: disableTotp requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DisableTotpDto' responses: '200': description: Authenticator disabled; returns a new access token content: application/json: schema: $ref: '#/components/schemas/ChangePasswordResponse' '400': description: Invalid code or not enabled '401': description: Not authenticated /auth/token: post: summary: Exchange personal access token for machine JWT description: | Token-only exchange (no email). Returns a JWT with `amr: ["pat"]` and capability `scopes`. Must not be used for console sessions. operationId: exchangePersonalAccessToken security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ExchangePersonalAccessTokenDto' responses: '200': description: JWT access token, user info, and scopes content: application/json: schema: $ref: '#/components/schemas/PatLoginResponse' '401': description: Invalid, expired, or revoked token /auth/register: post: summary: Register new user (users auth only) description: | Registers a new user. When DISABLE_SIGNUP is true, returns 503 Service Unavailable. operationId: register security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegisterDto' responses: '201': description: User created (first user auto-confirmed, others receive 6-character alphanumeric confirmation code via email) content: application/json: schema: $ref: '#/components/schemas/RegisterResponse' '409': description: Email already registered '503': description: Signup is disabled (DISABLE_SIGNUP=true) /auth/confirm-email: post: summary: Confirm email with 6-character code (users auth only) operationId: confirmEmail security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ConfirmEmailDto' responses: '200': description: Email confirmed '400': description: Invalid or expired confirmation code /auth/request-password-reset: post: summary: Request password reset (users auth only) operationId: requestPasswordReset security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RequestPasswordResetDto' responses: '200': description: If an account exists with this email, a 6-character password reset code will be sent /auth/reset-password: post: summary: Reset password with 6-character code (users auth only) operationId: resetPassword security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ResetPasswordDto' responses: '200': description: Password reset '400': description: Invalid or expired reset code /auth/change-password: post: summary: Change password (authenticated users) operationId: changePassword requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChangePasswordDto' responses: '200': description: Password changed content: application/json: schema: $ref: '#/components/schemas/ChangePasswordResponse' '400': description: Passwords do not match or invalid '401': description: Current password incorrect /auth/logout: post: summary: Log out (users and saml auth; revokes current session by default) operationId: logout requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/LogoutDto' responses: '204': description: Session invalidated '401': description: Unauthorized /auth/saml/login: get: summary: Start SAML sign-in (saml auth only) description: | Redirects the browser to the IdP (HTTP-Redirect binding). The console generates a PKCE verifier and passes its S256 challenge; only the browser holding the verifier can redeem the resulting code. operationId: samlLogin security: [] parameters: - in: query name: code_challenge required: true schema: type: string pattern: '^[A-Za-z0-9_-]{43}$' description: base64url(SHA-256(code_verifier)) - in: query name: redirect required: false schema: type: string description: Same-origin console path to return to (anything else falls back to `/`) responses: '302': description: Redirect to the identity provider '400': description: Missing or invalid `code_challenge` /auth/saml/acs: post: summary: SAML Assertion Consumer Service (saml auth only) description: | Receives the IdP response (HTTP-POST binding). Validates signatures, audience, issuer, `InResponseTo` (single use; unsolicited responses are rejected) and assertion replay, links the identity to a local user, and redirects to `SAML_FRONTEND_CALLBACK_URL` with `code` and `redirect`, or `error=saml_failed`. operationId: samlAssertionConsumerService security: [] requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object required: [SAMLResponse, RelayState] properties: SAMLResponse: type: string RelayState: type: string responses: '303': description: Redirect to the console callback /auth/saml/token: post: summary: Redeem SAML login code (saml auth only) description: | Exchanges the single-use code (60 s) and PKCE verifier for a console session JWT (`amr: ["saml"]`). operationId: samlToken security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SamlTokenExchangeDto' responses: '200': description: Session JWT content: application/json: schema: $ref: '#/components/schemas/SamlTokenResponse' '401': description: Invalid, expired or already used code, or verifier mismatch /auth/saml/metadata: get: summary: SAML service provider metadata (saml auth only) operationId: samlMetadata security: [] responses: '200': description: SP metadata content: application/samlmetadata+xml: schema: type: string /auth/role: get: summary: Console role of the current user description: > Role from the local users table (OIDC sessions carry no local role claim). Interactive sessions only. operationId: getSessionRole responses: '200': description: Current role content: application/json: schema: type: object required: [role] properties: role: $ref: '#/components/schemas/UserRole' '401': description: Unauthorized /auth/token-scopes: get: summary: List grantable PAT scopes for the current user operationId: listPersonalAccessTokenScopes responses: '200': description: Scope catalog filtered by role content: application/json: schema: type: array items: $ref: '#/components/schemas/PersonalAccessTokenScopeDto' '401': description: Unauthorized '403': description: Password session required /auth/tokens: get: summary: List own personal access tokens operationId: listPersonalAccessTokens responses: '200': description: Active tokens (no hashes) content: application/json: schema: type: array items: $ref: '#/components/schemas/PersonalAccessTokenResponseDto' '401': description: Unauthorized '403': description: Password session required post: summary: Create a personal access token operationId: createPersonalAccessToken requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreatePersonalAccessTokenDto' responses: '201': description: Token created; plaintext returned once content: application/json: schema: $ref: '#/components/schemas/PersonalAccessTokenResponseDto' '400': description: Invalid scopes or name '401': description: Unauthorized '403': description: Password session required or cannot grant scopes /auth/tokens/{id}: patch: summary: Update own personal access token name and scopes operationId: updatePersonalAccessToken parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdatePersonalAccessTokenDto' responses: '200': description: Token updated (secret unchanged) content: application/json: schema: $ref: '#/components/schemas/PersonalAccessTokenResponseDto' '400': description: Invalid scopes or name '401': description: Unauthorized '403': description: Password session required or cannot grant scopes '404': description: Token not found delete: summary: Revoke own personal access token operationId: revokePersonalAccessToken parameters: - in: path name: id required: true schema: type: string format: uuid responses: '204': description: Revoked '401': description: Unauthorized '403': description: Password session required '404': description: Token not found /auth/apps/token: post: summary: Exchange an app authorization code or refresh token for an app access token description: | Server-to-server endpoint for apps (authenticated by app id + app secret). - `authorization_code`: the `code` from the return URL (+ `code_verifier` when PKCE S256 was used). Codes are single-use and expire after 10 minutes; replaying a code revokes the session it created. - `refresh_token`: rotating refresh token; every refresh returns a new one and replaying an old one revokes the session. Access tokens are JWTs with `amr: ["pat", "app"]` and the effective `scopes` (consented ∩ app scopes ∩ what the user's role may grant). They are checked live on every request and stop working when the authorization, the session or the app is revoked or deleted. Accepts JSON or `application/x-www-form-urlencoded` bodies. operationId: exchangeAppToken security: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AppTokenRequestDto' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/AppTokenRequestDto' responses: '200': description: Access + refresh token content: application/json: schema: $ref: '#/components/schemas/AppTokenResponseDto' '400': description: '`invalid_grant` (unknown, expired, replayed or foreign code / refresh token) or invalid request' '401': description: '`invalid_client` (unknown app or wrong secret)' '429': description: Too many attempts /auth/apps/authorize: get: summary: Grant page data (interactive sessions only) description: | Returns the app, the scopes the signed-in user can grant and those they cannot, whether an up-to-date authorization already exists (consent can be skipped) and the second factor needed to approve. operationId: getAppAuthorization parameters: - { in: query, name: app_id, required: true, schema: { type: string, format: uuid }, } - { in: query, name: state, required: false, schema: { type: string, maxLength: 512 }, } - { in: query, name: code_challenge, required: false, schema: { type: string }, } - { in: query, name: code_challenge_method, required: false, schema: { type: string, enum: [S256] }, } responses: '200': description: Authorization request details content: application/json: schema: $ref: '#/components/schemas/AppAuthorizationInfoDto' '401': description: Unauthorized '403': description: Personal access tokens and app tokens cannot use this endpoint '404': description: App not found post: summary: Approve or deny an app (interactive sessions only) description: | Approve stores the consent (capped to what the user may grant) and returns the redirect to the app's return URL with `status=approved&app_id&code&state`. Deny returns `status=denied&error=access_denied&state`. When the user has two-factor authentication and the app is not yet authorized (or needs re-authorization), approve without `code` answers 401 `APP_AUTHORIZATION_2FA_REQUIRED` (an email code is sent for email 2FA). operationId: decideAppAuthorization requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AppAuthorizationDecisionDto' responses: '200': description: Redirect to the app content: application/json: schema: type: object required: [redirectUrl] properties: redirectUrl: type: string format: uri '401': description: Unauthorized, or `APP_AUTHORIZATION_2FA_REQUIRED` / `APP_AUTHORIZATION_2FA_INVALID` '403': description: Personal access tokens and app tokens cannot use this endpoint '404': description: App not found /auth/apps/grants: get: summary: List the apps the current user authorized operationId: listOwnAppGrants responses: '200': description: Own authorizations content: application/json: schema: type: array items: $ref: '#/components/schemas/IdentityAppGrantResponseDto' '401': description: Unauthorized '403': description: Interactive session required /auth/apps/grants/{grantId}: delete: summary: Revoke an own app authorization operationId: revokeOwnAppGrant parameters: - { in: path, name: grantId, required: true, schema: { type: string, format: uuid }, } responses: '204': description: Revoked; the app's sessions end immediately '401': description: Unauthorized '403': description: Interactive session required '404': description: Authorization not found /apps: description: Admins only (not available to managers). get: summary: List apps (admin, interactive session) operationId: listIdentityApps responses: '200': description: Apps of the tenant (no secrets) content: application/json: schema: type: array items: $ref: '#/components/schemas/IdentityAppResponseDto' '401': description: Unauthorized '403': description: Admin and interactive session required post: summary: Create an app (admin, interactive session) operationId: createIdentityApp requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IdentityAppInputDto' responses: '201': description: App created; `secret` is returned once (only its bcrypt hash is stored) content: application/json: schema: $ref: '#/components/schemas/IdentityAppResponseDto' '400': description: Invalid name, return URL or scopes '401': description: Unauthorized '403': description: Admin and interactive session required /apps/{id}: get: summary: Get an app (admin) operationId: getIdentityApp parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } responses: '200': description: App content: application/json: schema: $ref: '#/components/schemas/IdentityAppResponseDto' '404': description: App not found patch: summary: Update an app (admin) description: Removed scopes take effect immediately; added scopes require users to re-authorize. operationId: updateIdentityApp parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IdentityAppInputDto' responses: '200': description: App updated content: application/json: schema: $ref: '#/components/schemas/IdentityAppResponseDto' '400': description: Invalid input '404': description: App not found delete: summary: Delete an app with all authorizations (admin) operationId: deleteIdentityApp parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } responses: '204': description: Deleted '404': description: App not found /apps/{id}/secret: post: summary: Regenerate the app secret (admin) operationId: rotateIdentityAppSecret parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } responses: '200': description: New `secret` returned once content: application/json: schema: $ref: '#/components/schemas/IdentityAppResponseDto' '404': description: App not found /apps/{id}/grants: get: summary: List user authorizations of an app (admin) operationId: listIdentityAppGrants parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } responses: '200': description: Authorizations content: application/json: schema: type: array items: $ref: '#/components/schemas/IdentityAppGrantResponseDto' '404': description: App not found delete: summary: Revoke all authorizations of an app and force re-authentication (admin) operationId: revokeAllIdentityAppGrants parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } responses: '200': description: Number of revoked authorizations content: application/json: schema: type: object properties: revoked: type: integer '404': description: App not found /apps/{id}/grants/{grantId}: delete: summary: Revoke one user's authorization and force re-authentication (admin) operationId: revokeIdentityAppGrant parameters: - { in: path, name: id, required: true, schema: { type: string, format: uuid }, } - { in: path, name: grantId, required: true, schema: { type: string, format: uuid }, } responses: '204': description: Revoked '404': description: Authorization not found /users/{userId}/tokens: get: summary: List personal access tokens for a user (admin or manager) operationId: listUserPersonalAccessTokens parameters: - in: path name: userId required: true schema: type: string format: uuid responses: '200': description: Tokens for user content: application/json: schema: type: array items: $ref: '#/components/schemas/PersonalAccessTokenResponseDto' '401': description: Unauthorized '403': description: Admin + password session required /users/{userId}/tokens/{tokenId}: delete: summary: Revoke a user's personal access token (admin or manager) operationId: revokeUserPersonalAccessToken parameters: - in: path name: userId required: true schema: type: string format: uuid - in: path name: tokenId required: true schema: type: string format: uuid responses: '204': description: Revoked '401': description: Unauthorized '403': description: Admin + password session required '404': description: Token not found /users: description: > Admins manage every account. Managers may list all accounts but only create regular users and only update, lock, unlock, confirm, reset 2FA of, delete, or manage tokens of regular users (403 otherwise). get: summary: List users (admin or manager) operationId: listUsers security: - bearerAuth: [users:admin] parameters: - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 responses: '200': description: Array of users content: application/json: schema: type: array items: $ref: '#/components/schemas/UserResponseDto' post: summary: Create user (admin or manager) operationId: createUser security: - bearerAuth: [users:admin] description: > Creates a new user. First user is auto-confirmed. Non-first users receive a confirmation email (same as self-registration); they must confirm before logging in. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateUserDto' responses: '201': description: User created (first user auto-confirmed, others receive confirmation email) content: application/json: schema: $ref: '#/components/schemas/UserResponseDto' '409': description: Email already exists /users/{id}: get: summary: Get user by id (admin or manager) operationId: getUser security: - bearerAuth: [users:admin] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: User content: application/json: schema: $ref: '#/components/schemas/UserResponseDto' '404': description: User not found post: summary: Update user (admin or manager) operationId: updateUser security: - bearerAuth: [users:admin] description: > Updates a user. When email is changed, the account is set unconfirmed and a confirmation email is sent to the new address (same as self-registration). parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateUserDto' responses: '200': description: User updated (email change triggers confirmation email to new address) content: application/json: schema: $ref: '#/components/schemas/UserResponseDto' '404': description: User not found delete: summary: Delete user (admin or manager) operationId: deleteUser security: - bearerAuth: [users:admin] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '204': description: User deleted '404': description: User not found /users/{id}/lock: post: summary: Lock user account (admin or manager) operationId: lockUser security: - bearerAuth: [users:admin] description: > Locks the target user account immediately. Locked users cannot authenticate in users-auth mode. Admins cannot lock themselves. parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: User locked content: application/json: schema: $ref: '#/components/schemas/UserResponseDto' '400': description: Self-lock is not allowed '404': description: User not found /users/{id}/unlock: post: summary: Unlock user account (admin or manager) operationId: unlockUser security: - bearerAuth: [users:admin] description: > Unlocks the target user account by clearing lock timestamp. Admins cannot unlock themselves. parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: User unlocked content: application/json: schema: $ref: '#/components/schemas/UserResponseDto' '400': description: Self-unlock is not allowed '404': description: User not found /users/{id}/confirm-email: post: summary: Confirm a user's email (admin or manager) operationId: confirmUserEmail security: - bearerAuth: [users:admin] description: > Marks the target user's email as confirmed without a code and clears any outstanding confirmation code. Idempotent for users that are already confirmed. parameters: - name: id in: path required: true schema: { type: string, format: uuid } responses: '200': description: Email confirmed (or already confirmed) content: application/json: schema: $ref: '#/components/schemas/UserResponseDto' '404': description: User not found /users/{id}/2fa/totp: delete: summary: Admin / manager remove authenticator 2FA from a user operationId: adminClearUserTotp security: - bearerAuth: [users:admin] description: > Clears the user's authenticator enrollment without requiring their TOTP code. When force login 2FA is enabled, the user falls back to email OTP on next login. parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Authenticator removed '404': description: User not found /connections/atlassian/connections: get: summary: List Atlassian site connections (admin only) operationId: listAtlassianSiteConnections security: - bearerAuth: [connections:admin] parameters: - in: query name: limit required: false schema: type: integer minimum: 1 default: 10 description: Maximum number of connections to return - in: query name: offset required: false schema: type: integer minimum: 0 default: 0 description: Number of connections to skip (pagination) - in: query name: search schema: type: string description: Case-insensitive search across label, baseUrl, accountEmail, oauthClientId, id responses: '200': description: Connections (API tokens and OAuth client secrets never returned) content: application/json: schema: type: array items: $ref: '#/components/schemas/AtlassianSiteConnectionResponseDto' '403': description: Forbidden post: summary: Create Atlassian site connection (admin only) operationId: createAtlassianSiteConnection security: - bearerAuth: [connections:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAtlassianSiteConnectionDto' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/AtlassianSiteConnectionResponseDto' '400': description: Validation error '403': description: Forbidden /connections/atlassian/connections/{id}: parameters: - in: path name: id required: true schema: type: string format: uuid get: summary: Get Atlassian site connection (admin only) operationId: getAtlassianSiteConnection security: - bearerAuth: [connections:admin] responses: '200': description: Connection content: application/json: schema: $ref: '#/components/schemas/AtlassianSiteConnectionResponseDto' '403': description: Forbidden '404': description: Not found put: summary: Update Atlassian site connection (admin only) operationId: updateAtlassianSiteConnection security: - bearerAuth: [connections:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateAtlassianSiteConnectionDto' responses: '200': description: Updated content: application/json: schema: $ref: '#/components/schemas/AtlassianSiteConnectionResponseDto' '403': description: Forbidden '404': description: Not found delete: summary: Delete Atlassian site connection (admin only) operationId: deleteAtlassianSiteConnection security: - bearerAuth: [connections:admin] responses: '204': description: Deleted '403': description: Forbidden '404': description: Not found /connections/atlassian/connections/{id}/test: post: summary: Test Atlassian connection (admin only) description: >- Resolves credentials (OAuth client credentials token + cloud id for `app`, Basic for `token`) and calls Jira `/rest/api/3/myself`, falling back to Confluence `/rest/api/space`. The result is persisted as `lastTestStatus` / `lastTestMessage` / `lastTestedAt`; messages never contain credentials. operationId: testAtlassianSiteConnection security: - bearerAuth: [connections:admin] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Result content: application/json: schema: $ref: '#/components/schemas/AtlassianConnectionTestResultDto' '403': description: Forbidden '404': description: Not found /connections/atlassian/configs: get: summary: List external import configs (admin only) operationId: listExternalImportConfigs security: - bearerAuth: [connections:admin] parameters: - in: query name: limit required: false schema: type: integer minimum: 1 default: 10 description: Maximum number of configs to return - in: query name: offset required: false schema: type: integer minimum: 0 default: 0 description: Number of configs to skip (pagination) - in: query name: search schema: type: string description: Case-insensitive search across provider, importKind, jql, cql, confluenceSpaceKey, id responses: '200': description: Configs content: application/json: schema: type: array items: $ref: '#/components/schemas/ExternalImportConfigResponseDto' '403': description: Forbidden post: summary: Create import config (admin only) operationId: createExternalImportConfig security: - bearerAuth: [connections:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateExternalImportConfigDto' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/ExternalImportConfigResponseDto' '400': description: Validation error '403': description: Forbidden /connections/atlassian/configs/{id}: parameters: - in: path name: id required: true schema: type: string format: uuid get: summary: Get import config (admin only) operationId: getExternalImportConfig security: - bearerAuth: [connections:admin] responses: '200': description: Config content: application/json: schema: $ref: '#/components/schemas/ExternalImportConfigResponseDto' '403': description: Forbidden '404': description: Not found put: summary: Update import config (admin only) operationId: updateExternalImportConfig security: - bearerAuth: [connections:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateExternalImportConfigDto' responses: '200': description: Updated content: application/json: schema: $ref: '#/components/schemas/ExternalImportConfigResponseDto' '403': description: Forbidden '404': description: Not found delete: summary: Delete import config (admin only) operationId: deleteExternalImportConfig security: - bearerAuth: [connections:admin] responses: '204': description: Deleted '403': description: Forbidden '404': description: Not found /connections/atlassian/configs/{id}/run: post: summary: Run import once for config (admin only) operationId: runExternalImportConfig security: - bearerAuth: [connections:admin] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '202': description: Accepted '403': description: Forbidden /connections/atlassian/configs/{id}/markers: delete: summary: Clear sync markers for config (admin only) operationId: clearExternalImportMarkers security: - bearerAuth: [connections:admin] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '204': description: Cleared '403': description: Forbidden /knowledge: get: summary: List knowledge nodes for a workspace description: | Requires `knowledge:read`. Returns flat node list for the given `clientId`. For realtime tree coherence, subscribe to Socket.IO namespace **pages** (AsyncAPI `pages/*`). operationId: listKnowledgeNodes security: - bearerAuth: [knowledge:read] parameters: - in: query name: clientId required: true schema: { type: string, format: uuid } - in: query name: search schema: type: string description: Case-insensitive search across title, content, nodeType, id responses: '200': description: Knowledge nodes content: application/json: schema: type: array items: $ref: '#/components/schemas/KnowledgeNodeResponseDto' post: summary: Create knowledge node description: Requires `knowledge:write`. operationId: createKnowledgeNode security: - bearerAuth: [knowledge:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateKnowledgeNodeDto' responses: '201': description: Created node content: application/json: schema: $ref: '#/components/schemas/KnowledgeNodeResponseDto' /knowledge/upload: post: summary: Upload UTF-8 text files as knowledge pages description: | Requires `knowledge:write`. Accepts `.md`, `.mmd`, and `.txt` only. Rejects path separators, binary (null-byte) content, and oversized payloads. `onConflict`: `reject` (default), `replace` (overwrite matching page content), or `number` (create as `Title (n)`). Colliding folder siblings are always numbered (cannot replace a folder). operationId: uploadKnowledgeTextFiles security: - bearerAuth: [knowledge:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UploadKnowledgeTextDto' responses: '201': description: Upload result (created, updated, rejected) content: application/json: schema: $ref: '#/components/schemas/UploadKnowledgeTextResultDto' '400': description: Invalid request '403': description: Forbidden /knowledge/tree: get: summary: Get knowledge tree for a workspace description: >- Requires `knowledge:read`. Returns nested folder/page tree. With `search`, only the matching nodes are returned, together with their ancestor folders so every match stays reachable from the root; each node then carries `searchMatch` (`false` on ancestor folders included only as context). operationId: getKnowledgeTree security: - bearerAuth: [knowledge:read] parameters: - in: query name: clientId required: true schema: { type: string, format: uuid } - in: query name: search required: false schema: { type: string } description: Case-insensitive search (trimmed, first 200 characters) across node title, page content, node type and id responses: '200': description: Nested knowledge tree (search matches plus their ancestors when `search` is set) content: application/json: schema: type: array items: $ref: '#/components/schemas/KnowledgeNodeResponseDto' /knowledge/by-sha: get: summary: Get knowledge node by content SHA description: Requires `knowledge:read`. operationId: getKnowledgeNodeBySha security: - bearerAuth: [knowledge:read] parameters: - in: query name: clientId required: true schema: { type: string, format: uuid } - in: query name: sha required: true schema: { type: string } responses: '200': description: Matching node content: application/json: schema: $ref: '#/components/schemas/KnowledgeNodeResponseDto' '404': description: Not found /knowledge/relations: get: summary: List knowledge relations for a source description: Requires `knowledge:read`. operationId: listKnowledgeRelations security: - bearerAuth: [knowledge:read] parameters: - in: query name: clientId required: true schema: { type: string, format: uuid } - in: query name: sourceType required: true schema: { type: string, enum: [ticket, page] } - in: query name: sourceId required: true schema: { type: string, format: uuid } responses: '200': description: Relations content: application/json: schema: type: array items: $ref: '#/components/schemas/KnowledgeRelationResponseDto' post: summary: Create knowledge relation description: Requires `knowledge:write`. Emits `knowledgeRelationChanged` on pages and tickets namespaces. operationId: createKnowledgeRelation security: - bearerAuth: [knowledge:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateKnowledgeRelationDto' responses: '201': description: Created relation content: application/json: schema: $ref: '#/components/schemas/KnowledgeRelationResponseDto' /knowledge/relations/prompt-context: get: summary: Collect prompt context sections for a source description: Requires `knowledge:read`. operationId: getKnowledgePromptContext security: - bearerAuth: [knowledge:read] parameters: - in: query name: clientId required: true schema: { type: string, format: uuid } - in: query name: sourceType required: true schema: { type: string, enum: [ticket, page] } - in: query name: sourceId required: true schema: { type: string, format: uuid } responses: '200': description: Prompt sections content: application/json: schema: $ref: '#/components/schemas/KnowledgePromptContextResponseDto' /knowledge/relations/{id}: delete: summary: Delete knowledge relation description: Requires `knowledge:write`. operationId: deleteKnowledgeRelation security: - bearerAuth: [knowledge:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: '204': description: Deleted /knowledge/{id}: get: summary: Get knowledge node by id description: Requires `knowledge:read`. operationId: getKnowledgeNode security: - bearerAuth: [knowledge:read] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: '200': description: Node content: application/json: schema: $ref: '#/components/schemas/KnowledgeNodeResponseDto' '404': description: Not found patch: summary: Update knowledge node description: Requires `knowledge:write`. operationId: updateKnowledgeNode security: - bearerAuth: [knowledge:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateKnowledgeNodeDto' responses: '200': description: Updated node content: application/json: schema: $ref: '#/components/schemas/KnowledgeNodeResponseDto' delete: summary: Delete knowledge node description: | Requires `knowledge:write`. Optional `releaseExternalSyncMarker=true` clears external sync markers. operationId: deleteKnowledgeNode security: - bearerAuth: [knowledge:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } - in: query name: releaseExternalSyncMarker schema: { type: string, enum: ['true', '1', 'false', '0'] } responses: '204': description: Deleted /knowledge/{id}/activity: get: summary: List knowledge page activity description: Requires `knowledge:read`. operationId: listKnowledgePageActivity security: - bearerAuth: [knowledge:read] parameters: - in: path name: id required: true schema: { type: string, format: uuid } - in: query name: limit schema: { type: integer, default: 50 } - in: query name: offset schema: { type: integer, default: 0 } responses: '200': description: Activity rows content: application/json: schema: type: array items: $ref: '#/components/schemas/KnowledgePageActivityResponseDto' /knowledge/{id}/attachments: parameters: - in: path name: id required: true schema: { type: string, format: uuid } get: summary: List knowledge page attachments description: Requires `attachments:read`; caller must be able to read the page workspace. operationId: listKnowledgePageAttachments security: - bearerAuth: [attachments:read] responses: '200': description: Attachment list content: application/json: schema: type: array items: { $ref: '#/components/schemas/AttachmentResponseDto' } post: summary: Upload knowledge page attachment description: Requires `attachments:write`; multipart field name is `file`. operationId: uploadKnowledgePageAttachment security: - bearerAuth: [attachments:write] requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: { type: string, format: binary } responses: '201': description: Uploaded attachment content: application/json: schema: { $ref: '#/components/schemas/AttachmentResponseDto' } /knowledge/{id}/attachments/{attachmentId}: delete: summary: Delete knowledge page attachment metadata description: Requires `attachments:write`; caller must be able to write the page workspace. operationId: deleteKnowledgePageAttachment security: - bearerAuth: [attachments:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } - in: path name: attachmentId required: true schema: { type: string, format: uuid } responses: '204': { description: Deleted } /attachments/chat: post: summary: Upload chat context attachment description: Requires `attachments:write`; multipart field name is `file`. The returned id can be sent in chat `contextInjection.attachmentIds`. operationId: uploadChatAttachment security: - bearerAuth: [attachments:write] parameters: - in: query name: clientId required: true schema: { type: string, format: uuid } requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: { type: string, format: binary } responses: '201': description: Uploaded attachment content: application/json: schema: { $ref: '#/components/schemas/AttachmentResponseDto' } /attachments/{id}/download: get: summary: Download attachment description: Requires `attachments:read`; caller must be able to read the attachment workspace. operationId: downloadAttachment security: - bearerAuth: [attachments:read] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: '200': { description: Attachment bytes } /knowledge/{id}/reorder: post: summary: Reorder knowledge node description: Requires `knowledge:write`. operationId: reorderKnowledgeNode security: - bearerAuth: [knowledge:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ReorderKnowledgeNodeDto' responses: '200': description: Reordered node content: application/json: schema: $ref: '#/components/schemas/KnowledgeNodeResponseDto' /knowledge/{id}/duplicate: post: summary: Duplicate knowledge node description: Requires `knowledge:write`. operationId: duplicateKnowledgeNode security: - bearerAuth: [knowledge:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: '200': description: Duplicated node content: application/json: schema: $ref: '#/components/schemas/KnowledgeNodeResponseDto' /tickets: get: summary: List project tickets description: | Returns tickets for workspaces the user can access; global admins see all. For realtime list coherence after mutations, subscribe to the Socket.IO **tickets** namespace (see AsyncAPI `tickets/*` channels in `spec/asyncapi.yaml`); REST remains the source of truth for loads. operationId: listTickets security: - bearerAuth: [tickets:read] parameters: - in: query name: clientId schema: type: string format: uuid - in: query name: status schema: type: string enum: [draft, todo, in_progress, prototype, done, closed] - in: query name: parentId schema: type: string description: Use literal `null` for root tickets only - in: query name: search schema: type: string description: Case-insensitive search across title, content, status, priority, id responses: '200': description: Ticket list content: application/json: schema: type: array items: $ref: '#/components/schemas/TicketResponseDto' '403': description: Forbidden post: summary: Create ticket operationId: createTicket security: - bearerAuth: [tickets:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateTicketDto' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/TicketResponseDto' /tickets/{id}: parameters: - in: path name: id required: true schema: type: string format: uuid get: summary: Get ticket operationId: getTicket security: - bearerAuth: [tickets:read] parameters: - in: query name: includeDescendants schema: type: boolean responses: '200': description: Ticket content: application/json: schema: $ref: '#/components/schemas/TicketResponseDto' '404': description: Not found patch: summary: Update ticket operationId: updateTicket security: - bearerAuth: [tickets:write] requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateTicketDto' responses: '200': description: Ticket updated content: application/json: schema: $ref: '#/components/schemas/TicketResponseDto' delete: summary: Delete ticket operationId: deleteTicket security: - bearerAuth: [tickets:write] parameters: - in: query name: releaseExternalSyncMarker required: false schema: type: boolean default: false description: > When true, deletes external import sync markers tied to this ticket so the same remote item may be imported again. When false (default), markers are kept with a null local id so scheduled import skips re-creating the row until markers are cleared. responses: '204': description: Deleted '409': description: Has subtasks /tickets/{id}/prototype-prompt: get: summary: Build prototype prompt for ticket tree operationId: getTicketPrototypePrompt security: - bearerAuth: [tickets:read] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Prototype prompt content: application/json: schema: $ref: '#/components/schemas/PrototypePromptResponseDto' /tickets/{id}/comments: parameters: - in: path name: id required: true schema: type: string format: uuid get: summary: List ticket comments operationId: listTicketComments security: - bearerAuth: [tickets:read] responses: '200': description: Ticket comments content: application/json: schema: type: array items: $ref: '#/components/schemas/TicketCommentResponseDto' post: summary: Add ticket comment operationId: addTicketComment security: - bearerAuth: [tickets:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateTicketCommentDto' responses: '201': description: Comment added content: application/json: schema: $ref: '#/components/schemas/TicketCommentResponseDto' /tickets/{id}/attachments: parameters: - in: path name: id required: true schema: { type: string, format: uuid } get: summary: List ticket attachments description: Requires `attachments:read`; caller must be able to read the ticket workspace. operationId: listTicketAttachments security: - bearerAuth: [attachments:read] responses: '200': description: Attachment list content: application/json: schema: type: array items: { $ref: '#/components/schemas/AttachmentResponseDto' } post: summary: Upload ticket attachment description: Requires `attachments:write`; multipart field name is `file`. operationId: uploadTicketAttachment security: - bearerAuth: [attachments:write] requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: { type: string, format: binary } responses: '201': description: Uploaded attachment content: application/json: schema: { $ref: '#/components/schemas/AttachmentResponseDto' } /tickets/{id}/attachments/{attachmentId}: delete: summary: Delete ticket attachment metadata description: Requires `attachments:write`; caller must be able to write the ticket workspace. operationId: deleteTicketAttachment security: - bearerAuth: [attachments:write] parameters: - in: path name: id required: true schema: { type: string, format: uuid } - in: path name: attachmentId required: true schema: { type: string, format: uuid } responses: '204': { description: Deleted } /tickets/{id}/activity: get: summary: List ticket activity operationId: listTicketActivity security: - bearerAuth: [tickets:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: limit schema: type: integer default: 50 - in: query name: offset schema: type: integer default: 0 responses: '200': description: Ticket activity content: application/json: schema: type: array items: $ref: '#/components/schemas/TicketActivityResponseDto' /tickets/{id}/body-generation-sessions: post: summary: Start AI body generation session operationId: startTicketBodyGenerationSession security: - bearerAuth: [tickets:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: content: application/json: schema: $ref: '#/components/schemas/StartBodyGenerationSessionDto' responses: '200': description: AI body generation session started content: application/json: schema: $ref: '#/components/schemas/StartBodyGenerationSessionResponseDto' /tickets/{id}/apply-generated-body: post: summary: Apply AI-generated ticket body operationId: applyTicketGeneratedBody security: - bearerAuth: [tickets:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApplyGeneratedBodyDto' responses: '200': description: AI-generated ticket body applied content: application/json: schema: $ref: '#/components/schemas/TicketResponseDto' /tickets/{id}/migrate: post: summary: Migrate ticket subtree to another workspace description: | Moves the resolved root ticket and all of its descendant tickets that share the source workspace to `targetClientId`. The caller may pass any ticket id in the subtree; the server always migrates the full tree. Requires workspace management (see `canManageWorkspaceConfiguration` on clients) on **both** the source and target workspaces. Emits `ticketRemoved` for each id on the source workspace room and `ticketUpsert` on the target workspace room (tickets Socket.IO namespace). `targetClientId` must differ from the ticket workspace (400 otherwise). operationId: migrateTicketToWorkspace security: - bearerAuth: [tickets:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MigrateTicketDto' responses: '200': description: Migrated root ticket (includes `children` when descendants exist) content: application/json: schema: $ref: '#/components/schemas/MigrateTicketResponseDto' '400': description: Invalid request (e.g. target workspace equals source) '403': description: Missing workspace access or insufficient workspace role for source or target '404': description: Ticket not found /tickets/{ticketId}/automation: get: summary: Get ticket automation configuration operationId: getTicketAutomation security: - bearerAuth: [tickets:read] parameters: - in: path name: ticketId required: true schema: type: string format: uuid responses: '200': description: Automation row for the ticket content: application/json: schema: $ref: '#/components/schemas/TicketAutomationResponseDto' patch: summary: Update ticket automation configuration description: > Applies partial updates. Only fields present in the body are considered; unchanged values do not persist a new row or emit activity. Activity rows use action types such as AUTOMATION_ELIGIBILITY_CHANGED, AUTOMATION_APPROVAL_REQUIREMENT_CHANGED, AUTOMATION_SETTINGS_UPDATED, and AUTOMATION_APPROVAL_INVALIDATED only when prior approval was meaningful (requiresApproval was true and approval existed), except that turning off the approval requirement alone does not emit AUTOMATION_APPROVAL_INVALIDATED. operationId: patchTicketAutomation security: - bearerAuth: [tickets:write] parameters: - in: path name: ticketId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateTicketAutomationDto' responses: '200': description: Updated automation configuration content: application/json: schema: $ref: '#/components/schemas/TicketAutomationResponseDto' /tickets/{ticketId}/automation/approve: post: summary: Approve automation run (when requiresApproval is true) operationId: approveTicketAutomation security: - bearerAuth: [tickets:write] parameters: - in: path name: ticketId required: true schema: type: string format: uuid responses: '200': description: Approval recorded content: application/json: schema: $ref: '#/components/schemas/TicketAutomationResponseDto' /tickets/{ticketId}/automation/unapprove: post: summary: Revoke automation approval (when requiresApproval is true) operationId: unapproveTicketAutomation security: - bearerAuth: [tickets:write] parameters: - in: path name: ticketId required: true schema: type: string format: uuid responses: '200': description: Approval revoked content: application/json: schema: $ref: '#/components/schemas/TicketAutomationResponseDto' /tickets/{ticketId}/automation/runs: get: summary: List automation runs for a ticket operationId: listTicketAutomationRuns security: - bearerAuth: [tickets:read] parameters: - in: path name: ticketId required: true schema: type: string format: uuid responses: '200': description: Run history content: application/json: schema: type: array items: $ref: '#/components/schemas/TicketAutomationRunResponseDto' /tickets/{ticketId}/automation/runs/{runId}: get: summary: Get automation run detail including steps operationId: getTicketAutomationRun security: - bearerAuth: [tickets:read] parameters: - in: path name: ticketId required: true schema: type: string format: uuid - in: path name: runId required: true schema: type: string format: uuid responses: '200': description: Run detail content: application/json: schema: $ref: '#/components/schemas/TicketAutomationRunResponseDto' /tickets/{ticketId}/automation/runs/{runId}/cancel: post: summary: Cancel a pending or running automation run operationId: cancelTicketAutomationRun security: - bearerAuth: [tickets:write] parameters: - in: path name: ticketId required: true schema: type: string format: uuid - in: path name: runId required: true schema: type: string format: uuid responses: '200': description: Run cancelled content: application/json: schema: $ref: '#/components/schemas/TicketAutomationRunResponseDto' /clients/{id}/agent-autonomy/enabled-agent-ids: get: summary: List agent IDs with prototype autonomy enabled for this client description: | Only agents returned here can be picked by the autonomous ticket scheduler for this workspace (intersection with each ticket's allowed-agent list). Matches `client_agent_autonomy.enabled = true`. operationId: listEnabledAutonomyAgentIds security: - bearerAuth: [agents:read] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: UUIDs of agents with autonomy enabled content: application/json: schema: type: object required: - agentIds properties: agentIds: type: array items: type: string format: uuid /clients/{id}/agents/{agentId}/autonomy: get: summary: Get per-agent autonomy settings operationId: getClientAgentAutonomy security: - bearerAuth: [agents:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: Autonomy configuration put: summary: Create or update per-agent autonomy settings description: | Requires workspace management rights (see ClientResponseDto.canManageWorkspaceConfiguration). Interactive user context required; API key auth may manage when applicable. operationId: upsertClientAgentAutonomy security: - bearerAuth: [agents:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: Saved autonomy configuration '403': description: | No client access, or workspace management rights required (plain client member cannot update autonomy). /clients: get: summary: List clients description: | Returns all clients the user has access to. In api-key and mtls mode, returns all clients. For regular users, only returns clients where: - The user is the creator (user_id matches) - The user is in the client_users relationship table Global admins see all clients. operationId: listClients security: - bearerAuth: [clients:read] parameters: - in: query name: limit schema: type: integer minimum: 0 description: Maximum number of clients to return (default 10) - in: query name: offset schema: type: integer minimum: 0 description: Number of clients to skip (default 0) - in: query name: search schema: type: string description: Case-insensitive search across name, description, id responses: '200': description: Array of clients content: application/json: schema: type: array items: $ref: '#/components/schemas/ClientResponseDto' post: summary: Create client description: | Creates a new client. The user_id is automatically set to the logged-in user. In api-key mode, user_id is set to null. operationId: createClient security: - bearerAuth: [clients:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateClientDto' responses: '201': description: Created client with generated API key (if applicable) content: application/json: schema: $ref: '#/components/schemas/CreateClientResponseDto' /clients/{id}/ping: get: summary: Check workspace reachability description: | Lightweight reachability check of the workspace's agent-manager (public health endpoint, short timeout, env `CLIENT_PING_TIMEOUT_MS`, default 5000). Used by the console to flag unreachable workspaces in the list without loading their environments. Never fails for an unreachable workspace; `reachable` is false instead. operationId: pingClient security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Reachability result content: application/json: schema: type: object required: [reachable, checkedAt] properties: reachable: type: boolean error: type: string description: Why the workspace cannot be reached (only when reachable is false) checkedAt: type: string format: date-time '403': description: User does not have access to this client /clients/{id}: get: summary: Get client by id description: | Returns a client by ID. Only accessible if the user has access to the client. Access is granted if: - The user is a global admin - The user is the creator (user_id matches) - The user is in the client_users relationship table In api-key and mtls mode, access is always granted. operationId: getClient security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Client content: application/json: schema: $ref: '#/components/schemas/ClientResponseDto' '403': description: User does not have access to this client post: summary: Update client description: | Updates a client. Requires workspace management rights: global admin, workspace creator, client_users role `admin`, API key authentication, or api-key server mode (not plain client_users `user`). See `canManageWorkspaceConfiguration` on ClientResponseDto. operationId: updateClient security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateClientDto' responses: '200': description: Updated client content: application/json: schema: $ref: '#/components/schemas/ClientResponseDto' '403': description: | Forbidden — no access to this client, or caller lacks workspace management rights (same rule as POST for updates). delete: summary: Delete client description: | Deletes a client. Same workspace management requirement as POST /clients/{id} (not available to plain client_users `user`). operationId: deleteClient security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '204': description: Deleted '403': description: | Forbidden — no access to this client, or caller lacks workspace management rights. /clients/{id}/users: get: summary: List users associated with a client description: | Returns all users associated with a client through the client_users relationship table. Only accessible if the user has access to the client. Note: In api-key mode, users do not play a role; this endpoint is intended for users, oidc and saml authentication. operationId: getClientUsers security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '200': description: Array of client-user relationships content: application/json: schema: type: array items: $ref: '#/components/schemas/ClientUserResponseDto' '403': description: User does not have access to this client post: summary: Add a user to a client description: | Adds a user to a client by email address. The user is identified by their email. Permissions: - Global admins can add any role - Client creators can add any role - Client admins can only add 'user' role - Client users cannot add anyone Note: In api-key mode, users do not play a role; this endpoint is not applicable. Use users, oidc or saml authentication. operationId: addClientUser security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AddClientUserDto' responses: '201': description: User added to client content: application/json: schema: $ref: '#/components/schemas/ClientUserResponseDto' '400': description: User not found, relationship already exists, or permission denied '403': description: User does not have access to this client /clients/{id}/users/{relationshipId}: delete: summary: Remove a user from a client description: | Removes a user from a client by deleting the client_users relationship. Permissions: - Global admins can remove anyone - Client creators can remove anyone - Client admins can remove users (but not other admins) - Client users cannot remove anyone Note: In api-key mode, users do not play a role; this endpoint is not applicable. Use users, oidc or saml authentication. operationId: removeClientUser security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: relationshipId required: true schema: type: string format: uuid description: The UUID of the client_users relationship to remove responses: '204': description: User removed from client '400': description: Relationship not found or permission denied '403': description: User does not have access to this client /clients/{id}/isolation: get: summary: Get container isolation summary of a workspace host description: | Returns the container isolation levels of the workspace's agent manager host: state of the `standard` (runc), `sandboxed` (gVisor), `sandboxed-kvm` (gVisor on KVM) and `microvm` (KVM microVM) levels, recommended level and the capability revision to submit with environment creation. When the agent manager is unreachable, the last stored snapshot is returned with `stale: true`. Agent managers without isolation support are reported as `supported: false` (standard only). Requires the `clients:read` scope and access to the client. operationId: getClientIsolation security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '200': description: Isolation summary content: application/json: schema: $ref: '#/components/schemas/ClientIsolationSummaryDto' '403': description: User does not have access to this client '404': description: Client not found /clients/{id}/isolation/probe: post: summary: Re-probe container isolation levels of a workspace host description: | Asks the workspace's agent manager to probe every isolation level now (`POST /api/isolation/probe` on the manager; joins a running probe, results younger than 30 seconds are reused) and returns the new summary. Capability transitions are recorded and published as `isolation.*` notifications. Requires the `clients:write` scope and workspace management rights (see ClientResponseDto.canManageWorkspaceConfiguration). operationId: probeClientIsolation security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '200': description: Isolation summary after the probe content: application/json: schema: $ref: '#/components/schemas/ClientIsolationSummaryDto' '403': description: No client access, or workspace management rights required '404': description: Client not found /clients/{id}/agents: get: summary: List agents for a client operationId: listClientAgents security: - bearerAuth: [agents:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: query name: limit schema: type: integer minimum: 0 description: Maximum number of agents to return (default 10) - in: query name: offset schema: type: integer minimum: 0 description: Number of agents to skip (default 0) - in: query name: search schema: type: string description: Case-insensitive search across name, description, agentType, id responses: '200': description: Array of agents content: application/json: schema: type: array items: $ref: '#/components/schemas/AgentResponseDto' '403': description: User does not have access to this client post: summary: Create agent for a client description: | Requires workspace management rights (see ClientResponseDto.canManageWorkspaceConfiguration). The container isolation level (`isolationLevel`, optional) is validated against the workspace host's current isolation capabilities before the request is forwarded; the agent manager re-validates it. When omitted, the recommended (strongest ready) level is used. Explicit levels are never replaced by another level, stale `capabilityRevision` values are rejected, and the selection record (including the selecting user) is derived server-side. Choosing a weaker level than recommended publishes `agent.isolation_overridden`; a gVisor (`sandboxed` / `sandboxed-kvm`) or microVM (`microvm`) container that fails to start publishes `agent.sandbox_creation_failed` and is not retried on another runtime. operationId: createClientAgent security: - bearerAuth: [agents:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAgentDto' responses: '201': description: Created agent with generated password content: application/json: schema: $ref: '#/components/schemas/CreateAgentResponseDto' '400': description: | Validation error (including an invalid `isolationLevel`), or the agent manager rejected the request (e.g. the gVisor container could not be started; the environment was not created). gVisor runtime failures carry `code: E_ISOLATION_RUNTIME_FAILED` and `isolationLevel`. content: application/json: schema: $ref: '#/components/schemas/IsolationRuntimeFailureDto' '403': description: No client access, or workspace management rights required '409': description: | The requested isolation level is not available on the workspace host, or `capabilityRevision` is stale (the host's isolation capabilities changed since the form was opened) '503': description: The workspace host cannot run environments (the standard Docker `runc` baseline is not available) /clients/{id}/agents/progress: get: summary: List active environment provisioning operations for a client description: | Proxies agent-manager `GET /api/agents/progress`. Returns running environment create / container-recreating update operations (oldest first) so the console can render progress immediately; live updates arrive as the forwarded `environmentProgress` event on the clients socket (selected workspace) and as `environmentProgress` in status `statusSnapshot` / `statusPatch` (all workspaces). operationId: getClientEnvironmentProgress security: - bearerAuth: [agents:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '200': description: Active environment progress operations content: application/json: schema: type: array items: $ref: '#/components/schemas/EnvironmentProgressDto' '403': description: User does not have access to this client /clients/{id}/agents/{agentId}: get: summary: Get agent by id for a client operationId: getClientAgent security: - bearerAuth: [agents:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Agent content: application/json: schema: $ref: '#/components/schemas/AgentResponseDto' '403': description: User does not have access to this client post: summary: Update agent for a client description: Requires workspace management rights (see ClientResponseDto.canManageWorkspaceConfiguration). operationId: updateClientAgent security: - bearerAuth: [agents:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent to update requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateAgentDto' responses: '200': description: Updated agent content: application/json: schema: $ref: '#/components/schemas/AgentResponseDto' '403': description: No client access, or workspace management rights required delete: summary: Delete agent for a client description: Requires workspace management rights. operationId: deleteClientAgent security: - bearerAuth: [agents:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent to delete responses: '204': description: Deleted '403': description: No client access, or workspace management rights required /clients/{id}/agents/{agentId}/models: get: summary: List models for an agent (proxied) operationId: listClientAgentModels security: - bearerAuth: [agents:read] description: | Proxies to the remote agent-manager `GET /api/agents/{agentId}/models`. Returns a map of model id to display name (possibly empty). Uses the same hybrid authentication as the rest of this API (Bearer / OIDC / users / SAML); caller must have access to the client. Remote errors (e.g. 400 when the provider does not support listing models) are forwarded as appropriate. parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Map of model id to display name (may be empty) content: application/json: schema: $ref: '#/components/schemas/AgentModelsResponseDto' '403': description: User does not have access to this client '404': description: Agent or resource not found on remote agent-manager '400': description: Bad request from remote (e.g. provider does not support listing models) /clients/{id}/agents/{agentId}/permissions/{permissionId}/reply: post: summary: Reply to a pending OpenCode permission request description: Proxied to the agent-manager. Requires access to the client. operationId: replyClientAgentPermission security: - bearerAuth: [agents:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: permissionId required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentPermissionReplyDto' responses: '204': description: Reply forwarded '403': description: No access to the client, or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/questions/{questionId}/reply: post: summary: Answer or reject a pending OpenCode question description: Proxied to the agent-manager. Requires access to the client. operationId: replyClientAgentQuestion security: - bearerAuth: [agents:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: questionId required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentQuestionReplyDto' responses: '204': description: Reply forwarded '403': description: No access to the client, or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/start: post: summary: Start agent environment for a client operationId: startClientAgent security: - bearerAuth: [agents:write] description: Start the agent Docker container. Proxied to agent-manager. parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Agent environment started content: application/json: schema: $ref: '#/components/schemas/AgentResponseDto' '403': description: User does not have access to this client '404': description: Agent not found /clients/{id}/agents/{agentId}/stop: post: summary: Stop agent environment for a client operationId: stopClientAgent security: - bearerAuth: [agents:write] description: Stop the agent Docker container. Proxied to agent-manager. parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Agent environment stopped content: application/json: schema: $ref: '#/components/schemas/AgentResponseDto' '403': description: User does not have access to this client '404': description: Agent not found /clients/{id}/agents/{agentId}/restart: post: summary: Restart agent environment for a client operationId: restartClientAgent security: - bearerAuth: [agents:write] description: Restart the agent Docker container. Proxied to agent-manager. parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Agent environment restarted content: application/json: schema: $ref: '#/components/schemas/AgentResponseDto' '403': description: User does not have access to this client '404': description: Agent not found /clients/{id}/agents/{agentId}/files: description: | Proxied, workspace-confined agent file API (client membership + `agent_files:read` / `agent_files:write` scope for PATs). Operations are limited to the agent workspace (normally /app): absolute paths outside it, `..` segments, and paths whose canonical (symlink-resolved) target leaves the workspace are rejected with 400. Files run as the unprivileged agent runtime user; root-owned injected configuration outside the workspace (OpenCode layer files, context attachments) is not reachable through this API. get: summary: List directory contents (proxied) description: | Relative paths such as apps resolve under the worker workspace root (normally /app). Directory listing and metadata failures from the manager propagate as errors, not empty arrays. Paths outside the workspace (lexically or via symlinks) are rejected with 400. operationId: listClientAgentDirectory security: - bearerAuth: [agent_files:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: query name: path schema: type: string description: Directory path relative to the selected context root (defaults to '.') - $ref: '#/components/parameters/fileManagerContext' responses: '200': description: Array of file nodes content: application/json: schema: type: array items: $ref: '#/components/schemas/FileNodeDto' '400': description: Invalid context or agent type does not support configuration file access (proxied from agent-manager) '403': description: User does not have access to this client, or lacks workspace management rights when context is config '404': description: Client, agent, or directory not found /clients/{id}/agents/{agentId}/workspace-search: get: summary: Search indexed workspace file paths and text content operationId: searchClientAgentWorkspace security: - bearerAuth: [agent_files:read] description: | Searches the controller-owned OpenSearch corpus for this clientId+agentId only (fail closed). Response always includes index `status`. When status is missing/indexing/error, hits are empty. parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: query name: q schema: type: string description: Search query (substring match; fields depend on mode) - in: query name: mode schema: type: string enum: [full, files] default: full description: | `full` searches path, file name, and text content. `files` searches path and file name only (no content matches or snippets). - in: query name: include schema: type: array items: type: string style: form explode: true description: Optional path-prefix include filters (traversal rejected) - in: query name: exclude schema: type: array items: type: string style: form explode: true description: Optional path-prefix exclude filters (traversal rejected) - in: query name: limit schema: type: integer minimum: 1 maximum: 100 default: 50 - in: query name: offset schema: type: integer minimum: 0 default: 0 responses: '200': description: Search response with status and hits content: application/json: schema: $ref: '#/components/schemas/WorkspaceSearchResponseDto' '403': description: User does not have access to this client/agent '404': description: Client or agent not found /clients/{id}/agents/{agentId}/workspace-search/status: get: summary: Workspace search index status for an agent operationId: getClientAgentWorkspaceSearchStatus security: - bearerAuth: [agent_files:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: Index status content: application/json: schema: $ref: '#/components/schemas/WorkspaceIndexStatusDto' '403': description: User does not have access to this client/agent '404': description: Client or agent not found /clients/{id}/agents/{agentId}/workspace-search/reindex: post: summary: Rebuild workspace search index for an agent operationId: reindexClientAgentWorkspace security: - bearerAuth: [agent_files:write] description: | Signals the agent-manager to emit a rebuild notification and starts controller re-hydration from the file proxy. Returns 202 Accepted immediately. parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '202': description: Reindex accepted content: application/json: schema: type: object required: [accepted] properties: accepted: type: boolean enum: [true] '403': description: User does not have access to this client/agent '404': description: Client or agent not found /clients/{id}/agents/{agentId}/files/{path}: description: | Workspace-confined file operations (see `/clients/{id}/agents/{agentId}/files`). Absolute paths outside the workspace and symlinks resolving outside it are rejected with 400; mutations of the workspace root itself are rejected. Deleting or moving a symlink affects the link, never its target. head: summary: Probe file metadata without transferring the body (proxied) operationId: headClientAgentFile security: - bearerAuth: [agent_files:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: path required: true schema: type: string description: File path relative to the selected context root (supports nested paths) - $ref: '#/components/parameters/fileManagerContext' responses: '200': description: Metadata headers only (no body) headers: Accept-Ranges: schema: { type: string, enum: [bytes] } X-File-Type: schema: $ref: '#/components/schemas/AgentFileType' Content-Type: schema: { type: string } Content-Length: schema: { type: integer } '400': description: Invalid path, invalid context, or missing access '404': description: Client, agent, or file not found get: summary: Read file content as raw bytes (proxied) operationId: readClientAgentFile security: - bearerAuth: [agent_files:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: path required: true schema: type: string description: File path relative to the selected context root (supports nested paths) - $ref: '#/components/parameters/fileManagerContext' - in: query name: download schema: type: boolean description: When true, set Content-Disposition attachment with the file basename - in: header name: Range schema: type: string description: Optional bytes range (e.g. bytes=0-1023) for partial content responses: '200': description: Full file content headers: Accept-Ranges: schema: { type: string, enum: [bytes] } X-File-Type: schema: $ref: '#/components/schemas/AgentFileType' Content-Disposition: schema: { type: string } content: application/octet-stream: schema: { type: string, format: binary } application/pdf: schema: { type: string, format: binary } text/plain: schema: { type: string, format: binary } image/*: schema: { type: string, format: binary } video/*: schema: { type: string, format: binary } audio/*: schema: { type: string, format: binary } '206': description: Partial content for Range requests headers: Accept-Ranges: schema: { type: string, enum: [bytes] } Content-Range: schema: { type: string } X-File-Type: schema: $ref: '#/components/schemas/AgentFileType' content: application/octet-stream: schema: { type: string, format: binary } application/pdf: schema: { type: string, format: binary } text/plain: schema: { type: string, format: binary } image/*: schema: { type: string, format: binary } video/*: schema: { type: string, format: binary } audio/*: schema: { type: string, format: binary } '400': description: Invalid path, invalid context, or agent type does not support configuration file access '403': description: User does not have access to this client, or lacks workspace management rights when context is config '404': description: Client, agent, or file not found '416': description: Range not satisfiable put: summary: Write file content as raw bytes (proxied; full file or Content-Range chunk) operationId: writeClientAgentFile security: - bearerAuth: [agent_files:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: path required: true schema: type: string description: File path relative to the selected context root (supports nested paths) - $ref: '#/components/parameters/fileManagerContext' - in: header name: Content-Range schema: type: string description: Optional chunk range (bytes start-end/total) for chunked uploads - in: header name: X-Upload-Id schema: type: string format: uuid description: Optional upload session id for chunked uploads - in: header name: X-File-Type schema: $ref: '#/components/schemas/AgentFileType' description: Optional client classification hint requestBody: required: true content: application/octet-stream: schema: { type: string, format: binary } application/pdf: schema: { type: string, format: binary } text/plain: schema: { type: string, format: binary } image/*: schema: { type: string, format: binary } video/*: schema: { type: string, format: binary } audio/*: schema: { type: string, format: binary } responses: '204': description: File written successfully (or chunk accepted; last chunk finalizes) '400': description: Invalid path, content too large, invalid range, invalid context, or agent type does not support configuration file access '403': description: User does not have access to this client, or lacks workspace management rights when context is config '404': description: Client or agent not found delete: summary: Delete file or directory (proxied) operationId: deleteClientAgentFileOrDirectory security: - bearerAuth: [agent_files:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: path required: true schema: type: string description: File or directory path relative to the selected context root (supports nested paths) - $ref: '#/components/parameters/fileManagerContext' responses: '204': description: File or directory deleted successfully '400': description: Invalid path, invalid context, or agent type does not support configuration file access '403': description: User does not have access to this client, or lacks workspace management rights when context is config '404': description: Client, agent, or file/directory not found patch: summary: Move file or directory (proxied) operationId: moveClientAgentFileOrDirectory security: - bearerAuth: [agent_files:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: path required: true schema: type: string description: Source file or directory path relative to the selected context root (supports nested paths) - $ref: '#/components/parameters/fileManagerContext' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MoveFileDto' responses: '204': description: File or directory moved successfully '400': description: Invalid path, destination, invalid context, or agent type does not support configuration file access '403': description: User does not have access to this client, or lacks workspace management rights when context is config '404': description: Client, agent, or source file/directory not found post: summary: Create file or directory (proxied) operationId: createClientAgentFileOrDirectory security: - bearerAuth: [agent_files:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: path required: true schema: type: string description: File or directory path relative to the selected context root (supports nested paths) - $ref: '#/components/parameters/fileManagerContext' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateFileDto' responses: '201': description: File or directory created '400': description: Invalid request, invalid context, or agent type does not support configuration file access '403': description: User does not have access to this client, or lacks workspace management rights when context is config '404': description: Client or agent not found /clients/{id}/agents/{agentId}/environment: get: summary: List environment variables for an agent (proxied) operationId: listClientAgentEnvironmentVariables security: - bearerAuth: [agent_environment:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: query name: limit schema: type: integer minimum: 0 description: Maximum number of environment variables to return (default 50) - in: query name: offset schema: type: integer minimum: 0 description: Number of environment variables to skip (default 0) responses: '200': description: Array of environment variables content: application/json: schema: type: array items: $ref: '#/components/schemas/EnvironmentVariableResponseDto' '403': description: User does not have access to this client '404': description: Client or agent not found post: summary: Create environment variable for an agent (proxied) description: Requires workspace management rights. operationId: createClientAgentEnvironmentVariable security: - bearerAuth: [agent_environment:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateEnvironmentVariableDto' responses: '201': description: Created environment variable content: application/json: schema: $ref: '#/components/schemas/EnvironmentVariableResponseDto' '400': description: Invalid request '403': description: No client access, or workspace management rights required '404': description: Client or agent not found delete: summary: Delete all environment variables for an agent (proxied) description: Requires workspace management rights. operationId: deleteAllClientAgentEnvironmentVariables security: - bearerAuth: [agent_environment:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Number of environment variables deleted content: application/json: schema: type: object required: [deletedCount] properties: deletedCount: type: integer '403': description: No client access, or workspace management rights required '404': description: Client or agent not found /clients/{id}/agents/{agentId}/environment/count: get: summary: Get count of environment variables for an agent (proxied) operationId: countClientAgentEnvironmentVariables security: - bearerAuth: [agent_environment:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Count of environment variables content: application/json: schema: type: object required: [count] properties: count: type: integer '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/environment/{envVarId}: put: summary: Update environment variable for an agent (proxied) description: Requires workspace management rights. operationId: updateClientAgentEnvironmentVariable security: - bearerAuth: [agent_environment:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: envVarId required: true schema: type: string format: uuid description: The UUID of the environment variable to update requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateEnvironmentVariableDto' responses: '200': description: Updated environment variable content: application/json: schema: $ref: '#/components/schemas/EnvironmentVariableResponseDto' '400': description: Invalid request '403': description: No client access, or workspace management rights required '404': description: Client, agent, or environment variable not found delete: summary: Delete environment variable for an agent (proxied) description: Requires workspace management rights. operationId: deleteClientAgentEnvironmentVariable security: - bearerAuth: [agent_environment:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: envVarId required: true schema: type: string format: uuid description: The UUID of the environment variable to delete responses: '204': description: Environment variable deleted successfully '403': description: No client access, or workspace management rights required '404': description: Client, agent, or environment variable not found /clients/{id}/agents/{agentId}/chats: get: summary: List chat sessions for an agent (proxied) operationId: listClientAgentChatSessions security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: query name: limit schema: type: integer minimum: 0 description: Maximum number of chat sessions to return (default 50) - in: query name: offset schema: type: integer minimum: 0 description: Number of chat sessions to skip (default 0) responses: '200': description: Array of chat sessions content: application/json: schema: type: array items: $ref: '#/components/schemas/ChatSessionResponseDto' '403': description: User does not have access to this client '404': description: Client or agent not found post: summary: Create chat session for an agent (proxied) operationId: createClientAgentChatSession security: - bearerAuth: [agent_chats:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateChatSessionDto' responses: '201': description: Created chat session content: application/json: schema: $ref: '#/components/schemas/ChatSessionResponseDto' '400': description: Invalid request '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/chats/count: get: summary: Get count of chat sessions for an agent (proxied) operationId: countClientAgentChatSessions security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Count of chat sessions content: application/json: schema: type: object required: [count] properties: count: type: integer '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/chats/{chatId}: get: summary: Get chat session for an agent (proxied) operationId: getClientAgentChatSession security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: chatId required: true schema: type: string format: uuid description: The UUID of the chat session responses: '200': description: Chat session content: application/json: schema: $ref: '#/components/schemas/ChatSessionResponseDto' '403': description: User does not have access to this client '404': description: Client, agent, or chat session not found put: summary: Update chat session for an agent (proxied) operationId: updateClientAgentChatSession security: - bearerAuth: [agent_chats:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: chatId required: true schema: type: string format: uuid description: The UUID of the chat session to update requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateChatSessionDto' responses: '200': description: Updated chat session content: application/json: schema: $ref: '#/components/schemas/ChatSessionResponseDto' '400': description: Invalid request '403': description: User does not have access to this client '404': description: Client, agent, or chat session not found delete: summary: Delete chat session for an agent (proxied) operationId: deleteClientAgentChatSession security: - bearerAuth: [agent_chats:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: chatId required: true schema: type: string format: uuid description: The UUID of the chat session to delete responses: '204': description: Chat session deleted successfully '403': description: User does not have access to this client '404': description: Client, agent, or chat session not found /clients/{id}/agents/{agentId}/chats/{chatId}/messages: get: summary: List messages for a chat session (proxied) operationId: listClientAgentChatSessionMessages security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: chatId required: true schema: type: string format: uuid description: The UUID of the chat session - in: query name: limit schema: type: integer minimum: 0 description: Maximum number of messages to return (default 50) - in: query name: offset schema: type: integer minimum: 0 description: Number of messages to skip (default 0) responses: '200': description: Array of chat session messages content: application/json: schema: type: array items: $ref: '#/components/schemas/ChatSessionMessageResponseDto' '403': description: User does not have access to this client '404': description: Client, agent, or chat session not found /clients/{id}/agents/{agentId}/openai/v1/models: get: summary: List models (OpenAI-compatible) description: | OpenAI-compatible model list of the agent: `default` (the agent's default model) plus every OpenCode model of the agent (`provider/model`). Use `/api/clients/{id}/agents/{agentId}/openai/v1` as the base URL of an OpenAI SDK. See the OpenAI-compatible API documentation for authentication (raw `fp_pat_…` PATs are accepted as bearer on these routes) and behavior. Errors use the OpenAI error envelope. operationId: openAiListModels security: - bearerAuth: [agents:read] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' responses: '200': description: Model list content: application/json: schema: $ref: '#/components/schemas/OpenAiModelList' default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/models/{model}: get: summary: Retrieve a model (OpenAI-compatible) description: Model ids may contain a slash (`provider/model`); the remaining path is the model id. operationId: openAiGetModel security: - bearerAuth: [agents:read] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - in: path name: model required: true schema: type: string responses: '200': description: Model content: application/json: schema: $ref: '#/components/schemas/OpenAiModel' default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/chat/completions: post: summary: Create a chat completion (OpenAI-compatible) description: | Runs one turn in a visible chat session of the agent (primary session unless `X-Agenstra-Chat-Id` or `chat_id` selects another session of this agent). The agent keeps the transcript, so only the messages after the last `assistant` message are sent (text content only). Function tools are offered to the agent (client tools): its calls are returned as `tool_calls` (`finish_reason: tool_calls`, legacy `function_call`) and the client continues the paused turn with `role: tool` results from the same credential (`404 tool_call_not_found` otherwise). With `stream: true` the response is `text/event-stream` with `chat.completion.chunk` events and `data: [DONE]`. Live deltas are streamed only when no enabled outgoing `drop` / `replace` message filter applies to the agent; otherwise the filtered final answer is streamed as one chunk. A filter drop ends with `finish_reason: content_filter`. The chat session is returned in `X-Agenstra-Chat-Id`. operationId: openAiCreateChatCompletion security: - bearerAuth: [agent_chats:write] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiChatIdHeader' - $ref: '#/components/parameters/openAiToolActivityHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/OpenAiChatCompletionRequest' responses: '200': description: Chat completion (or SSE stream of chunks) headers: X-Agenstra-Chat-Id: $ref: '#/components/headers/OpenAiChatId' content: application/json: schema: $ref: '#/components/schemas/OpenAiChatCompletion' text/event-stream: schema: type: string description: '`data: ` frames, terminated by `data: [DONE]`' default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/responses: post: summary: Create a response (OpenAI Responses API) description: | Runs one turn like chat completions. The chat session is selected by `conversation` (`conv_…` id or chat session UUID), `previous_response_id` (response ids embed their chat session), `X-Agenstra-Chat-Id` or `chat_id`; default is the primary session. `instructions` are prepended to the turn. Response objects are not stored (`store: false`); the turn is stored in the chat session. Function tools are offered to the agent; its calls are returned as `function_call` output items and the client continues with `function_call_output` items (with `previous_response_id`, `conversation` or the chat selectors). With `stream: true` the response is a Responses API event stream (`response.created` … `response.completed` / `response.incomplete` / `response.failed`). operationId: openAiCreateResponse security: - bearerAuth: [agent_chats:write] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiChatIdHeader' - $ref: '#/components/parameters/openAiToolActivityHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/OpenAiResponseRequest' responses: '200': description: Response object (or SSE event stream) headers: X-Agenstra-Chat-Id: $ref: '#/components/headers/OpenAiChatId' content: application/json: schema: $ref: '#/components/schemas/OpenAiResponse' text/event-stream: schema: type: string description: '`event: ` + `data: ` frames' default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/conversations: post: summary: Create a conversation (chat session) description: Creates a visible chat session; `metadata.title` becomes the session title. Initial `items` are not supported. operationId: openAiCreateConversation security: - bearerAuth: [agent_chats:write] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/OpenAiConversationRequest' responses: '200': description: Conversation content: application/json: schema: $ref: '#/components/schemas/OpenAiConversation' default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/conversations/{conversationId}: get: summary: Retrieve a conversation (chat session) operationId: openAiGetConversation security: - bearerAuth: [agent_chats:read] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiConversationId' responses: '200': description: Conversation content: application/json: schema: $ref: '#/components/schemas/OpenAiConversation' default: $ref: '#/components/responses/OpenAiError' post: summary: Update a conversation (rename the chat session) description: '`metadata.title` renames the chat session; other metadata is not stored.' operationId: openAiUpdateConversation security: - bearerAuth: [agent_chats:write] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiConversationId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/OpenAiConversationRequest' responses: '200': description: Conversation content: application/json: schema: $ref: '#/components/schemas/OpenAiConversation' default: $ref: '#/components/responses/OpenAiError' delete: summary: Delete a conversation (chat session) operationId: openAiDeleteConversation security: - bearerAuth: [agent_chats:write] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiConversationId' responses: '200': description: Deleted content: application/json: schema: type: object required: [id, object, deleted] properties: id: type: string object: type: string enum: [conversation.deleted] deleted: type: boolean default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/conversations/{conversationId}/items: get: summary: List conversation items (chat messages) operationId: openAiListConversationItems security: - bearerAuth: [agent_chats:read] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiConversationId' - in: query name: limit schema: type: integer minimum: 1 maximum: 100 default: 20 - in: query name: order schema: type: string enum: [asc, desc] default: desc - in: query name: after schema: type: string description: Item id to list after responses: '200': description: Items content: application/json: schema: type: object required: [object, data, first_id, last_id, has_more] properties: object: type: string enum: [list] data: type: array items: $ref: '#/components/schemas/OpenAiConversationItem' first_id: type: string nullable: true last_id: type: string nullable: true has_more: type: boolean default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/openai/v1/conversations/{conversationId}/items/{itemId}: get: summary: Retrieve a conversation item (chat message) operationId: openAiGetConversationItem security: - bearerAuth: [agent_chats:read] - mutualTLS: [] - certificateAssertion: [] parameters: - $ref: '#/components/parameters/openAiClientId' - $ref: '#/components/parameters/openAiAgentId' - $ref: '#/components/parameters/openAiConversationId' - in: path name: itemId required: true schema: type: string responses: '200': description: Item content: application/json: schema: $ref: '#/components/schemas/OpenAiConversationItem' default: $ref: '#/components/responses/OpenAiError' /clients/{id}/agents/{agentId}/chats/{chatId}/plans: get: summary: List chat plans for a chat session description: > Returns durable chat plan-mode rows for the given visible chat session (explore/refine/execute lifecycle). Requires `agent_chats:read` scope and client access. operationId: listChatPlans security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: chatId required: true schema: type: string format: uuid description: The UUID of the visible chat session responses: '200': description: Array of chat plans for the session content: application/json: schema: type: array items: $ref: '#/components/schemas/ChatPlanResponseDto' '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/plans: get: summary: List the chat plans of an agent (plans page) description: > Every plan of the agent, newest first, paginated. `search` matches the plan title, the original request and the plan body (case-insensitive, wildcards literal). Requires `agent_chats:read` scope and client access. operationId: listAgentChatPlans security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: query name: search schema: type: string maxLength: 200 - in: query name: state schema: type: string enum: [editable, readonly] description: > `editable` = never executed and not being drafted; `readonly` = executing / executed / being drafted. - in: query name: limit schema: type: integer minimum: 1 maximum: 100 default: 25 - in: query name: offset schema: type: integer minimum: 0 default: 0 responses: '200': description: Page of plans content: application/json: schema: $ref: '#/components/schemas/ChatPlanListResponseDto' '400': description: Invalid state filter '403': description: User does not have access to this client /clients/{id}/agents/{agentId}/plans/{planId}: get: summary: Get a chat plan by id operationId: getChatPlan security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: planId required: true schema: type: string format: uuid responses: '200': description: Chat plan detail content: application/json: schema: $ref: '#/components/schemas/ChatPlanResponseDto' '403': description: User does not have access to this client '404': description: Plan not found for this client/agent patch: summary: Edit a chat plan that has not been executed yet description: > Saves a user edit of the plan body and / or title (plans page). Conditional on `expectedUpdatedAt` and on the plan still being editable: 409 when the plan changed meanwhile, while the agent drafts or refines it, and once execution started (executed plans are read-only). Execution always runs the latest saved version. operationId: updateChatPlan security: - bearerAuth: [agent_chats:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: planId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateChatPlanDto' responses: '200': description: Saved plan (also published as `chatPlanUpsert`) content: application/json: schema: $ref: '#/components/schemas/ChatPlanResponseDto' '400': description: Validation failed (for example an empty plan body) '403': description: User does not have access to this client '404': description: Plan not found for this client/agent '409': description: Plan changed since `expectedUpdatedAt`, is being drafted, or has been executed (read-only) /clients/{id}/agents/{agentId}/plans/{planId}/activity: get: summary: Activity log of a chat plan description: Newest first. Creation, agent drafts, refine requests, user edits, execution, failure and cancel. operationId: listChatPlanActivity security: - bearerAuth: [agent_chats:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: planId required: true schema: type: string format: uuid - in: query name: limit schema: type: integer minimum: 1 maximum: 200 default: 50 - in: query name: offset schema: type: integer minimum: 0 responses: '200': description: Activity rows content: application/json: schema: type: array items: $ref: '#/components/schemas/ChatPlanActivityResponseDto' '403': description: User does not have access to this client '404': description: Plan not found for this client/agent /clients/{id}/agents/{agentId}/plans/{planId}/cancel: post: summary: Cancel an active chat plan operationId: cancelChatPlan security: - bearerAuth: [agent_chats:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: planId required: true schema: type: string format: uuid responses: '200': description: Cancelled chat plan content: application/json: schema: $ref: '#/components/schemas/ChatPlanResponseDto' '403': description: User does not have access to this client '404': description: Plan not found for this client/agent /clients/{clientId}/agent-tasks: get: summary: List recurring agent tasks of a workspace description: Requires workspace access and the `agent_chats:read` scope (PAT). operationId: listAgentTasks security: - bearerAuth: [agent_chats:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: query name: agentId required: false schema: type: string format: uuid responses: '200': description: Tasks (oldest first) content: application/json: schema: type: array items: $ref: '#/components/schemas/AgentTaskResponseDto' '403': description: User does not have access to this client /clients/{clientId}/agents/{agentId}/tasks: post: summary: Create a recurring agent task operationId: createAgentTask security: - bearerAuth: [agent_chats:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAgentTaskDto' responses: '201': description: Created task content: application/json: schema: $ref: '#/components/schemas/AgentTaskResponseDto' '400': description: Invalid schedule, time zone or model '403': description: User does not have access to this client '404': description: Agent not found in this workspace '409': description: Task limit per agent reached /clients/{clientId}/agents/{agentId}/tasks/{taskId}: get: summary: Agent task with recent runs operationId: getAgentTask security: - bearerAuth: [agent_chats:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: taskId required: true schema: type: string format: uuid responses: '200': description: Task and recent runs content: application/json: schema: $ref: '#/components/schemas/AgentTaskDetailResponseDto' '403': description: User does not have access to this client '404': description: Task not found patch: summary: Update an agent task operationId: updateAgentTask security: - bearerAuth: [agent_chats:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: taskId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateAgentTaskDto' responses: '200': description: Updated task content: application/json: schema: $ref: '#/components/schemas/AgentTaskResponseDto' '400': description: Invalid schedule, time zone or model '403': description: User does not have access to this client '404': description: Task not found delete: summary: Delete an agent task and its runs operationId: deleteAgentTask security: - bearerAuth: [agent_chats:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: taskId required: true schema: type: string format: uuid responses: '204': description: Deleted '403': description: User does not have access to this client '404': description: Task not found /clients/{clientId}/agents/{agentId}/tasks/{taskId}/approval: post: summary: Approve an agent task description: | Runs are unattended with every permission allowed, so tasks the agent created or whose prompt, model, schedule or allowed handoff agents it changed (or re-enabled) are only scheduled after a workspace user approved them. Approving also approves that the runs may hand off work to the listed agents without asking. operationId: approveAgentTask security: - bearerAuth: [agent_chats:write] parameters: - in: path name: clientId required: true schema: { type: string, format: uuid } - in: path name: agentId required: true schema: { type: string, format: uuid } - in: path name: taskId required: true schema: { type: string, format: uuid } responses: '201': description: Approved task content: application/json: schema: $ref: '#/components/schemas/AgentTaskResponseDto' '404': description: Unknown task /clients/{clientId}/agents/{agentId}/tasks/{taskId}/runs: get: summary: Run history of an agent task (newest first) operationId: listAgentTaskRuns security: - bearerAuth: [agent_chats:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: taskId required: true schema: type: string format: uuid - in: query name: limit required: false schema: type: integer minimum: 1 maximum: 50 default: 10 - in: query name: offset required: false schema: type: integer minimum: 0 default: 0 description: Runs to skip (newest first) — pages the session history. - in: query name: includeTranscript required: false schema: type: boolean default: false description: Include each run's chat events (session history of the task). responses: '200': description: Runs content: application/json: schema: type: array items: $ref: '#/components/schemas/AgentTaskRunResponseDto' '403': description: User does not have access to this client '404': description: Task not found post: summary: Queue an immediate run (also for paused tasks) operationId: runAgentTaskNow security: - bearerAuth: [agent_chats:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: taskId required: true schema: type: string format: uuid responses: '202': description: '`queued: false` when a run of the task is still in progress' content: application/json: schema: type: object required: [taskId, queued] properties: taskId: type: string format: uuid queued: type: boolean '403': description: User does not have access to this client '404': description: Task not found /connections/deployments: get: summary: List CI/CD deployment connections (admin only) description: >- Instance-wide GitHub / GitLab / Jenkins connections. Secrets (`token`, `privateKey`) are stored encrypted and never returned. Search uses OpenSearch (`deployment-connections`, instance scoped) with an ILIKE fallback on label, baseUrl, provider and id. operationId: listDeploymentConnections security: - bearerAuth: [connections:admin] parameters: - in: query name: limit schema: type: integer minimum: 1 maximum: 100 default: 10 - in: query name: offset schema: type: integer minimum: 0 default: 0 - in: query name: search schema: type: string maxLength: 200 - in: query name: provider schema: $ref: '#/components/schemas/DeploymentProvider' responses: '200': description: Connections content: application/json: schema: type: array items: $ref: '#/components/schemas/DeploymentConnectionSummary' '400': description: Unknown provider '403': description: Forbidden (not an instance admin) post: summary: Create a CI/CD deployment connection (admin only) operationId: createDeploymentConnection security: - bearerAuth: [connections:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateDeploymentConnectionDto' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/DeploymentConnectionSummary' '400': description: Validation error (unsupported auth type, missing credentials, invalid base URL, unknown workspaces) '403': description: Forbidden /connections/deployments/{id}: parameters: - in: path name: id required: true schema: type: string format: uuid get: summary: Get a CI/CD deployment connection (admin only) operationId: getDeploymentConnection security: - bearerAuth: [connections:admin] responses: '200': description: Connection content: application/json: schema: $ref: '#/components/schemas/DeploymentConnectionSummary' '403': description: Forbidden '404': description: Not found put: summary: Update a CI/CD deployment connection (admin only) description: >- Provider is immutable. Omitted secrets keep the stored ones; switching `authType` requires the secrets of the new type. Changing base URL or credentials resets `lastTestStatus` to `untested`. operationId: updateDeploymentConnection security: - bearerAuth: [connections:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateDeploymentConnectionDto' responses: '200': description: Updated content: application/json: schema: $ref: '#/components/schemas/DeploymentConnectionSummary' '400': description: Validation error '403': description: Forbidden '404': description: Not found delete: summary: Delete a CI/CD deployment connection (admin only) operationId: deleteDeploymentConnection security: - bearerAuth: [connections:admin] responses: '204': description: Deleted '403': description: Forbidden '404': description: Not found '409': description: Connection is used by N deployment workflows /connections/deployments/{id}/test: post: summary: Test a CI/CD deployment connection (admin only) description: >- GitHub: `GET /user` (token) or installation token minting + `GET /installation/repositories` (app); GitLab: `GET /api/v4/user`; Jenkins: `GET /me/api/json`. The result is persisted as `lastTestStatus` / `lastTestMessage` / `lastTestedAt`; messages are sanitized (no credentials) and at most 512 characters. operationId: testDeploymentConnection security: - bearerAuth: [connections:admin] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Result content: application/json: schema: $ref: '#/components/schemas/ConnectionTestResult' '403': description: Forbidden '404': description: Not found /clients/{clientId}/deployments/connections: get: summary: 'Deployment connections usable by this workspace' description: 'Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT).' operationId: listDeploymentConnectionOptions tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid responses: '200': description: 'Connections (workspace access `all` or this workspace allowed)' content: application/json: schema: type: array items: $ref: '#/components/schemas/DeploymentConnectionOption' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' /clients/{clientId}/deployments/connections/{connectionId}/repositories: get: summary: 'Repositories reachable through a deployment connection' description: 'Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT).' operationId: listDeploymentConnectionRepositories tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: connectionId required: true schema: type: string format: uuid - in: query name: search description: 'Optional name filter' schema: type: string responses: '200': description: 'Repositories / projects / jobs' content: application/json: schema: type: array items: $ref: '#/components/schemas/DeploymentRepositorySummary' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' '404': description: 'Connection not found' '502': description: 'Provider request failed' /clients/{clientId}/deployments/connections/{connectionId}/branches: get: summary: 'Branches of a repository' description: 'Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT).' operationId: listDeploymentConnectionBranches tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: connectionId required: true schema: type: string format: uuid - in: query name: repository required: true description: 'Provider repository id (`owner/repo`, GitLab project id or path, Jenkins job full name)' schema: type: string responses: '200': description: 'Branches' content: application/json: schema: type: array items: $ref: '#/components/schemas/DeploymentBranchSummary' '400': description: 'repository missing' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' '404': description: 'Connection not found' '502': description: 'Provider request failed' /clients/{clientId}/deployments/connections/{connectionId}/workflows: get: summary: 'Provider workflows of a repository' description: 'Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT).' operationId: listDeploymentConnectionWorkflows tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: connectionId required: true schema: type: string format: uuid - in: query name: repository required: true description: 'Provider repository id (`owner/repo`, GitLab project id or path, Jenkins job full name)' schema: type: string responses: '200': description: 'Provider workflows (GitHub workflow files; GitLab / Jenkins return the pipeline / job)' content: application/json: schema: type: array items: $ref: '#/components/schemas/DeploymentProviderWorkflowSummary' '400': description: 'repository missing' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' '404': description: 'Connection not found' '502': description: 'Provider request failed' /clients/{clientId}/deployments/workflows: get: summary: 'List deployment workflows' description: 'Requires workspace access and the `deployments:read` scope (PAT).' operationId: listDeploymentWorkflows tags: [Deployments] security: - bearerAuth: [deployments:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: query name: agentId description: 'Only workflows available to this environment (global + assigned)' schema: type: string format: uuid - in: query name: search description: 'OpenSearch (`deployment-workflows`) with ILIKE fallback on name, description, repository, workflow' schema: type: string - in: query name: limit description: 'Page size (default 50, max 200)' schema: type: integer minimum: 1 - in: query name: offset schema: type: integer minimum: 0 - in: query name: approvalStatus description: 'Only workflows waiting for a workspace admin (`pending`) or approved ones (`approved`)' schema: type: string enum: [pending, approved] responses: '200': description: 'Workflows ordered by name' content: application/json: schema: type: array items: $ref: '#/components/schemas/DeploymentWorkflowSummary' '403': description: 'No access to the workspace, or the connection is not available for this workspace' post: summary: 'Create a deployment workflow' description: 'Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT).' operationId: createDeploymentWorkflow tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateDeploymentWorkflowDto' responses: '201': description: 'Created workflow' content: application/json: schema: $ref: '#/components/schemas/DeploymentWorkflowSummary' '400': description: 'Invalid fields, environments not in this workspace, scope environments without environments, GitHub without workflow' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' '404': description: 'Connection not found' /clients/{clientId}/deployments/workflows/{workflowId}: get: summary: 'Get a deployment workflow' description: 'Requires workspace access and the `deployments:read` scope (PAT).' operationId: getDeploymentWorkflow tags: [Deployments] security: - bearerAuth: [deployments:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: workflowId required: true schema: type: string format: uuid responses: '200': description: 'Workflow' content: application/json: schema: $ref: '#/components/schemas/DeploymentWorkflowSummary' '403': description: 'No access to the workspace, or the connection is not available for this workspace' '404': description: 'Workflow not found in this workspace' put: summary: 'Update a deployment workflow' description: >- Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT). Omitted fields stay unchanged. A request carrying the complete editor content (`connectionId`, `name`, `description`, `repository`, `workflow`, `defaultRef`, `defaultInputs`, `scope`, `agentIds`, `agentTriggerEnabled`; `null` counts as submitted) approves a pending workflow; partial updates (e.g. only `enabled`) never approve. operationId: updateDeploymentWorkflow tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: workflowId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateDeploymentWorkflowDto' responses: '200': description: 'Updated workflow' content: application/json: schema: $ref: '#/components/schemas/DeploymentWorkflowSummary' '400': description: 'Invalid fields' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' '404': description: 'Workflow not found in this workspace' delete: summary: 'Delete a deployment workflow and its run history' description: 'Requires workspace management (workspace admin / owner, global admin or API key) and the `deployments:write` scope (PAT).' operationId: deleteDeploymentWorkflow tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: workflowId required: true schema: type: string format: uuid responses: '204': description: 'Deleted' '403': description: 'No access to the workspace, not a workspace admin / owner, or the connection is not available for this workspace' '404': description: 'Workflow not found in this workspace' /clients/{clientId}/deployments/workflows/{workflowId}/approval: post: summary: 'Approve a pending deployment workflow' description: >- Workflows an environment proposed or changed (or switched on again) are pending until a workspace admin approves them; nobody can start runs before. `updatedAt` is the version the admin reviewed: the check runs under a row lock and a workflow changed since then is not approved (409). Approving an approved workflow is a no-op. Saving the complete editor form with `PUT` approves as well. Requires workspace management access and the `deployments:write` scope (PAT). operationId: approveDeploymentWorkflow tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: workflowId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApproveDeploymentWorkflowDto' responses: '200': description: 'Approved workflow' content: application/json: schema: $ref: '#/components/schemas/DeploymentWorkflowSummary' '400': description: '`updatedAt` is not an ISO timestamp' '403': description: 'No workspace management access' '404': description: 'Unknown workflow' '409': description: 'The workflow changed since the reviewed `updatedAt`' /clients/{clientId}/deployments/workflows/{workflowId}/trigger: post: summary: 'Trigger a deployment run' description: 'Requires workspace access and the `deployments:write` scope (PAT). `ref` defaults to the workflow default ref, then the repository default branch; `inputs` override the workflow default inputs. With `agentId` the workflow must be global or assigned to that environment.' operationId: triggerDeploymentRun tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: workflowId required: true schema: type: string format: uuid requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/TriggerDeploymentRunDto' responses: '201': description: 'Recorded run (queued until the provider reports it)' content: application/json: schema: $ref: '#/components/schemas/DeploymentRunSummary' '400': description: 'Invalid inputs / ref, no ref known, or environment not in this workspace' '403': description: 'No access to the workspace, connection not available for this workspace, or workflow not available to the environment' '404': description: 'Workflow not found in this workspace' '409': description: 'Workflow is disabled' '502': description: 'Provider request failed' /clients/{clientId}/deployments/workflows/{workflowId}/sync: post: summary: 'Sync provider run history' description: 'Requires workspace access and the `deployments:write` scope (PAT). Imports recent provider runs as `external` and refreshes the active ones.' operationId: syncDeploymentWorkflowRuns tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: workflowId required: true schema: type: string format: uuid responses: '200': description: 'Number of new or changed runs' content: application/json: schema: $ref: '#/components/schemas/DeploymentSyncResult' '403': description: 'No access to the workspace, or the connection is not available for this workspace' '404': description: 'Workflow not found in this workspace' '502': description: 'Provider request failed' /clients/{clientId}/deployments/runs: get: summary: 'List deployment runs' description: 'Requires workspace access and the `deployments:read` scope (PAT).' operationId: listDeploymentRuns tags: [Deployments] security: - bearerAuth: [deployments:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: query name: workflowId schema: type: string format: uuid - in: query name: agentId description: 'Runs triggered for / by this environment' schema: type: string format: uuid - in: query name: status schema: type: string enum: [queued, in_progress, completed] - in: query name: search description: 'OpenSearch (`deployment-runs`) with ILIKE fallback on name, status, ref, sha, provider run id, workflow name' schema: type: string - in: query name: limit description: 'Page size (default 25, max 100)' schema: type: integer minimum: 1 - in: query name: offset schema: type: integer minimum: 0 responses: '200': description: 'Runs, newest first' content: application/json: schema: $ref: '#/components/schemas/DeploymentRunListResponse' '400': description: 'Invalid status' '403': description: 'No access to the workspace, or the connection is not available for this workspace' /clients/{clientId}/deployments/runs/{runId}: get: summary: 'Deployment run with jobs' description: 'Requires workspace access and the `deployments:read` scope (PAT).' operationId: getDeploymentRun tags: [Deployments] security: - bearerAuth: [deployments:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: runId required: true schema: type: string format: uuid responses: '200': description: 'Run (active runs are refreshed from the provider first) and its jobs' content: application/json: schema: $ref: '#/components/schemas/DeploymentRunDetail' '403': description: 'No access to the workspace, or the connection is not available for this workspace' '404': description: 'Run not found in this workspace' /clients/{clientId}/deployments/runs/{runId}/logs: get: summary: 'Deployment run or job logs' description: 'Requires workspace access and the `deployments:read` scope (PAT).' operationId: getDeploymentRunLogs tags: [Deployments] security: - bearerAuth: [deployments:read] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: runId required: true schema: type: string format: uuid - in: query name: jobId description: 'Provider job id (from the run detail); omitted: logs of the whole run' schema: type: string responses: '200': description: 'Log tail (at most 1 MB, `truncated` when cut)' content: application/json: schema: $ref: '#/components/schemas/DeploymentRunLogs' '400': description: 'Invalid job id' '403': description: 'No access to the workspace, or the connection is not available for this workspace' '404': description: 'Run not found in this workspace' '502': description: 'Provider request failed' /clients/{clientId}/deployments/runs/{runId}/cancel: post: summary: 'Cancel a deployment run' description: 'Requires workspace access and the `deployments:write` scope (PAT).' operationId: cancelDeploymentRun tags: [Deployments] security: - bearerAuth: [deployments:write] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: runId required: true schema: type: string format: uuid responses: '200': description: 'Run after the cancel request' content: application/json: schema: $ref: '#/components/schemas/DeploymentRunSummary' '403': description: 'No access to the workspace, or the connection is not available for this workspace' '404': description: 'Run not found in this workspace' '409': description: 'Run is not active or has not started on the provider yet' '502': description: 'Provider request failed' /clients/{id}/configuration-overrides: get: summary: List effective workspace configuration overrides (proxied) description: Requires workspace management rights. operationId: listClientWorkspaceConfigurationOverrides security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '200': description: Effective workspace configuration settings content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkspaceConfigurationSettingResponseDto' '403': description: Workspace management rights required '404': description: Client not found /clients/{id}/configuration-overrides/{settingKey}: put: summary: Create or update a workspace configuration override (proxied) description: Requires workspace management rights. operationId: upsertClientWorkspaceConfigurationOverride security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: settingKey required: true schema: $ref: '#/components/schemas/WorkspaceConfigurationSettingKey' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertWorkspaceConfigurationOverrideDto' responses: '200': description: Updated effective workspace configuration setting content: application/json: schema: $ref: '#/components/schemas/WorkspaceConfigurationSettingResponseDto' '400': description: Invalid request or unsupported setting key '403': description: Workspace management rights required '404': description: Client not found delete: summary: Delete a workspace configuration override (proxied) description: Requires workspace management rights. operationId: deleteClientWorkspaceConfigurationOverride security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: settingKey required: true schema: $ref: '#/components/schemas/WorkspaceConfigurationSettingKey' responses: '204': description: Override deleted successfully '403': description: Workspace management rights required '404': description: Client not found /clients/{id}/agents/{agentId}/vcs/status: get: summary: Get git status (proxied) operationId: getClientAgentGitStatus security: - bearerAuth: [agent_vcs:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Git status information content: application/json: schema: $ref: '#/components/schemas/GitStatusDto' '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/branches: get: summary: List all branches (proxied) operationId: getClientAgentGitBranches security: - bearerAuth: [agent_vcs:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '200': description: Array of branch information content: application/json: schema: type: array items: $ref: '#/components/schemas/GitBranchDto' '403': description: User does not have access to this client '404': description: Client or agent not found post: summary: Create a new branch (proxied) operationId: createClientAgentGitBranch security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateBranchDto' responses: '201': description: Branch created successfully '400': description: Invalid branch name or parameters '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/branches/{branch}: delete: summary: Delete a branch (proxied) operationId: deleteClientAgentGitBranch security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: branch required: true schema: type: string responses: '204': description: Branch deleted successfully '400': description: Cannot delete current branch '403': description: User does not have access to this client '404': description: Client, agent, or branch not found /clients/{id}/agents/{agentId}/vcs/branches/{branch}/switch: post: summary: Switch to a branch (proxied) operationId: switchClientAgentGitBranch security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: path name: branch required: true schema: type: string responses: '204': description: Branch switched successfully '400': description: Invalid branch or uncommitted changes '403': description: User does not have access to this client '404': description: Client, agent, or branch not found /clients/{id}/agents/{agentId}/vcs/diff: get: summary: Get file diff (proxied) operationId: getClientAgentGitFileDiff security: - bearerAuth: [agent_vcs:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent - in: query name: path required: true schema: type: string description: File path relative to repository root responses: '200': description: File diff information content: application/json: schema: $ref: '#/components/schemas/GitDiffDto' '400': description: Invalid file path '403': description: User does not have access to this client '404': description: Client, agent, or file not found /clients/{id}/agents/{agentId}/vcs/stage: post: summary: Stage files (proxied) operationId: stageClientAgentFiles security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/StageFilesDto' responses: '204': description: Files staged successfully '400': description: Invalid file paths '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/unstage: post: summary: Unstage files (proxied) operationId: unstageClientAgentFiles security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UnstageFilesDto' responses: '204': description: Files unstaged successfully '400': description: Invalid file paths '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/commit: post: summary: Commit staged changes (proxied) operationId: commitClientAgentChanges security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CommitDto' responses: '204': description: Changes committed successfully '400': description: No staged changes or invalid commit message '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/push: post: summary: Push changes to remote (proxied) operationId: pushClientAgentChanges security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/PushOptionsDto' responses: '204': description: Changes pushed successfully '400': description: Nothing to push or push failed '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/pull: post: summary: Pull changes from remote (proxied) operationId: pullClientAgentChanges security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '204': description: Changes pulled successfully '400': description: Pull failed or conflicts '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/fetch: post: summary: Fetch changes from remote (proxied) operationId: fetchClientAgentChanges security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent responses: '204': description: Changes fetched successfully '403': description: User does not have access to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/vcs/workspace/prepare-clean: post: summary: Prepare clean workspace (fetch, reset --hard, clean) — proxied operationId: prepareCleanClientAgentWorkspace security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object required: [baseBranch] properties: baseBranch: type: string responses: '204': description: Workspace reset '403': description: Forbidden '404': description: Not found /clients/{id}/agents/{agentId}/automation/verify-commands: post: summary: Run verifier shell commands in agent container (proxied) operationId: runClientAgentVerifierCommands security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '200': description: Command results with exit codes /clients/{id}/agents/{agentId}/vcs/rebase: post: summary: Rebase current branch (proxied) operationId: rebaseClientAgentBranch security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RebaseDto' responses: '204': description: Rebase completed successfully '400': description: Rebase failed or conflicts '403': description: User does not have access to this client '404': description: Client, agent, or branch not found /clients/{id}/agents/{agentId}/vcs/conflicts/resolve: post: summary: Resolve merge conflict (proxied) operationId: resolveClientAgentConflict security: - bearerAuth: [agent_vcs:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ResolveConflictDto' responses: '204': description: Conflict resolved successfully '400': description: Invalid conflict resolution strategy '403': description: User does not have access to this client '404': description: Client, agent, or file not found /clients/provisioning/providers: get: summary: List available provisioning providers operationId: listProvisioningProviders security: - bearerAuth: [clients:read] responses: '200': description: Array of available provisioning providers content: application/json: schema: type: array items: $ref: '#/components/schemas/ProvisioningProviderInfo' /clients/provisioning/providers/{providerType}/server-types: get: summary: Get available server types for a provisioning provider operationId: getServerTypes security: - bearerAuth: [clients:read] parameters: - in: path name: providerType required: true schema: type: string enum: [hetzner, digital-ocean] description: The provisioning provider type (e.g., 'hetzner', 'digital-ocean') responses: '200': description: Array of server types with specifications and pricing content: application/json: schema: type: array items: $ref: '#/components/schemas/ServerType' '400': description: Provider type not found or invalid /clients/provisioning/providers/{providerType}/locations: get: summary: Get available geography options for a provisioning provider operationId: getProviderLocations security: - bearerAuth: [clients:read] parameters: - in: path name: providerType required: true schema: type: string enum: [hetzner, digital-ocean] description: The provisioning provider type (e.g., 'hetzner', 'digital-ocean') responses: '200': description: Array of locations/regions with human-readable labels content: application/json: schema: type: array items: $ref: '#/components/schemas/ProviderLocation' '400': description: Provider type not found or invalid /clients/provisioning/provision: post: summary: Provision a new server and create a client operationId: provisionServer security: - bearerAuth: [clients:write] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProvisionServerDto' responses: '201': description: Provisioned server with client information content: application/json: schema: $ref: '#/components/schemas/ProvisionedServerResponseDto' '400': description: Invalid request or provisioning failed /clients/{id}/provisioning/info: get: summary: Get server information for a provisioned client operationId: getServerInfo security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '200': description: Server information content: application/json: schema: $ref: '#/components/schemas/ServerInfo' '404': description: No provisioning reference found for client or client not found /clients/{id}/provisioning: delete: summary: Delete a provisioned server and its associated client operationId: deleteProvisionedServer security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client responses: '204': description: Server and client deleted successfully '400': description: No provisioning reference found for client '404': description: Client not found /clients/{id}/agents/{agentId}/vnc/sessions: post: summary: Create a short-lived VNC desktop session ticket description: | Mints a controller-side ticket after ensureClientAccess. The ticket is single-use and bound to the caller, client, and agent. Connect noVNC to the controller HTTP PORT path /socket/vnc using Sec-WebSocket-Protocol tokens `binary` and `agenstra.vnc.` (do not put the ticket in the URL). Upstream manager/worker addresses are never returned to the browser. operationId: createClientAgentVncSession security: - bearerAuth: [agent_vnc:write, websocket:vnc:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '201': description: VNC session ticket created content: application/json: schema: $ref: '#/components/schemas/CreateClientVncSessionResponseDto' '403': description: Access denied '404': description: Client or agent not found /clients/{id}/statistics/summary: get: summary: Get statistics summary for a client description: | Returns aggregate statistics (messages, words, chars, filter drops) for a client. Requires access to the client (creator, client_users, or admin/api-key). operationId: getClientStatisticsSummary security: - bearerAuth: [statistics:read] parameters: - in: path name: id required: true schema: type: string format: uuid description: The UUID of the client - in: query name: from schema: type: string format: date-time description: Start of time range (ISO 8601) - in: query name: to schema: type: string format: date-time description: End of time range (ISO 8601) - in: query name: groupBy schema: type: string enum: [day, hour] description: Optional time-series aggregation responses: '200': description: Statistics summary content: application/json: schema: $ref: '#/components/schemas/StatisticsSummaryDto' '403': description: Access denied to this client /clients/{id}/statistics/chat-io: get: summary: Get chat I/O records for a client operationId: getClientStatisticsChatIo security: - bearerAuth: [statistics:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: direction schema: type: string enum: [input, output] - in: query name: interactionKind schema: type: string enum: [ chat, prompt_enhancement, ticket_body_generation, auto_context_enrichment, autonomous_ticket_run, autonomous_ticket_run_turn, autonomous_ticket_commit_message, chat_plan_turn, chat_plan_execute, agent_task_run, agent_handoff, ] description: Filter by interaction type (normal chat vs prompt enhancement metrics) - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across id, direction, interactionKind, wordCount, charCount responses: '200': description: Paginated chat I/O records content: application/json: schema: $ref: '#/components/schemas/StatisticsChatIoListDto' '403': description: Access denied to this client /clients/{id}/statistics/filter-drops: get: summary: Get filter drops for a client operationId: getClientStatisticsFilterDrops security: - bearerAuth: [statistics:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: filterType schema: type: string - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across filterType, filterDisplayName, filterReason, direction responses: '200': description: Paginated filter drops content: application/json: schema: $ref: '#/components/schemas/StatisticsFilterDropListDto' '403': description: Access denied to this client /clients/{id}/statistics/filter-flags: get: summary: Get filter flags for a client description: | Returns paginated filter flags (messages flagged/modified by filters but NOT dropped). These messages were allowed through (possibly modified) and appear in Chat I/O. operationId: getClientStatisticsFilterFlags security: - bearerAuth: [statistics:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: filterType schema: type: string - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across filterType, filterDisplayName, filterReason, direction responses: '200': description: Paginated filter flags content: application/json: schema: $ref: '#/components/schemas/StatisticsFilterFlagListDto' '403': description: Access denied to this client /clients/{id}/statistics/egress-events: get: summary: Get egress events for a client description: | Returns paginated egress guard decisions (web traffic filtering). Identical decisions within one collection cycle are aggregated into a single event with a `count`. operationId: getClientStatisticsEgressEvents security: - bearerAuth: [statistics:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: kind schema: type: string enum: [web, dns, network, guard] description: Filter by kind (web, dns, network, guard) - in: query name: decision schema: type: string enum: [allowed, blocked, observed, error] description: Filter by decision (allowed, blocked, observed, error) - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across host, rule, matchedEntry, decision, kind, id responses: '200': description: Paginated egress events content: application/json: schema: $ref: '#/components/schemas/StatisticsEgressEventListDto' '403': description: Access denied to this client /clients/{id}/statistics/entity-events: get: summary: Get entity lifecycle events for a client operationId: getClientStatisticsEntityEvents security: - bearerAuth: [statistics:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: entityType schema: type: string enum: [ user, client, agent, client_user, provisioning_reference, deployment_workflow, deployment_run, ] - in: query name: eventType schema: type: string enum: [created, updated, deleted] - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across entityType, eventType, originalEntityId responses: '200': description: Paginated entity events content: application/json: schema: $ref: '#/components/schemas/StatisticsEntityEventListDto' '403': description: Access denied to this client /admin/action-center: get: summary: Action center view of the caller (admins and managers) description: | Open to-dos ("next steps") of the instance (PATs: only items of their member workspaces), grouped by item type, after the caller's role (admin-only groups) and silences. `counts.open` is the console badge. Texts are not included: clients present each `type` and its `params`. Live updates are pushed over the `socket/action-center` Socket.IO namespace (console sessions only). Personal access tokens only see groups of domains they also hold a scope for (see the action center docs). operationId: getAdminActionCenterView security: - bearerAuth: [action_center:admin] responses: '200': description: The caller's view content: application/json: schema: $ref: '#/components/schemas/ActionCenterView' '401': description: Not authenticated '403': description: Not an admin / manager, the static credential, or a PAT without `action_center:admin` /admin/action-center/silences: post: summary: Silence an item type or one record (for the caller or, admins only, everyone) operationId: createAdminActionCenterSilence security: - bearerAuth: [action_center:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateActionCenterSilence' responses: '201': description: Silenced (re-silencing the same target updates its end); the caller's updated view content: application/json: schema: $ref: '#/components/schemas/ActionCenterView' '400': description: Unknown item type, an end in the past, or too many silences '403': description: Managers may only silence for themselves /admin/action-center/silences/{silenceId}: delete: summary: Lift a silence (own silences; silences for everyone admins only) operationId: removeAdminActionCenterSilence security: - bearerAuth: [action_center:admin] parameters: - in: path name: silenceId required: true schema: type: string format: uuid responses: '200': description: The caller's updated view content: application/json: schema: $ref: '#/components/schemas/ActionCenterView' '403': description: Managers may not lift silences for everyone '404': description: Unknown silence (or another user's personal silence) /admin/overview: get: summary: Admin overview of the instance (admins and managers) description: | Key figures combined over every accessible workspace (or one with `clientId`): chat activity, tickets, knowledge pages, pipeline / autonomous / scheduled task runs and security events of the period, plus one entry per workspace. Console admins and managers see every workspace; PAT callers only their member workspaces. At most 366 days grouped by day, 31 days grouped by hour. operationId: getAdminOverview security: - bearerAuth: [statistics:admin] parameters: - in: query name: clientId schema: type: string format: uuid description: Optional workspace; must be accessible (403 otherwise) - in: query name: from schema: type: string format: date description: Period start, YYYY-MM-DD (default 30 days ago) - in: query name: to schema: type: string format: date description: Period end, YYYY-MM-DD (default today) - in: query name: groupBy schema: type: string enum: [day, hour] default: day responses: '200': description: Overview of the workspaces in scope content: application/json: schema: $ref: '#/components/schemas/AdminOverviewResponse' '400': description: Invalid date range or grouping '401': description: Unauthorized '403': description: Admin or manager role required, or workspace not accessible /statistics/summary: get: summary: Get aggregate statistics summary description: | Returns aggregate statistics across all accessible clients. When clientId is provided, validates access and returns data for that client only. 403 when clientId provided but no access. operationId: getStatisticsSummary security: - bearerAuth: [statistics:read] parameters: - in: query name: clientId schema: type: string format: uuid description: Optional client filter; must be accessible - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: groupBy schema: type: string enum: [day, hour] responses: '200': description: Statistics summary content: application/json: schema: $ref: '#/components/schemas/StatisticsSummaryDto' '403': description: Access denied to requested client /statistics/chat-io: get: summary: Get chat I/O records (aggregate or by client) operationId: getStatisticsChatIo security: - bearerAuth: [statistics:read] parameters: - in: query name: clientId schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: direction schema: type: string enum: [input, output] - in: query name: interactionKind schema: type: string enum: [ chat, prompt_enhancement, ticket_body_generation, auto_context_enrichment, autonomous_ticket_run, autonomous_ticket_run_turn, autonomous_ticket_commit_message, chat_plan_turn, chat_plan_execute, agent_task_run, agent_handoff, ] description: Filter by interaction type (normal chat vs prompt enhancement metrics) - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across id, direction, interactionKind, wordCount, charCount responses: '200': description: Paginated chat I/O records content: application/json: schema: $ref: '#/components/schemas/StatisticsChatIoListDto' '403': description: Access denied to requested client /statistics/filter-drops: get: summary: Get filter drops (aggregate or by client) operationId: getStatisticsFilterDrops security: - bearerAuth: [statistics:read] parameters: - in: query name: clientId schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: filterType schema: type: string - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across filterType, filterDisplayName, filterReason, direction responses: '200': description: Paginated filter drops content: application/json: schema: $ref: '#/components/schemas/StatisticsFilterDropListDto' '403': description: Access denied to requested client /statistics/filter-flags: get: summary: Get filter flags (aggregate or by client) description: | Returns paginated filter flags (messages flagged/modified by filters but NOT dropped). These messages were allowed through (possibly modified) and appear in Chat I/O. operationId: getStatisticsFilterFlags security: - bearerAuth: [statistics:read] parameters: - in: query name: clientId schema: type: string format: uuid - in: query name: agentId schema: type: string format: uuid - in: query name: filterType schema: type: string - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across filterType, filterDisplayName, filterReason, direction responses: '200': description: Paginated filter flags content: application/json: schema: $ref: '#/components/schemas/StatisticsFilterFlagListDto' '403': description: Access denied to requested client /statistics/egress-events: get: summary: Get egress events (aggregate or by client) description: | Returns paginated egress guard decisions (web traffic filtering). Identical decisions within one collection cycle are aggregated into a single event with a `count`. operationId: getStatisticsEgressEvents security: - bearerAuth: [statistics:read] parameters: - in: query name: clientId schema: type: string format: uuid description: Optional client filter; must be accessible - in: query name: agentId schema: type: string format: uuid - in: query name: kind schema: type: string enum: [web, dns, network, guard] description: Filter by kind (web, dns, network, guard) - in: query name: decision schema: type: string enum: [allowed, blocked, observed, error] description: Filter by decision (allowed, blocked, observed, error) - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across host, rule, matchedEntry, decision, kind, id responses: '200': description: Paginated egress events content: application/json: schema: $ref: '#/components/schemas/StatisticsEgressEventListDto' '403': description: Access denied to requested client /statistics/entity-events: get: summary: Get entity events (aggregate or by client) operationId: getStatisticsEntityEvents security: - bearerAuth: [statistics:read] parameters: - in: query name: clientId schema: type: string format: uuid - in: query name: entityType schema: type: string enum: [ user, client, agent, client_user, provisioning_reference, deployment_workflow, deployment_run, ] - in: query name: eventType schema: type: string enum: [created, updated, deleted] - in: query name: from schema: type: string format: date-time - in: query name: to schema: type: string format: date-time - in: query name: limit schema: type: integer minimum: 0 - in: query name: offset schema: type: integer minimum: 0 - in: query name: search schema: type: string description: Case-insensitive search across entityType, eventType, originalEntityId responses: '200': description: Paginated entity events content: application/json: schema: $ref: '#/components/schemas/StatisticsEntityEventListDto' '403': description: Access denied to requested client /admin/webhooks/event-types: get: tags: [Admin] summary: List webhook event types (admin) operationId: listAgenstraWebhookEventTypes security: - bearerAuth: [webhooks:admin] responses: '200': description: Event catalog content: application/json: schema: type: array items: $ref: '#/components/schemas/WebhookEventTypeResponseDto' /admin/webhooks: get: tags: [Admin] summary: List webhook endpoints (admin) operationId: listAgenstraWebhookEndpoints security: - bearerAuth: [webhooks:admin] parameters: - name: limit in: query schema: { type: integer, default: 10 } - name: offset in: query schema: { type: integer, default: 0 } responses: '200': description: Webhook endpoints content: application/json: schema: type: array items: $ref: '#/components/schemas/WebhookEndpointResponseDto' post: tags: [Admin] summary: Create webhook endpoint (admin) operationId: createAgenstraWebhookEndpoint security: - bearerAuth: [webhooks:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateWebhookEndpointDto' responses: '201': description: Created endpoint content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointResponseDto' /admin/webhooks/{id}: get: tags: [Admin] summary: Get webhook endpoint (admin) operationId: getAgenstraWebhookEndpoint security: - bearerAuth: [webhooks:admin] parameters: - name: id in: path required: true schema: { type: string, format: uuid } responses: '200': description: Webhook endpoint content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointResponseDto' put: tags: [Admin] summary: Update webhook endpoint (admin) operationId: updateAgenstraWebhookEndpoint security: - bearerAuth: [webhooks:admin] parameters: - name: id in: path required: true schema: { type: string, format: uuid } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateWebhookEndpointDto' responses: '200': description: Updated endpoint content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointResponseDto' delete: tags: [Admin] summary: Delete webhook endpoint (admin) operationId: deleteAgenstraWebhookEndpoint security: - bearerAuth: [webhooks:admin] parameters: - name: id in: path required: true schema: { type: string, format: uuid } responses: '204': description: Deleted /admin/webhooks/{id}/test: post: tags: [Admin] summary: Send test webhook delivery (admin) operationId: testAgenstraWebhookEndpoint security: - bearerAuth: [webhooks:admin] parameters: - name: id in: path required: true schema: { type: string, format: uuid } responses: '200': description: Delivery result content: application/json: schema: $ref: '#/components/schemas/WebhookDeliveryResponseDto' /admin/webhooks/{id}/deliveries: get: tags: [Admin] summary: List webhook deliveries (admin) operationId: listAgenstraWebhookDeliveries security: - bearerAuth: [webhooks:admin] parameters: - name: id in: path required: true schema: { type: string, format: uuid } - name: limit in: query schema: { type: integer, default: 10 } - name: offset in: query schema: { type: integer, default: 0 } responses: '200': description: Paginated deliveries content: application/json: schema: $ref: '#/components/schemas/PaginatedWebhookDeliveriesResponseDto' /admin/updates: get: tags: [Admin] summary: Get full application updates state (admin) operationId: getAgenstraUpdatesFullState security: - bearerAuth: [updates:admin] responses: '200': description: Full updates state content: application/json: schema: $ref: '#/components/schemas/UpdatesFullStateDto' /admin/updates/status: get: tags: [Admin] summary: Get application updates status summary (admin) operationId: getAgenstraUpdatesStatusSummary security: - bearerAuth: [updates:admin] responses: '200': description: Updates status summary content: application/json: schema: $ref: '#/components/schemas/UpdatesStatusSummaryDto' /admin/updates/check: post: tags: [Admin] summary: Trigger application update check (admin) operationId: triggerAgenstraUpdateCheck security: - bearerAuth: [updates:admin] responses: '202': description: Update check enqueued content: application/json: schema: $ref: '#/components/schemas/UpdateCheckTriggerResultDto' /opencode/providers: get: tags: [OpenCode] summary: List cached built-in OpenCode LLM providers description: | Returns the models.dev provider catalog cached in the database (including model id/name pairs). Refreshed by the `opencode-providers.refresh` BullMQ job. Supports optional search (OpenSearch with ILIKE fallback) and pagination for typeahead UIs. Requires authenticated access with `clients:read`. operationId: listOpencodeProviders security: - bearerAuth: [clients:read] parameters: - in: query name: search schema: type: string description: Case-insensitive filter across id, name, npm package, api, env, and models - in: query name: limit schema: type: integer minimum: 1 maximum: 100 default: 20 - in: query name: offset schema: type: integer minimum: 0 default: 0 responses: '200': description: Provider catalog page content: application/json: schema: $ref: '#/components/schemas/OpencodeProvidersListDto' '401': description: Not authenticated /opencode/providers/{id}: get: tags: [OpenCode] summary: Get a cached OpenCode LLM provider operationId: getOpencodeProvider security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string description: Provider id (models.dev id) responses: '200': description: Provider content: application/json: schema: $ref: '#/components/schemas/OpencodeProviderDto' '401': description: Not authenticated '404': description: Provider not found /opencode/mcp-servers: get: tags: [OpenCode] summary: List cached MCP Registry servers description: | Returns the official MCP Registry catalog cached in the database (latest versions). Refreshed by the `opencode-mcp-servers.refresh` BullMQ job, which walks all upstream cursor pages before upserting. Supports optional search (OpenSearch with ILIKE fallback) and pagination for typeahead UIs. Requires authenticated access with `clients:read`. operationId: listOpencodeMcpServers security: - bearerAuth: [clients:read] parameters: - in: query name: search schema: type: string description: Case-insensitive filter across name, title, description, and status - in: query name: limit schema: type: integer minimum: 1 maximum: 100 default: 20 - in: query name: offset schema: type: integer minimum: 0 default: 0 responses: '200': description: MCP server catalog page content: application/json: schema: $ref: '#/components/schemas/OpencodeMcpServersListDto' '401': description: Not authenticated /opencode/mcp-servers/{name}: get: tags: [OpenCode] summary: Get a cached MCP Registry server operationId: getOpencodeMcpServer security: - bearerAuth: [clients:read] parameters: - in: path name: name required: true schema: type: string description: Reverse-DNS MCP Registry server name responses: '200': description: MCP server content: application/json: schema: $ref: '#/components/schemas/OpencodeMcpServerDto' '401': description: Not authenticated '404': description: MCP server not found /admin/settings: description: Admins only (not available to managers). get: tags: [Admin] summary: Overridable settings with their effective sources (admin only) description: 'Resolution: override, then the environment variable.' operationId: listControllerSettings security: - bearerAuth: [clients:admin] responses: '200': description: Settings of the requested level content: application/json: schema: $ref: '#/components/schemas/SettingsOverviewResponse' '401': description: Unauthorized '403': description: Admin access required /admin/settings/{settingKey}: put: tags: [Admin] summary: Override one setting (value encrypted at rest) operationId: upsertControllerSetting security: - bearerAuth: [clients:admin] parameters: - name: settingKey in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertSettingRequest' responses: '200': description: Updated setting content: application/json: schema: $ref: '#/components/schemas/SettingStateView' '400': description: Invalid value '403': description: Admin access required '404': description: Unknown setting delete: tags: [Admin] summary: Reset one setting to its default (removes the override) operationId: resetControllerSetting security: - bearerAuth: [clients:admin] parameters: - name: settingKey in: path required: true schema: { type: string } responses: '200': description: Setting after the reset content: application/json: schema: $ref: '#/components/schemas/SettingStateView' '403': description: Admin access required '404': description: Unknown setting /admin/opencode/config: get: tags: [Admin] summary: Get global OpenCode config operationId: getGlobalOpencodeConfig security: - bearerAuth: [clients:admin] responses: '200': description: Global OpenCode config overlay content: application/json: schema: $ref: '#/components/schemas/OpencodeConfigResponseDto' put: tags: [Admin] summary: Update global OpenCode config operationId: putGlobalOpencodeConfig security: - bearerAuth: [clients:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertOpencodeConfigDto' responses: '200': description: Updated global OpenCode config content: application/json: schema: $ref: '#/components/schemas/OpencodeConfigResponseDto' /admin/opencode/config/files: get: tags: [Admin] summary: List children under a global layer path operationId: listGlobalOpencodeLayerFiles security: - bearerAuth: [clients:admin] parameters: - in: query name: path schema: type: string default: '.' responses: '200': description: Directory listing content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileListResponseDto' post: tags: [Admin] summary: Create a global layer file or directory operationId: createGlobalOpencodeLayerFile security: - bearerAuth: [clients:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateOpencodeLayerFileDto' responses: '200': description: Created entry content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' /admin/opencode/config/files/ensure: post: tags: [Admin] summary: Ensure a global layer file or directory exists description: | Idempotent create: returns the existing entry when `path` is already stored, otherwise creates it (kind from `entryKind` or inferred from the path). `.` returns the virtual listing root. Admin only (role check in the controller). operationId: ensureGlobalOpencodeLayerFile security: - bearerAuth: [clients:admin] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateOpencodeLayerFileDto' responses: '201': description: Existing or newly created entry content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' '400': description: Invalid path '403': description: Not an admin, or insufficient token scope /admin/opencode/config/files/{path}: get: tags: [Admin] summary: Get a global OpenCode layer file operationId: getGlobalOpencodeLayerFile security: - bearerAuth: [clients:admin] parameters: - in: path name: path required: true schema: type: string description: Path as entered in config (no managed prefix rewrite) responses: '200': description: Global layer file content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' '404': description: Layer file not found put: tags: [Admin] summary: Create or update a global OpenCode layer file operationId: putGlobalOpencodeLayerFile security: - bearerAuth: [clients:admin] parameters: - in: path name: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertOpencodeLayerFileDto' responses: '200': description: Saved global layer file (fan-out emit started) content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' delete: tags: [Admin] summary: Delete a global OpenCode layer file operationId: deleteGlobalOpencodeLayerFile security: - bearerAuth: [clients:admin] parameters: - in: path name: path required: true schema: type: string responses: '200': description: Deleted content: application/json: schema: type: object required: [ok] properties: ok: type: boolean /clients/{id}/opencode/config: get: summary: Get workspace OpenCode config operationId: getClientOpencodeConfig security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid responses: '200': description: Workspace OpenCode config overlay content: application/json: schema: $ref: '#/components/schemas/OpencodeConfigResponseDto' put: summary: Update workspace OpenCode config operationId: putClientOpencodeConfig security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertOpencodeConfigDto' responses: '200': description: Updated workspace OpenCode config content: application/json: schema: $ref: '#/components/schemas/OpencodeConfigResponseDto' /clients/{id}/opencode/config/files: get: summary: List children under a workspace layer path operationId: listClientOpencodeLayerFiles security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: query name: path schema: type: string default: '.' responses: '200': description: Directory listing content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileListResponseDto' post: summary: Create a workspace layer file or directory operationId: createClientOpencodeLayerFile security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateOpencodeLayerFileDto' responses: '200': description: Created entry content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' /clients/{id}/opencode/config/files/ensure: post: summary: Ensure a workspace layer file or directory exists description: | Idempotent create: returns the existing entry when `path` is already stored, otherwise creates it (kind from `entryKind` or inferred from the path). `.` returns the virtual listing root. Requires workspace management access (see ClientResponseDto.canManageWorkspaceConfiguration). operationId: ensureClientOpencodeLayerFile security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateOpencodeLayerFileDto' responses: '201': description: Existing or newly created entry content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' '400': description: Invalid path '403': description: No workspace management access, or insufficient token scope /clients/{id}/opencode/config/files/{path}: get: summary: Get a workspace OpenCode layer file operationId: getClientOpencodeLayerFile security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: path required: true schema: type: string description: Path as entered in config (no managed prefix rewrite) responses: '200': description: Workspace layer file content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' '404': description: Layer file not found put: summary: Create or update a workspace OpenCode layer file operationId: putClientOpencodeLayerFile security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertOpencodeLayerFileDto' responses: '200': description: Saved workspace layer file (fan-out emit started) content: application/json: schema: $ref: '#/components/schemas/OpencodeLayerFileResponseDto' delete: summary: Delete a workspace OpenCode layer file operationId: deleteClientOpencodeLayerFile security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: path required: true schema: type: string responses: '200': description: Deleted content: application/json: schema: type: object required: [ok] properties: ok: type: boolean /clients/{id}/agents/{agentId}/egress: get: summary: Get agent egress guard details description: | Returns the egress guard (web traffic filtering) status of the environment, the effective policy in force on the agent manager, the effective message filters and recent guard decisions. Requires the `clients:read` scope and workspace management access (exposes layered policy details, like the agent configuration endpoints). operationId: getClientAgentEgress security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: Egress guard details content: application/json: schema: $ref: '#/components/schemas/AgentEgressDetailsDto' '403': description: Access denied to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/egress/evaluate: post: summary: Evaluate a destination against the effective egress policy description: | Evaluates a hostname, IP address or URL against the environment's effective (layered) egress policy (global, workspace, environment). Only `http://` and `https://` URLs are accepted. Requires the `clients:read` scope and workspace management access (exposes layered policy details, like the agent configuration endpoints). operationId: evaluateClientAgentEgressDestination security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/EvaluateEgressDestinationDto' responses: '200': description: Evaluation result content: application/json: schema: $ref: '#/components/schemas/EgressEvaluationResponseDto' '400': description: Invalid destination '403': description: Access denied to this client '404': description: Client or agent not found /clients/{id}/agents/{agentId}/opencode/config: get: summary: Get agent OpenCode config operationId: getClientAgentOpencodeConfig security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: Agent OpenCode config with effective merge content: application/json: schema: $ref: '#/components/schemas/OpencodeConfigResponseDto' put: summary: Update agent OpenCode config operationId: putClientAgentOpencodeConfig security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertOpencodeConfigDto' responses: '200': description: Updated agent OpenCode config with effective merge content: application/json: schema: $ref: '#/components/schemas/OpencodeConfigResponseDto' /clients/{id}/agents/{agentId}/opencode/config/agents: get: summary: List effective OpenCode agents for a remote worker operationId: listClientAgentOpencodeAgents security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: Effective OpenCode agents (primary + subagents) content: application/json: schema: $ref: '#/components/schemas/OpencodeAgentsListResponseDto' /clients/{id}/agents/{agentId}/opencode/config/commands: get: summary: List slash-invokable OpenCode commands for a remote worker description: > Proxies the agent-manager list of OpenCode `GET /command` entries (config commands, builtins, skills, MCP prompts). operationId: listClientAgentOpencodeCommands security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: Slash commands available on the worker content: application/json: schema: $ref: '#/components/schemas/OpencodeCommandsListResponseDto' /clients/{id}/agents/{agentId}/opencode/mcp: get: summary: List live MCP server statuses for an Environment description: > Environment-only. Proxies OpenCode `GET /mcp` via the agent manager. Use to detect servers that need interactive OAuth (`needs_auth` / `needs_client_registration`). operationId: listClientAgentOpencodeMcpStatuses security: - bearerAuth: [clients:read] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid responses: '200': description: MCP server statuses content: application/json: schema: $ref: '#/components/schemas/OpencodeMcpStatusListResponseDto' /clients/{id}/agents/{agentId}/opencode/mcp/{name}/auth: post: summary: Start interactive MCP OAuth for an Environment MCP server description: > Environment-only. Builds a signed public callback URL, sets it as the worker oauth.redirectUri, then proxies OpenCode `POST /mcp/{name}/auth`. operationId: startClientAgentOpencodeMcpAuth security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: name required: true schema: type: string responses: '200': description: OAuth flow started content: application/json: schema: $ref: '#/components/schemas/OpencodeMcpAuthStartResponseDto' '400': description: Agent not running, MCP OAuth unsupported, or callback env not configured delete: summary: Remove MCP OAuth credentials for an Environment MCP server operationId: removeClientAgentOpencodeMcpAuth security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: name required: true schema: type: string responses: '200': description: OAuth credentials removed content: application/json: schema: type: object required: [success] properties: success: type: boolean enum: [true] /clients/{id}/agents/{agentId}/opencode/mcp/{name}/auth/callback: post: summary: Complete MCP OAuth with authorization code operationId: completeClientAgentOpencodeMcpAuth security: - bearerAuth: [clients:write] parameters: - in: path name: id required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: name required: true schema: type: string requestBody: required: true content: application/json: schema: type: object required: [code] properties: code: type: string minLength: 1 responses: '200': description: Updated MCP status after OAuth content: application/json: schema: $ref: '#/components/schemas/OpencodeMcpServerStatusDto' /clients/{clientId}/agents/{agentId}/opencode/mcp/{name}/oauth/callback: get: summary: Public MCP OAuth redirect callback (no /api prefix) description: > IdP redirect target for Environment interactive MCP auth. Verifies HMAC `sig`/`exp` query params (`MCP_OAUTH_CALLBACK_SECRET`), then proxies the authorization `code` to the agent manager OpenCode auth/callback. Mounted outside the Nest `/api` global prefix. operationId: publicClientAgentOpencodeMcpOAuthCallback servers: - url: http://localhost:3100 security: [] parameters: - in: path name: clientId required: true schema: type: string format: uuid - in: path name: agentId required: true schema: type: string format: uuid - in: path name: name required: true schema: type: string - in: query name: code schema: type: string - in: query name: state schema: type: string - in: query name: exp required: true schema: type: integer - in: query name: sig required: true schema: type: string - in: query name: error schema: type: string - in: query name: error_description schema: type: string responses: '200': description: HTML success page after completing worker auth content: text/html: schema: type: string '400': description: Missing code or auth completion failed '403': description: Invalid or expired signature /clients/{id}/agents/{agentId}/graph/status: get: summary: Environment graph build status (proxied) description: Requires workspace access; the agent must belong to the workspace. operationId: getClientAgentGraphStatus tags: [Graphs] security: - bearerAuth: [graph:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' responses: '200': description: Graph status of the environment content: application/json: schema: $ref: '#/components/schemas/AgentGraphStatus' '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph/overview: get: summary: Environment graph overview (proxied) description: | Modules, hubs, communities and instruction files. PATs also need `agent_files:read`; `recentPrompts` is omitted without `agent_chats:read`. Builds the graph lazily when missing. operationId: getClientAgentGraphOverview tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' responses: '200': description: Graph overview content: application/json: schema: $ref: '#/components/schemas/AgentGraphOverview' '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph: get: summary: Environment graph document of one layer (proxied) description: | PATs also need `agent_files:read`, and `agent_chats:read` for `layer=references`. Paginated by `offset` / `limit` (see `nextOffset`). operationId: getClientAgentGraph tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - $ref: '#/components/parameters/graphLayer' - $ref: '#/components/parameters/graphDocumentLimit' - $ref: '#/components/parameters/graphNodeTypes' - $ref: '#/components/parameters/graphOffset' responses: '200': description: Graph document (scope `environment`) content: application/json: schema: $ref: '#/components/schemas/AgentGraphDocument' '400': description: Invalid query parameters '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph/search: get: summary: Search an environment graph (proxied) description: PATs also need `agent_files:read`, and `agent_chats:read` for `layer=references`. operationId: searchClientAgentGraph tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - in: query name: query required: true schema: type: string maxLength: 256 description: Search text (trimmed, capped at 256 characters) - $ref: '#/components/parameters/graphLayer' - $ref: '#/components/parameters/graphNodeTypes' - in: query name: limit required: false schema: type: integer minimum: 1 maximum: 100 responses: '200': description: Search hits content: application/json: schema: $ref: '#/components/schemas/AgentGraphSearchResponse' '400': description: Missing or invalid query parameters '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph/nodes: get: summary: Graph node with its relations (proxied) description: PATs also need `agent_files:read`, and `agent_chats:read` for `layer=references`. operationId: getClientAgentGraphNode tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - $ref: '#/components/parameters/graphNodeId' - $ref: '#/components/parameters/graphLayer' responses: '200': description: Node detail content: application/json: schema: $ref: '#/components/schemas/AgentGraphNodeDetail' '400': description: Missing or invalid node id '403': description: No access to this client or insufficient token scope '404': description: Client, agent or node not found /clients/{id}/agents/{agentId}/graph/neighbors: get: summary: Neighborhood of a graph node (proxied) description: PATs also need `agent_files:read`, and `agent_chats:read` for `layer=references`. operationId: getClientAgentGraphNeighbors tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - $ref: '#/components/parameters/graphNodeId' - $ref: '#/components/parameters/graphLayer' - in: query name: depth required: false schema: type: integer minimum: 1 maximum: 3 - in: query name: limit required: false schema: type: integer minimum: 1 maximum: 400 responses: '200': description: Graph document of the neighborhood content: application/json: schema: $ref: '#/components/schemas/AgentGraphDocument' '400': description: Missing or invalid node id '403': description: No access to this client or insufficient token scope '404': description: Client, agent or node not found /clients/{id}/agents/{agentId}/graph/path: get: summary: Shortest path between two graph nodes (proxied) description: PATs also need `agent_files:read`, and `agent_chats:read` for `layer=references`. operationId: getClientAgentGraphPath tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - in: query name: from required: true schema: type: string maxLength: 1024 - in: query name: to required: true schema: type: string maxLength: 1024 - $ref: '#/components/parameters/graphLayer' responses: '200': description: Path (empty when not found) content: application/json: schema: $ref: '#/components/schemas/AgentGraphPathResponse' '400': description: Missing or invalid node ids '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph/file: get: summary: Graph view of one file (proxied) description: PATs also need `agent_files:read`; `prompts` is empty without `agent_chats:read`. operationId: getClientAgentGraphFile tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - in: query name: path required: true schema: type: string maxLength: 1024 description: Path relative to the working directory or absolute (`/app/...`) responses: '200': description: File symbols, imports and prompts content: application/json: schema: $ref: '#/components/schemas/AgentGraphFileResponse' '400': description: Missing or invalid path '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph/references: get: summary: Prompt reference graph (proxied) description: Which context each prompt was given, used and changed. PATs also need `agent_chats:read`. operationId: getClientAgentGraphReferences tags: [Graphs] security: - bearerAuth: [graph:read, agent_chats:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' - in: query name: promptId required: false schema: type: string maxLength: 1024 description: Include the reference detail of this prompt - in: query name: limit required: false schema: type: integer minimum: 1 maximum: 500 default: 50 description: Number of prompts listed responses: '200': description: Prompt summaries (and the requested prompt's references) content: application/json: schema: $ref: '#/components/schemas/AgentGraphReferencesResponse' '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/agents/{agentId}/graph/refresh: post: summary: Rebuild an environment graph (proxied) operationId: refreshClientAgentGraph tags: [Graphs] security: - bearerAuth: [graph:write] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphAgentId' responses: '202': description: Rebuild queued content: application/json: schema: $ref: '#/components/schemas/AgentGraphRefreshResponse' '403': description: No access to this client or insufficient token scope '404': description: Client or agent not found /clients/{id}/graph: get: summary: Workspace graph per layer description: | The controller resolves the workspace's environments itself and lets the agent-manager compose their graphs (node ids `::`, one `environment:` node per environment, cross-environment `references` edges) and adds a `workspace:` node; `knowledge` serves the metadata snapshot and `all` both. Paginated by `offset` / `limit`. operationId: getClientWorkspaceGraph tags: [Graphs] security: - bearerAuth: [graph:read, agent_files:read] parameters: - $ref: '#/components/parameters/graphClientId' - $ref: '#/components/parameters/graphViewLayer' - $ref: '#/components/parameters/graphDocumentLimit' - $ref: '#/components/parameters/graphOffset' responses: '200': description: Graph document (scope `workspace`, `clientId` set) content: application/json: schema: $ref: '#/components/schemas/AgentGraphDocument' '400': description: Invalid query parameters '403': description: No access to this client or insufficient token scope /clients/{id}/graph/snapshot: get: summary: Workspace metadata graph snapshot description: | Persisted metadata graph of the workspace (environments, modules, languages, knowledge, tickets, plans; titles and ids only). Built when missing and refreshed in the background when older than 15 minutes. PAT callers only see nodes their scopes cover (`tickets:read`, `knowledge:read`, `agent_chats:read` for plans, `agent_files:read` for modules and languages). operationId: getClientWorkspaceGraphSnapshot tags: [Graphs] security: - bearerAuth: [graph:read] parameters: - $ref: '#/components/parameters/graphClientId' responses: '200': description: Graph document (scope and layer `global`, `clientId` set) content: application/json: schema: $ref: '#/components/schemas/AgentGraphDocument' '403': description: No access to this client /clients/{id}/graph/snapshot/refresh: post: summary: Rebuild the workspace metadata graph snapshot now operationId: refreshClientWorkspaceGraphSnapshot tags: [Graphs] security: - bearerAuth: [graph:write] parameters: - $ref: '#/components/parameters/graphClientId' responses: '200': description: Snapshot status after the build content: application/json: schema: $ref: '#/components/schemas/AgentGraphWorkspaceSnapshotStatus' '403': description: No access to this client /graph/global: get: summary: Global graph over every accessible workspace, per layer description: | The graph of every workspace the caller may access (API key and console admins: all workspaces) for the given layer, with cross-workspace environment references. Knowledge nodes are filtered by PAT scopes like the snapshot route. Paginated by `offset` / `limit`. operationId: getGlobalGraph tags: [Graphs] security: - bearerAuth: [graph:read] parameters: - $ref: '#/components/parameters/graphViewLayer' - $ref: '#/components/parameters/graphDocumentLimit' - $ref: '#/components/parameters/graphOffset' responses: '200': description: Graph document (scope `global`) content: application/json: schema: $ref: '#/components/schemas/AgentGraphDocument' /graph/global/status: get: summary: Snapshot status of every accessible workspace operationId: getGlobalGraphStatus tags: [Graphs] security: - bearerAuth: [graph:read] responses: '200': description: One status per accessible workspace content: application/json: schema: type: array items: $ref: '#/components/schemas/AgentGraphWorkspaceSnapshotStatus' /otel/metrics: get: summary: Prometheus metrics scrape description: | OpenTelemetry Prometheus exposition endpoint. Mounted at the HTTP root, **outside** the `/api` global prefix. Path is configurable via `OTEL_METRICS_PATH` (default `/otel/metrics`). Requires HTTP Basic authentication with `OTEL_USERNAME` and `OTEL_PASSWORD`. Disabled when `OTEL_ENABLED` is not exactly `true`. operationId: getOtelMetrics servers: - url: http://localhost:3100 security: - basicAuth: [] responses: '200': description: Prometheus text exposition format content: text/plain: schema: type: string '401': description: Missing or invalid Basic auth credentials components: securitySchemes: bearerAuth: type: http scheme: bearer description: | Interactive session JWT, or a JWT exchanged from a personal access token (`POST /auth/token`). Interactive sessions are users / SAML session JWTs or, with `AUTHENTICATION_METHOD=oidc`, OIDC access tokens. For personal access tokens, the role names listed on an operation's `bearerAuth` requirement are the PAT scopes it requires (OpenAPI 3.1 role names; not enforced for interactive sessions). Scopes follow `:read|write|admin`; `write` implies `read`, and `admin` implies `write` and `read`. `:admin` scopes are only grantable to and effective for admin users. Operations without listed scopes either do not accept personal access tokens or are public. On the OpenAI-compatible routes (`/clients/{id}/agents/{agentId}/openai/v1/*`) a raw personal access token (`fp_pat_…`) is also accepted as bearer; it is exchanged in-process exactly like `POST /auth/token`. bearerFormat: JWT basicAuth: type: http scheme: basic mutualTLS: type: mutualTLS description: | `AUTHENTICATION_METHOD=mtls` with the native TLS listener (`MTLS_SERVER_CERT` / `MTLS_SERVER_KEY`): a client certificate of a CA in `MTLS_CA_CERT` presented in the TLS handshake. Grants full admin access, like the static API key. certificateAssertion: type: apiKey in: header name: Authorization description: | `AUTHENTICATION_METHOD=mtls`: `Certificate `, a short-lived compact JWS signed with the client certificate's private key (`typ: cert-assertion+jwt`, certificate chain in `x5c`, `exp - iat` at most `MTLS_ASSERTION_MAX_LIFETIME`). Used by browsers and behind TLS-terminating proxies. Grants full admin access, like the static API key. parameters: openAiClientId: in: path name: id required: true schema: type: string format: uuid description: The UUID of the client (workspace) openAiAgentId: in: path name: agentId required: true schema: type: string format: uuid description: The UUID of the agent openAiConversationId: in: path name: conversationId required: true schema: type: string description: '`conv_…` id or chat session UUID' openAiToolActivityHeader: in: header name: X-Agenstra-Tool-Activity required: false schema: type: string enum: ['true', '1'] description: | Opt in to read-only agent tool activity (Chat Completions `reasoning_content`, Responses `mcp_call` items). Same as the `tool_activity` body field. openAiChatIdHeader: in: header name: X-Agenstra-Chat-Id required: false schema: type: string description: Chat session (UUID or `conv_…` id) of this agent; default is the primary session fileManagerContext: name: context in: query required: false schema: type: string enum: [app] default: app description: Proxied to agent-manager. `app` (default) is the workspace root under `/app`. graphClientId: name: id in: path required: true schema: type: string format: uuid description: The UUID of the client (workspace) graphAgentId: name: agentId in: path required: true schema: type: string format: uuid description: The UUID of the agent (environment); must belong to the workspace graphLayer: name: layer in: query required: false schema: type: string enum: [all, code, paths, references] default: code description: >- Environment graph layer; `all` merges code, paths and prompt references. `references` and `all` additionally require `agent_chats:read` for PATs. graphViewLayer: name: layer in: query required: false schema: type: string enum: [all, code, paths, references, knowledge] default: all description: >- Workspace / global graph layer. `knowledge` = the persisted metadata snapshots (filtered by PAT scopes); `all` = the composed environment graphs plus the knowledge metadata. PATs need `agent_files:read` for `code` / `paths`, plus `agent_chats:read` for `references` / `all`. graphOffset: name: offset in: query required: false schema: type: integer minimum: 0 default: 0 description: >- Page start: documents are paginated in a stable rank order (anchors first, then by degree). Request the next page with the response's `nextOffset` until it is `null`. graphDocumentLimit: name: limit in: query required: false schema: type: integer minimum: 1 maximum: 6000 default: 1500 description: Nodes per page (highest ranked first) graphNodeTypes: name: types in: query required: false schema: type: string description: Comma-separated node types to include (unknown types are ignored) graphNodeId: name: id in: query required: true schema: type: string maxLength: 1024 description: Graph node id (e.g. `file:src/a.ts`, `symbol:src/a.ts#Foo`) headers: OpenAiChatId: description: Chat session the turn ran in schema: type: string format: uuid responses: OpenAiError: description: OpenAI error envelope (400 invalid request, 401, 403 missing scope / access, 404, 429, 5xx) content: application/json: schema: $ref: '#/components/schemas/OpenAiError' schemas: ActionCenterView: type: object required: [generatedAt, role, canSilenceForEveryone, counts, groups, silences] properties: generatedAt: type: string format: date-time role: type: string enum: [admin, manager] canSilenceForEveryone: type: boolean counts: type: object required: [open, setup, silenced] properties: open: type: integer description: Open (not silenced) to-dos, the console badge setup: type: integer description: Open setup suggestions (subset of open) silenced: type: integer groups: type: array items: $ref: '#/components/schemas/ActionCenterGroup' silences: type: array items: $ref: '#/components/schemas/ActionCenterSilence' ActionCenterGroup: type: object required: [ type, category, severity, kind, audience, total, openCount, params, items, silencedBy, ] properties: type: type: string example: decabill.invoices.unsent category: type: string severity: type: string enum: [info, warning, danger] kind: type: string enum: [task, setup] audience: type: string enum: [administrative, admin] total: type: integer openCount: type: integer params: type: object additionalProperties: true items: type: array maxItems: 25 items: type: object required: [id, params, occurredAt, silencedBy] properties: id: type: string params: type: object additionalProperties: true occurredAt: type: string format: date-time nullable: true silencedBy: type: string format: uuid nullable: true silencedBy: type: string format: uuid nullable: true ActionCenterSilence: type: object required: [ id, itemType, itemId, audience, until, createdAt, createdByUserId, removable, ] properties: id: type: string format: uuid itemType: type: string itemId: type: string nullable: true audience: type: string enum: [self, everyone] until: type: string format: date-time nullable: true createdAt: type: string format: date-time createdByUserId: type: string format: uuid nullable: true removable: type: boolean CreateActionCenterSilence: type: object required: [itemType, audience] properties: itemType: type: string pattern: '^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*){1,4}$' itemId: type: string nullable: true maxLength: 128 description: Omitted / null silences the whole type audience: type: string enum: [self, everyone] until: type: string format: date-time nullable: true description: End of the silence (future); omitted / null until lifted SettingStateView: type: object description: One overridable setting (environment variable) as seen from a level. Values of `secret` settings are never returned. required: [ key, category, type, scope, sensitive, restartRequired, value, hasOverride, inheritedValue, hasInheritedValue, inheritedSource, effectiveSource, ] properties: key: { type: string, description: Environment variable name, example: SMTP_HOST, } category: { type: string, example: email } type: type: string enum: [ string, text, secret, boolean, integer, number, enum, url, email, cron, timezone, duration, list, image, color, ] scope: type: string enum: [global, tenant] description: '`tenant` settings can also be overridden per tenant' sensitive: { type: boolean } restartRequired: { type: boolean, description: Read at startup; overrides apply after a restart, } options: { type: array, items: { type: string } } min: { type: number } max: { type: number } defaultValue: { type: string, description: Built-in fallback when nothing is set } maxLength: { type: integer, description: Maximum value length (`image` settings; base64 data URI), } value: { type: string, nullable: true, description: Override stored at the viewed level (null for secrets), } hasOverride: { type: boolean } inheritedValue: { type: string, nullable: true, description: Value applying after a reset (null for secrets), } hasInheritedValue: { type: boolean } inheritedSource: { type: string, enum: [global, environment, default] } effectiveSource: { type: string, enum: [tenant, global, environment, default] } SettingsOverviewResponse: type: object required: [ level, tenantId, homeTenantId, canManageGlobal, viewableTenants, categories, settings, ] properties: level: { type: string, enum: [global, tenant] } tenantId: { type: string, nullable: true } homeTenantId: { type: string, nullable: true } canManageGlobal: { type: boolean } viewableTenants: { type: array, items: { type: string } } categories: { type: array, items: { type: string } } settings: { type: array, items: { $ref: '#/components/schemas/SettingStateView' }, } UpsertSettingRequest: type: object required: [value] properties: value: { type: string, maxLength: 65536 } AppTokenRequestDto: type: object required: [grant_type, app_id, app_secret] properties: grant_type: type: string enum: [authorization_code, refresh_token] app_id: type: string format: uuid app_secret: type: string description: '`fp_aps_…`' code: type: string description: Authorization code (`fp_apc_…`) for `authorization_code` code_verifier: type: string description: PKCE verifier when the authorization used `code_challenge` refresh_token: type: string description: Refresh token (`fp_apr_…`) for `refresh_token` AppTokenResponseDto: type: object required: [ access_token, token_type, expires_in, refresh_token, scope, scopes, reauthorization_required, user, ] properties: access_token: type: string token_type: type: string enum: [Bearer] expires_in: type: integer description: Seconds until the access token expires refresh_token: type: string description: Rotating refresh token; store it and use it once scope: type: string description: Space-separated effective scopes scopes: type: array items: type: string reauthorization_required: type: boolean description: The app requests scopes the user has not consented to yet; send the user to /authorize again user: type: object properties: id: type: string format: uuid email: type: string role: type: string AppAuthorizationInfoDto: type: object properties: app: type: object properties: id: type: string format: uuid name: type: string description: type: string nullable: true returnUrl: type: string format: uri grantableScopes: type: array items: type: string ungrantableScopes: type: array items: type: string alreadyAuthorized: type: boolean secondFactor: type: string enum: [email, totp] nullable: true AppAuthorizationDecisionDto: type: object required: [appId, decision] properties: appId: type: string format: uuid decision: type: string enum: [approve, deny] state: type: string maxLength: 512 codeChallenge: type: string codeChallengeMethod: type: string enum: [S256] code: type: string description: Second factor (TOTP or email code) IdentityAppInputDto: type: object required: [name, returnUrl, scopes] properties: name: type: string maxLength: 255 description: type: string maxLength: 2000 returnUrl: type: string format: uri description: Absolute https URL (http only for localhost), no credentials or fragment scopes: type: array minItems: 1 items: type: string IdentityAppResponseDto: type: object properties: id: type: string format: uuid description: App id name: type: string description: type: string nullable: true returnUrl: type: string scopes: type: array items: type: string secretPrefix: type: string secretRotatedAt: type: string format: date-time nullable: true grantCount: type: integer createdAt: type: string format: date-time updatedAt: type: string format: date-time secret: type: string description: Present only on create and secret rotation IdentityAppGrantResponseDto: type: object properties: id: type: string format: uuid appId: type: string format: uuid appName: type: string appDescription: type: string nullable: true userId: type: string format: uuid userEmail: type: string consentedScopes: type: array items: type: string scopes: type: array description: Effective scopes app tokens carry items: type: string needsReauthorization: type: boolean sessionCount: type: integer lastUsedAt: type: string format: date-time nullable: true createdAt: type: string format: date-time updatedAt: type: string format: date-time AgentPermissionReplyDto: type: object required: [reply] properties: reply: type: string enum: [once, always, reject] sessionId: type: string description: OpenCode session the permission belongs to (optional) AgentQuestionReplyDto: type: object properties: answers: type: array items: type: string description: Answers to submit (omit when rejecting) reply: type: string enum: [reject] description: Set to `reject` to decline the question sessionId: type: string description: OpenCode session the question belongs to (optional) AuthenticationType: type: string description: Controller → agent-manager authentication (`mtls` is not available for provisioned servers) enum: - api_key - oidc - mtls AuthenticationMethod: type: string enum: - api-key - mtls - users - oidc - saml description: Server authentication method (api-key, mtls, users, oidc, or saml) SamlTokenExchangeDto: type: object required: [code, codeVerifier] properties: code: type: string maxLength: 128 codeVerifier: type: string pattern: '^[A-Za-z0-9._~-]{43,128}$' SamlTokenResponse: type: object required: [access_token] properties: access_token: type: string LoginDto: type: object required: [email, password] properties: email: type: string format: email password: type: string code: type: string pattern: '^[A-Za-z0-9]{6}$' description: Second-factor code (email OTP or TOTP) after LOGIN_2FA_REQUIRED EnableEmail2faDto: type: object properties: code: type: string pattern: '^[A-Z0-9]{6}$' description: Optional emailed verification code to complete enablement ConfirmTotpDto: type: object required: [code] properties: code: type: string pattern: '^[0-9]{6}$' description: 6-digit authenticator code DisableTotpDto: type: object required: [code] properties: code: type: string pattern: '^[0-9]{6}$' description: 6-digit authenticator code (possession proves step-up) CurrentPasswordDto: type: object required: [currentPassword] properties: currentPassword: type: string description: Account password for step-up verification TotpSetupResponseDto: type: object required: [secret, otpauthUrl] properties: secret: type: string otpauthUrl: type: string TwoFactorStatusDto: type: object required: [forceEnabled, emailEnabled, totpEnabled, method] properties: forceEnabled: type: boolean emailEnabled: type: boolean totpEnabled: type: boolean method: type: - string - 'null' enum: [email, totp, null] RegisterDto: type: object required: [email, password] properties: email: type: string format: email password: type: string minLength: 8 ConfirmEmailDto: type: object required: [email, code] properties: email: type: string format: email description: User's email address code: type: string pattern: '^[A-Z0-9]{6}$' description: 6-character alphanumeric confirmation code from email (A-Z, 0-9) RequestPasswordResetDto: type: object required: [email] properties: email: type: string format: email ResetPasswordDto: type: object required: [email, code, newPassword] properties: email: type: string format: email description: User's email address code: type: string pattern: '^[A-Z0-9]{6}$' description: 6-character alphanumeric reset code from email (A-Z, 0-9) newPassword: type: string minLength: 8 ChangePasswordDto: type: object required: [currentPassword, newPassword, newPasswordConfirmation] properties: currentPassword: type: string newPassword: type: string minLength: 8 newPasswordConfirmation: type: string minLength: 8 ChangePasswordResponse: type: object properties: message: type: string access_token: type: string LogoutDto: type: object properties: invalidateAllSessions: type: boolean description: When true, invalidates every active JWT session for the user. Default is false (current session only). LoginResponse: type: object required: [access_token, user] properties: access_token: type: string description: JWT bearer token user: type: object required: [id, email, role] properties: id: type: string format: uuid email: type: string role: $ref: '#/components/schemas/UserRole' PatLoginResponse: allOf: - $ref: '#/components/schemas/LoginResponse' - type: object properties: scopes: type: array items: type: string ExchangePersonalAccessTokenDto: type: object required: [token] properties: token: type: string description: Full personal access token (`fp_pat_…`) CreatePersonalAccessTokenDto: type: object required: [name, scopes] properties: name: type: string minLength: 1 maxLength: 255 scopes: type: array minItems: 1 items: type: string expiresAt: type: string format: date-time UpdatePersonalAccessTokenDto: type: object required: [name, scopes] properties: name: type: string minLength: 1 maxLength: 255 scopes: type: array minItems: 1 items: type: string PersonalAccessTokenScopeDto: type: object required: [scope] properties: scope: type: string PersonalAccessTokenResponseDto: type: object required: [id, name, tokenPrefix, scopes, createdAt] properties: id: type: string format: uuid name: type: string tokenPrefix: type: string scopes: type: array items: type: string expiresAt: type: string format: date-time nullable: true revokedAt: type: string format: date-time nullable: true lastUsedAt: type: string format: date-time nullable: true createdAt: type: string format: date-time token: type: string description: Plaintext token; only present on create RegisterResponse: type: object required: [user, message] properties: user: type: object required: [id, email, role] properties: id: type: string format: uuid email: type: string role: $ref: '#/components/schemas/UserRole' message: type: string UserRole: type: string description: > Console role. `manager` has administrative access like `admin`, except tenant / system settings, identity apps and managing the accounts of managers and admins. enum: - user - manager - admin UserResponseDto: type: object required: [id, email, role, createdAt, updatedAt] properties: id: type: string format: uuid email: type: string role: $ref: '#/components/schemas/UserRole' emailConfirmedAt: type: string format: date-time lockedAt: type: - string - 'null' format: date-time totpEnabled: type: boolean description: Whether authenticator 2FA is enrolled email2faEnabled: type: boolean description: Whether the user opted into email 2FA createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateUserDto: type: object required: [email, password] properties: email: type: string format: email password: type: string minLength: 8 role: $ref: '#/components/schemas/UserRole' emailConfirmed: type: boolean default: false description: Create the account with its email already confirmed; no confirmation email is sent. sendConfirmationEmail: type: boolean default: true description: > Email a confirmation code to an unconfirmed account. With false the account stays unconfirmed until an admin confirms it via POST /users/{id}/confirm-email. UpdateUserDto: type: object properties: email: type: string format: email password: type: string minLength: 8 role: $ref: '#/components/schemas/UserRole' emailConfirmed: type: boolean default: false description: Only when the email changes. Keep the new address confirmed; no confirmation email is sent. sendConfirmationEmail: type: boolean default: true description: > Only when the email changes to an unconfirmed address. With false no code is sent and the address stays unconfirmed until an admin confirms it. ClientResponseDto: type: object required: [ id, name, endpoint, authenticationType, isAutoProvisioned, canManageWorkspaceConfiguration, createdAt, updatedAt, ] properties: id: type: string format: uuid name: type: string description: type: string endpoint: type: string format: uri authenticationType: $ref: '#/components/schemas/AuthenticationType' mtlsCertificate: type: object description: Stored client certificate (mtls authentication type only; the private key is never returned) properties: fingerprint256: type: string description: SHA-256 fingerprint of the leaf certificate (lowercase hex) commonName: type: string validTo: type: string format: date-time config: $ref: '#/components/schemas/ConfigResponseDto' description: Configuration from the agent-manager instance (optional, may be undefined if agent-manager is unreachable) isolation: $ref: '#/components/schemas/ClientIsolationSummaryDto' description: | Container isolation levels of the workspace host (recommendation, ready levels, capability revision). Optional; served from the last stored snapshot (`stale: true`) when the agent-manager is unreachable. isAutoProvisioned: type: boolean description: Indicates whether the client was auto-provisioned via server provisioning. Used to determine if server info endpoints should be called. canManageWorkspaceConfiguration: type: boolean description: | True if the current caller may change prototype autonomy, agent environment variables, agent CRUD, and workspace (client) update/delete. Requires global admin, workspace creator, client_users admin, API key authentication, or api-key server mode. createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateClientDto: type: object required: [name, endpoint, authenticationType] properties: name: type: string description: type: string endpoint: type: string format: uri authenticationType: $ref: '#/components/schemas/AuthenticationType' apiKey: type: string description: API key (optional, will be auto-generated if not provided for API_KEY type) oidcClientId: type: string description: OIDC client ID (required for oidc authentication type) oidcClientSecret: type: string writeOnly: true description: OIDC client secret (required for oidc authentication type; never returned) oidcIssuer: type: string format: uri description: OIDC issuer (optional, defaults to the controller's OIDC_ISSUER; other issuers must pass the client endpoint SSRF policy) oidcScope: type: string description: Optional space separated scopes for the client credentials grant mtlsCertificate: type: string maxLength: 32768 description: Client certificate chain (PEM, leaf first) for the mtls authentication type; its CA must be trusted by the agent-manager (MTLS_CA_CERT) mtlsPrivateKey: type: string writeOnly: true maxLength: 32768 description: Unencrypted PEM private key of the client certificate (mtls; stored encrypted, never returned). Certificate and key are replaced together UpdateClientDto: type: object properties: name: type: string description: type: string endpoint: type: string format: uri authenticationType: $ref: '#/components/schemas/AuthenticationType' apiKey: type: string description: API key (can be updated but will never be included in responses) oidcClientId: type: string description: OIDC client ID (required for oidc authentication type) oidcClientSecret: type: string writeOnly: true description: OIDC client secret (required for oidc authentication type; never returned) oidcIssuer: type: string format: uri description: OIDC issuer (optional, defaults to the controller's OIDC_ISSUER; other issuers must pass the client endpoint SSRF policy) oidcScope: type: string description: Optional space separated scopes for the client credentials grant mtlsCertificate: type: string maxLength: 32768 description: Client certificate chain (PEM, leaf first) for the mtls authentication type; its CA must be trusted by the agent-manager (MTLS_CA_CERT) mtlsPrivateKey: type: string writeOnly: true maxLength: 32768 description: Unencrypted PEM private key of the client certificate (mtls; stored encrypted, never returned). Certificate and key are replaced together CreateClientResponseDto: allOf: - $ref: '#/components/schemas/ClientResponseDto' - type: object properties: apiKey: type: string description: The API key for the client (only for API_KEY authentication type, only returned once during creation) CreateAgentDto: type: object required: [name] properties: name: type: string description: type: string agentType: type: string enum: [opencode] description: Agent provider type (defaults to 'opencode' if not provided) gitRepositorySetupMode: type: string enum: [clone, empty] description: How to initialize the agent workspace Git repository gitRepositoryUrl: type: [string, 'null'] description: Git repository URL to clone when creating the agent isolationLevel: $ref: '#/components/schemas/IsolationLevel' description: | Container isolation level (`microvm` = KVM microVM, `sandboxed-kvm` = gVisor on KVM, `sandboxed` = gVisor, `standard` = runc). When omitted, the recommended (strongest ready) level of the workspace host is used. An unavailable level is rejected with 409, never replaced by another level. capabilityRevision: type: string maxLength: 128 description: | Isolation capability revision the selection was made against (`ClientIsolationSummaryDto.revision`). Rejected with 409 when the host's capabilities changed in the meantime. UpdateAgentDto: type: object properties: name: type: string description: type: string AgentModelsResponseDto: type: object additionalProperties: type: string description: Model catalog for an agent; keys are model identifiers, values are display names AgentResponseDto: type: object required: [id, name, createdAt, updatedAt, chats, primaryChatId] properties: id: type: string format: uuid name: type: string description: type: string handoffProfile: type: string description: Responsibilities / what other agents of the workspace can hand over (agent handoffs) agentType: type: string description: Agent provider type identifier capabilities: $ref: '#/components/schemas/AgentTypeCapabilities' git: type: [object, 'null'] properties: repositoryUrl: type: string description: Git repository URL associated with the agent (clone mode only) setupMode: type: string enum: [clone, empty] description: How the workspace repository was initialized description: Git information when the agent has an associated repository or empty local repo chats: type: array description: User-visible chat sessions for this environment items: $ref: '#/components/schemas/AgentChatSessionSummaryDto' primaryChatId: type: string format: uuid description: Id of the primary chat session for this environment isolation: $ref: '#/components/schemas/AgentIsolationDto' description: Container isolation level of this environment (runtime and selection record) createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateAgentResponseDto: allOf: - $ref: '#/components/schemas/AgentResponseDto' - type: object required: [password] properties: password: type: string AgentTypeInfo: type: object required: [type, displayName, capabilities] properties: type: type: string description: The unique type identifier (e.g., 'opencode') displayName: type: string description: Human-readable display name (e.g., 'OpenCode') capabilities: $ref: '#/components/schemas/AgentTypeCapabilities' AgentTypeCapabilities: type: object required: [supportsChat, supportsStreaming, supportsToolEvents, supportsQuestions] properties: transport: type: string enum: [opencode-http, http] description: Wire transport for agent messaging (OpenCode HTTP server API + SSE events) supportsChat: type: boolean supportsStreaming: type: boolean supportsToolEvents: type: boolean supportsQuestions: type: boolean ConfigResponseDto: type: object required: [agentTypes] properties: gitRepositoryUrl: type: [string, 'null'] description: Git repository URL used for cloning repositories when creating agents gitRepositorySetupMode: type: string enum: [clone, empty] description: Default setup mode for new agents on this instance agentTypes: type: array items: $ref: '#/components/schemas/AgentTypeInfo' description: Array of available agent provider types with display names isolation: $ref: '#/components/schemas/HostIsolationCapabilitiesDto' description: Container isolation levels the agent-manager host can run (absent for agent managers without isolation support) IsolationLevel: type: string enum: [standard, sandboxed, sandboxed-kvm, microvm] description: | Container isolation level. `standard` runs the worker on Docker's default runtime (runc, shares the host kernel); `sandboxed` runs it on gVisor (`runsc`, systrap platform); `sandboxed-kvm` runs it on gVisor's KVM platform (`runsc --platform=kvm`, hardware virtualization, needs `/dev/kvm` on the host); `microvm` runs it as a KVM microVM with its own guest kernel (libvirt/QEMU inside a hardened runc launcher container of the microVM worker image, needs `/dev/kvm`). IsolationRuntimeState: type: string enum: [ ready, unsupported, installation-failed, probe-failed, disabled-by-admin, ] description: Runtime state of an isolation level on a host (derived from real probes, never from configuration alone) IsolationRuntimeFailureDto: type: object required: [statusCode, message] properties: statusCode: type: integer example: 400 error: type: string example: Bad Request message: type: string description: "Failure message, e.g. 'The microvm (KVM microVM) container could not be started: ...'" code: type: string enum: [E_ISOLATION_RUNTIME_FAILED] description: Present when a gVisor or microVM environment container could not be started (never retried on another runtime) isolationLevel: $ref: '#/components/schemas/IsolationLevel' IsolationLevelCapabilityDto: type: object required: [rank, runtime, state] properties: rank: type: integer description: Strength rank (`1` = standard, `2` = sandboxed, `3` = sandboxed-kvm, `4` = microvm); higher is stronger runtime: type: string description: Docker runtime name used for this level (`runc`, `runsc-systrap`, `runsc-kvm`; `runc` for the microVM launcher) state: $ref: '#/components/schemas/IsolationRuntimeState' reasonCode: type: string description: | Stable machine-readable reason when the level is not `ready`, e.g. `E_RUNTIME_NOT_REGISTERED`, `E_DOCKER_BASELINE_UNAVAILABLE`, `E_RUNC_PROBE_FAILED`, `E_PROBE_PENDING`, `E_PROBE_IMAGE_UNAVAILABLE`, `E_PROBE_START_FAILED`, `E_PROBE_EXEC_FAILED`, `E_PROBE_FILESYSTEM_FAILED`, `E_PROBE_LOGS_FAILED`, `E_PROBE_RUNTIME_MISMATCH`, `E_PROBE_TIMEOUT`, `E_SHARED_NETNS_FAILED`, `E_REPEATED_RUNTIME_FAILURES`, `E_DISABLED_BY_ADMIN`, `E_SHARED_NETNS_RUNTIME_NOT_REGISTERED`, `E_KVM_UNAVAILABLE` (the KVM platform or the microVM launcher cannot open `/dev/kvm`), `E_RUNTIME_MISCONFIGURED` (runtime registered with another gVisor platform / network mode), `E_MICROVM_IMAGE_UNSUPPORTED` (microVM image without this manager's bridge protocol), `E_MICROVM_BOOT_FAILED` (probe microVM did not boot or failed the worker contract); `E_MANAGER_UNSUPPORTED` (controller only) for agent managers without isolation support or without the level (older releases) reason: type: string description: Short operator-facing explanation (never contains secrets or workspace content) HostIsolationCapabilitiesDto: type: object required: [revision, probedAt, probing, levels, recommendedLevel, availableLevels] description: Isolation capability record reported by an agent manager (`GET /api/isolation` on the manager) properties: revision: type: string description: Content hash (`sha256:...`) of the probed host state; changes whenever capabilities change probedAt: type: [string, 'null'] format: date-time description: Time of the last completed probe (`null` before the first probe finished) probing: type: boolean description: True while a probe is running (states reflect the previous probe) levels: type: object required: [standard, sandboxed, sandboxed-kvm, microvm] properties: standard: $ref: '#/components/schemas/IsolationLevelCapabilityDto' sandboxed: $ref: '#/components/schemas/IsolationLevelCapabilityDto' sandboxed-kvm: $ref: '#/components/schemas/IsolationLevelCapabilityDto' microvm: $ref: '#/components/schemas/IsolationLevelCapabilityDto' recommendedLevel: oneOf: - $ref: '#/components/schemas/IsolationLevel' - type: 'null' description: Strongest ready level, or `null` when the host cannot run environments (standard baseline not ready) availableLevels: type: array items: $ref: '#/components/schemas/IsolationLevel' description: Ready levels, strongest first (empty when the standard baseline is not ready) ClientIsolationSummaryDto: type: object required: [ supported, recommendedLevel, availableLevels, levels, revision, probedAt, probing, stale, ] description: Container isolation summary of a workspace host properties: supported: type: boolean description: | False when the agent manager predates isolation levels (it runs every environment with the standard Docker runtime and accepts no isolation selection) recommendedLevel: oneOf: - $ref: '#/components/schemas/IsolationLevel' - type: 'null' description: Strongest ready level (preselected for new environments); `null` when the host cannot run environments availableLevels: type: array items: $ref: '#/components/schemas/IsolationLevel' description: Ready levels, strongest first levels: type: object required: [standard, sandboxed, sandboxed-kvm, microvm] properties: standard: $ref: '#/components/schemas/IsolationLevelCapabilityDto' sandboxed: $ref: '#/components/schemas/IsolationLevelCapabilityDto' sandboxed-kvm: $ref: '#/components/schemas/IsolationLevelCapabilityDto' microvm: $ref: '#/components/schemas/IsolationLevelCapabilityDto' revision: type: [string, 'null'] description: Capability revision to submit as `capabilityRevision` with environment creation (`null` for legacy agent managers) probedAt: type: [string, 'null'] format: date-time probing: type: boolean stale: type: boolean description: True when served from the last stored snapshot because the agent manager was unreachable AgentIsolationSelectionDto: type: object required: [effectiveSelection, selectionSource, selectedAt] description: How the isolation level of an environment was selected (audit record) properties: automaticSelection: oneOf: - $ref: '#/components/schemas/IsolationLevel' - type: 'null' description: Level that was automatically recommended when the environment was created effectiveSelection: $ref: '#/components/schemas/IsolationLevel' selectionSource: type: string enum: [automatic, user-confirmed, user-override] description: | `automatic` (no explicit level), `user-confirmed` (explicit level at least as strong as the recommendation), `user-override` (explicit weaker level than recommended) selectedBy: type: [string, 'null'] description: User id that made the selection (when known) selectedAt: type: string format: date-time capabilityRevision: type: [string, 'null'] description: Host capability revision the selection was validated against AgentIsolationDto: type: object required: [level, runtime] description: Effective container isolation of an environment properties: level: $ref: '#/components/schemas/IsolationLevel' runtime: type: string description: Docker runtime the environment's worker container runs on (`runsc-systrap-hostnet` / `runsc-kvm-hostnet` for gVisor workers behind an egress guard or on the agent network) selection: oneOf: - $ref: '#/components/schemas/AgentIsolationSelectionDto' - type: 'null' description: Selection record (`null` for environments created before isolation levels existed) AgentFileType: type: string enum: [text, binary, pdf, image, video, audio] description: Server-authoritative file classification for editor/preview behavior FileNodeDto: type: object required: [name, type, path] properties: name: type: string description: File or directory name type: type: string enum: [file, directory] description: Node type path: type: string description: Relative path from /app size: type: [integer, 'null'] description: File size in bytes (only for files) modifiedAt: type: [string, 'null'] format: date-time description: Last modification timestamp CreateFileDto: type: object required: [type] properties: type: type: string enum: [file, directory] description: Type of node to create (empty file or directory; write content via PUT) MoveFileDto: type: object required: [destination] properties: destination: type: string description: Destination path relative to /app (supports nested paths) GitStatusDto: type: object required: [ currentBranch, isClean, hasUnpushedCommits, aheadCount, behindCount, files, ] properties: currentBranch: type: string description: Current branch name isClean: type: boolean description: Whether the working tree is clean (no changes) hasUnpushedCommits: type: boolean description: Whether there are unpushed commits (ahead of remote) aheadCount: type: integer description: Number of commits ahead of remote behindCount: type: integer description: Number of commits behind remote files: type: array items: $ref: '#/components/schemas/GitFileStatusDto' description: List of files with their git status GitFileStatusDto: type: object required: [path, status, type] properties: path: type: string description: File path relative to repository root status: type: string description: Git status code (e.g., 'M', 'A', 'D', '??', 'MM', etc.) type: type: string enum: [staged, unstaged, untracked, both] description: Status type isBinary: type: boolean description: Whether this is a binary file size: type: integer description: File size in bytes (for binary files) GitBranchDto: type: object required: [name, ref, isCurrent, isRemote, commit, message] properties: name: type: string description: Branch name (without refs/heads/ prefix) ref: type: string description: Full branch reference (e.g., 'refs/heads/main') isCurrent: type: boolean description: Whether this is the current branch isRemote: type: boolean description: Whether this is a remote branch remote: type: string description: Remote name (if remote branch) commit: type: string description: Commit hash (short) message: type: string description: Commit message (first line) aheadCount: type: integer description: Number of commits ahead of remote (for local branches) behindCount: type: integer description: Number of commits behind remote (for local branches) GitDiffDto: type: object required: [path, originalContent, modifiedContent, encoding, isBinary] properties: path: type: string description: File path relative to repository root originalContent: type: string description: Original file content (base64-encoded for text, empty for binary) modifiedContent: type: string description: Modified file content (base64-encoded for text, empty for binary) encoding: type: string enum: [utf-8, base64] description: Encoding indicator isBinary: type: boolean description: Whether this is a binary file originalSize: type: integer description: Original file size in bytes (for binary files) modifiedSize: type: integer description: Modified file size in bytes (for binary files) StageFilesDto: type: object required: [files] properties: files: type: array items: type: string description: Array of file paths to stage (empty array stages all) UnstageFilesDto: type: object required: [files] properties: files: type: array items: type: string description: Array of file paths to unstage (empty array unstages all) CommitDto: type: object required: [message] properties: message: type: string description: Commit message PushOptionsDto: type: object properties: force: type: boolean description: > When true, performs a `git push --force-with-lease`. Defaults to false. CreateBranchDto: type: object required: [name] properties: name: type: string description: Branch name (will be prefixed with conventional commit prefix if useConventionalPrefix is true) useConventionalPrefix: type: boolean description: Whether to use conventional commit prefix (feat/, fix/, chore/, etc.) conventionalType: type: string enum: [feat, fix, chore, docs, style, refactor, test, perf] description: Conventional commit type (only used if useConventionalPrefix is true) baseBranch: type: string description: Base branch to create from (defaults to current branch) RebaseDto: type: object required: [branch] properties: branch: type: string description: Branch name to rebase onto ResolveConflictDto: type: object required: [path, strategy] properties: path: type: string description: File path with conflict (relative to repository root) strategy: type: string enum: [yours, mine, both] description: Merge strategy - 'yours' (accept incoming), 'mine' (accept current), 'both' (keep both) ProvisioningProviderInfo: type: object required: [type, displayName] properties: type: type: string enum: [hetzner, digital-ocean] description: The unique provider type identifier (e.g., 'hetzner', 'digital-ocean') displayName: type: string description: Human-readable display name (e.g., 'Hetzner Cloud', 'DigitalOcean') ProviderLocation: type: object required: [id, name] properties: id: type: string description: Technical slug used for provisioning (e.g. fsn1, fra1) name: type: string description: Human-readable display name from provider API or static fallback city: type: string description: City when provided by the provider API (Hetzner) country: type: string description: ISO country code when provided by the provider API ServerType: type: object required: [id, name, cores, memory, disk] properties: id: type: string description: Unique identifier for the server type (e.g., 'cx11', 'cpx11') name: type: string description: Human-readable name (e.g., 'CX11', 'CPX11') cores: type: integer description: Number of CPU cores memory: type: number description: Amount of RAM in GB disk: type: integer description: Disk size in GB priceMonthly: type: number description: Price per month in EUR (or provider's currency) priceHourly: type: number description: Price per hour in EUR (or provider's currency) description: type: string description: Additional description or notes ProvisionServerDto: type: object required: [providerType, serverType, name, authenticationType] properties: providerType: type: string enum: [hetzner, digital-ocean] description: The provisioning provider type (e.g., 'hetzner', 'digital-ocean') serverType: type: string description: Server type identifier (e.g., 'cx11', 'cpx11' for Hetzner; 's-1vcpu-1gb', 's-2vcpu-2gb' for DigitalOcean) name: type: string description: Server name/label description: type: string description: Optional description location: type: string description: Location/datacenter identifier (e.g., 'nbg1', 'fsn1' for Hetzner; 'fra1', 'nyc3' for DigitalOcean) authenticationType: $ref: '#/components/schemas/AuthenticationType' apiKey: type: string description: API key (optional, will be auto-generated if not provided for API_KEY type) oidcClientId: type: string description: OIDC client ID (required for oidc authentication type) oidcClientSecret: type: string writeOnly: true description: OIDC client secret (required for oidc authentication type; never returned) oidcIssuer: type: string format: uri description: OIDC issuer (optional, defaults to the controller's OIDC_ISSUER; other issuers must pass the client endpoint SSRF policy) oidcScope: type: string description: Optional space separated scopes for the client credentials grant gitRepositorySetupMode: type: string enum: [clone, empty] description: | Default Git workspace setup for agents on the provisioned instance. `empty` runs `git init` without a remote; omit git URL and credentials when using empty mode. gitRepositoryUrl: type: string description: Optional Git repository URL for agent workspace (clone mode) gitUsername: type: string gitToken: type: string gitPassword: type: string gitPrivateKey: type: string agentDefaultImage: type: string autoEnrichEnabledGlobal: type: string enum: ['true', 'false'] description: > Sets AUTO_ENRICH_ENABLED_GLOBAL on the provisioned agent-manager (`false` disables prompt auto-enrichment for that workspace unless a chat turn explicitly enables it). autoEnrichVectorMaxCosineDistance: type: number minimum: 0 maximum: 2 description: > Sets AUTO_ENRICH_VECTOR_MAX_COSINE_DISTANCE on the provisioned agent-manager (pgvector cosine distance `<=>`; only knowledge chunks with distance <= this value qualify for vector auto-enrichment; default on controller is 1). ProvisionedServerResponseDto: allOf: - $ref: '#/components/schemas/ClientResponseDto' - type: object required: [providerType, serverId, serverName, publicIp, serverStatus] properties: providerType: type: string enum: [hetzner, digital-ocean] description: Provider type used for provisioning (e.g., 'hetzner', 'digital-ocean') serverId: type: string description: Provider-specific server ID serverName: type: string description: Server name publicIp: type: string description: Public IP address of the server privateIp: type: string description: Private IP address of the server (if applicable) serverStatus: type: string description: Server status (e.g., 'running', 'starting') ServerInfo: type: object required: [serverId, providerType] properties: serverId: type: string description: Provider-specific server ID serverName: type: string description: Server name publicIp: type: string description: Public IP address of the server privateIp: type: string description: Private IP address of the server (if applicable) serverStatus: type: string description: Server status (e.g., 'running', 'starting') providerType: type: string enum: [hetzner, digital-ocean] description: Provider type used for provisioning (e.g., 'hetzner', 'digital-ocean') CreateEnvironmentVariableDto: type: object required: [variable, content] properties: variable: type: string description: Environment variable name content: type: string description: Environment variable content UpdateEnvironmentVariableDto: type: object required: [variable, content] properties: variable: type: string description: Environment variable name content: type: string description: Environment variable content EnvironmentProgressDto: type: object required: [ operationId, agentId, agentName, operation, status, step, stepIndex, stepCount, progress, startedAt, updatedAt, ] properties: operationId: type: string format: uuid description: Unique id of the provisioning operation agentId: type: [string, 'null'] format: uuid description: Agent UUID; null while a newly created environment is not persisted yet agentName: type: string operation: type: string enum: [create, update] description: create = new environment; update = container recreation (environment variables, workspace overrides, config sync) status: type: string enum: [running, completed, failed] description: Terminal statuses (completed/failed) are emitted once and then dropped from the active list step: type: string enum: [ queued, preparing, pullingImage, creatingContainer, preparingRepository, persisting, waitingForHealthy, summarizingContext, recreatingContainer, restartingContainer, restoringGitCredentials, finalizing, ] stepIndex: type: integer minimum: 0 description: Zero-based index of the current step in the operation plan stepCount: type: integer minimum: 1 progress: type: integer minimum: 0 maximum: 100 description: Weighted overall percentage (monotonic; 100 only on completion). Image pull reports real layer byte progress. error: type: string description: Failure reason when status is failed startedAt: type: string format: date-time updatedAt: type: string format: date-time EnvironmentVariableResponseDto: type: object required: [id, agentId, variable, content, createdAt, updatedAt] properties: id: type: string format: uuid agentId: type: string format: uuid variable: type: string content: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateChatSessionDto: type: object properties: title: type: string maxLength: 255 description: Optional title for the new chat session (handoff chats are opened by the platform only) UpdateChatSessionDto: type: object required: [title] properties: title: type: string maxLength: 255 description: New title for the chat session ChatSessionResponseDto: type: object required: [id, agentId, kind, createdAt, updatedAt] properties: id: type: string format: uuid agentId: type: string format: uuid title: type: string kind: type: string enum: [primary, user, handoff] lastMessageAt: type: string format: date-time createdAt: type: string format: date-time updatedAt: type: string format: date-time AgentChatSessionSummaryDto: type: object required: [id, kind, createdAt] properties: id: type: string format: uuid title: type: string kind: type: string enum: [primary, user, handoff] lastMessageAt: type: string format: date-time createdAt: type: string format: date-time ChatSessionMessageResponseDto: type: object required: [id, actor, message, filtered, createdAt, updatedAt] properties: id: type: string format: uuid actor: type: string message: type: string filtered: type: boolean createdAt: type: string format: date-time updatedAt: type: string format: date-time WorkspaceConfigurationSettingKey: type: string enum: [ gitRepositoryUrl, gitUsername, gitToken, gitPassword, gitPrivateKey, agentDefaultImage, autoEnrichEnabledGlobal, autoEnrichVectorMaxCosineDistance, ] UpsertWorkspaceConfigurationOverrideDto: type: object required: [value] properties: value: type: string description: Override value WorkspaceConfigurationSettingResponseDto: type: object required: [settingKey, envVarName, source, hasOverride] properties: settingKey: $ref: '#/components/schemas/WorkspaceConfigurationSettingKey' envVarName: type: string value: type: string source: type: string enum: [override, default_env, unset] hasOverride: type: boolean AddClientUserDto: type: object required: [email, role] properties: email: type: string format: email description: Email address of the user to add role: type: string enum: [admin, user] description: Role for the user in this client (admin or user) ClientUserResponseDto: type: object required: [id, userId, clientId, role, createdAt, updatedAt] properties: id: type: string format: uuid description: The UUID of the client_users relationship userId: type: string format: uuid description: The UUID of the user clientId: type: string format: uuid description: The UUID of the client role: type: string enum: [admin, user] description: Role for the user in this client userEmail: type: string format: email description: Email address of the user createdAt: type: string format: date-time updatedAt: type: string format: date-time AdminOverviewWorkspaceMetrics: type: object description: Chat activity and runs of the period, tickets and knowledge pages as of now required: [ activeAgentCount, activeUserCount, totalMessages, totalTokens, totalCostUsd, openTicketCount, inProgressTicketCount, knowledgePageCount, deploymentRunCount, failedDeploymentRunCount, automationRunCount, failedAutomationRunCount, activeAutomationRunCount, taskRunCount, failedTaskRunCount, ] properties: activeAgentCount: type: integer activeUserCount: type: integer totalMessages: type: integer totalTokens: type: integer totalCostUsd: type: number openTicketCount: type: integer inProgressTicketCount: type: integer knowledgePageCount: type: integer deploymentRunCount: type: integer failedDeploymentRunCount: type: integer automationRunCount: type: integer failedAutomationRunCount: type: integer activeAutomationRunCount: type: integer taskRunCount: type: integer failedTaskRunCount: type: integer AdminOverviewMetrics: allOf: - $ref: '#/components/schemas/AdminOverviewWorkspaceMetrics' - type: object description: Sums over the workspaces in scope (activeUserCount is distinct across workspaces) plus audit security totals required: [ workspaceCount, filterDropCount, filterFlagCount, egressBlockedCount, egressObservedCount, ] properties: workspaceCount: type: integer filterDropCount: type: integer filterFlagCount: type: integer egressBlockedCount: type: integer egressObservedCount: type: integer AdminOverviewResponse: type: object required: [ scope, clientId, from, to, groupBy, metrics, series, securitySeries, workspaces, ] properties: scope: type: string enum: [all, workspace] clientId: type: string format: uuid nullable: true from: type: string format: date to: type: string format: date groupBy: type: string enum: [day, hour] metrics: $ref: '#/components/schemas/AdminOverviewMetrics' series: type: array description: Messages per period (sparse, as in StatisticsSummaryDto) items: type: object properties: period: type: string format: date-time count: type: integer wordCount: type: integer charCount: type: integer securitySeries: type: array description: Security events per period (sparse, as in StatisticsSummaryDto) items: type: object properties: period: type: string format: date-time filterDrops: type: integer filterFlags: type: integer egressAllowed: type: integer egressBlocked: type: integer egressObserved: type: integer workspaces: type: array description: One entry per workspace in scope, most messages first items: type: object required: [clientId, name, metrics] properties: clientId: type: string format: uuid name: type: string metrics: $ref: '#/components/schemas/AdminOverviewWorkspaceMetrics' StatisticsSummaryDto: type: object required: [ totalMessages, totalWords, totalChars, avgWordsPerMessage, autoEnrichmentRuns, autoEnrichmentContexts, autoEnrichmentChars, filterDropCount, filterTypesBreakdown, egressAllowedCount, egressBlockedCount, egressObservedCount, egressGuardErrorCount, egressBreakdown, egressTopBlockedHosts, egressRulesBreakdown, ] properties: totalMessages: type: integer totalWords: type: integer totalChars: type: integer avgWordsPerMessage: type: number totalInputTokens: type: integer totalOutputTokens: type: integer totalTokens: type: integer totalCostUsd: type: number autoEnrichmentRuns: type: integer description: Number of turns where auto-enrichment injected at least one context section autoEnrichmentContexts: type: integer description: Total number of auto-injected context sections autoEnrichmentChars: type: integer description: Total character volume of auto-injected context sections filterDropCount: type: integer filterTypesBreakdown: type: array items: type: object required: [filterType, direction, count] properties: filterType: type: string filterDisplayName: type: string nullable: true description: Human-readable name of the filter rule (as on the filter rows), null for legacy rows direction: type: string enum: [incoming, outgoing] count: type: integer filterFlagCount: type: integer description: Count of messages flagged/modified (excluding dropped) filterFlagsBreakdown: type: array items: type: object required: [filterType, direction, count] properties: filterType: type: string filterDisplayName: type: string nullable: true description: Human-readable name of the filter rule (as on the filter rows), null for legacy rows direction: type: string enum: [incoming, outgoing] count: type: integer series: type: array items: type: object properties: period: type: string format: date-time count: type: integer wordCount: type: integer charCount: type: integer egressAllowedCount: type: integer description: Egress guard decisions (sum of aggregated counts) with decision allowed egressBlockedCount: type: integer egressObservedCount: type: integer egressGuardErrorCount: type: integer egressBreakdown: type: array description: Decisions by kind and decision items: type: object required: [kind, decision, count] properties: kind: type: string enum: [web, dns, network, guard] decision: type: string enum: [allowed, blocked, observed, error] count: type: integer egressTopBlockedHosts: type: array description: Most frequently blocked / observed destinations (top 10) items: type: object required: [host, count] properties: host: type: string count: type: integer egressRulesBreakdown: type: array description: Blocked / observed decisions by guard rule items: type: object required: [rule, count] properties: rule: type: string count: type: integer securitySeries: type: array description: Security events over time (only with groupBy); message filter drops / flags and egress decisions items: type: object required: [ period, filterDrops, filterFlags, egressAllowed, egressBlocked, egressObserved, ] properties: period: type: string format: date-time filterDrops: type: integer filterFlags: type: integer egressAllowed: type: integer egressBlocked: type: integer egressObserved: type: integer StatisticsChatIoDto: type: object required: [ id, clientId, direction, interactionKind, wordCount, charCount, occurredAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid clientName: type: string description: Client name for display; link to chat when agentId present agentName: type: string description: Agent name for display; link to chat when agentId present originalUserId: type: string format: uuid description: Original user ID from identity system; use to resolve user email direction: type: string enum: [input, output] interactionKind: type: string enum: [ chat, prompt_enhancement, ticket_body_generation, auto_context_enrichment, autonomous_ticket_run, autonomous_ticket_run_turn, autonomous_ticket_commit_message, chat_plan_turn, chat_plan_execute, agent_task_run, ] description: Normal chat vs prompt enhancement (magic wand) metrics wordCount: type: integer charCount: type: integer occurredAt: type: string format: date-time StatisticsChatIoListDto: type: object required: [data, total, limit, offset] properties: data: type: array items: $ref: '#/components/schemas/StatisticsChatIoDto' total: type: integer limit: type: integer offset: type: integer StatisticsEgressEventDto: type: object required: [ id, clientId, kind, decision, count, bytesIn, bytesOut, firstSeenAt, occurredAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid clientName: type: string agentName: type: string kind: type: string enum: [web, dns, network, guard] decision: type: string enum: [allowed, blocked, observed, error] host: type: string nullable: true rule: type: string nullable: true description: Guard rule (deny_host, not_allowlisted, private_network, ip_literal, deny_url, offline, quic, ...) matchedEntry: type: string nullable: true matchedSource: type: string nullable: true enum: [global, workspace, environment, null] description: Layer that contributed the matched entry method: type: string nullable: true httpStatus: type: integer nullable: true sampleUrl: type: string nullable: true count: type: integer description: Number of identical decisions aggregated within one collection cycle bytesIn: type: integer bytesOut: type: integer mode: type: string nullable: true policyRevision: type: string nullable: true message: type: string nullable: true firstSeenAt: type: string format: date-time occurredAt: type: string format: date-time StatisticsEgressEventListDto: type: object required: [data, total, limit, offset] properties: data: type: array items: $ref: '#/components/schemas/StatisticsEgressEventDto' total: type: integer limit: type: integer offset: type: integer StatisticsFilterDropDto: type: object required: [ id, clientId, filterType, filterDisplayName, direction, wordCount, charCount, occurredAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid clientName: type: string description: Client name for display; link to chat when agentId present agentName: type: string description: Agent name for display; link to chat when agentId present originalUserId: type: string format: uuid description: Original user ID from identity system; use to resolve user email filterType: type: string filterDisplayName: type: string filterReason: type: string direction: type: string enum: [incoming, outgoing] wordCount: type: integer charCount: type: integer occurredAt: type: string format: date-time StatisticsFilterDropListDto: type: object required: [data, total, limit, offset] properties: data: type: array items: $ref: '#/components/schemas/StatisticsFilterDropDto' total: type: integer limit: type: integer offset: type: integer StatisticsFilterFlagDto: type: object required: [ id, clientId, filterType, filterDisplayName, direction, wordCount, charCount, occurredAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid clientName: type: string description: Client name for display; link to chat when agentId present agentName: type: string description: Agent name for display; link to chat when agentId present originalUserId: type: string format: uuid description: Original user ID from identity system; use to resolve user email filterType: type: string filterDisplayName: type: string filterReason: type: string direction: type: string enum: [incoming, outgoing] wordCount: type: integer charCount: type: integer occurredAt: type: string format: date-time StatisticsFilterFlagListDto: type: object required: [data, total, limit, offset] properties: data: type: array items: $ref: '#/components/schemas/StatisticsFilterFlagDto' total: type: integer limit: type: integer offset: type: integer StatisticsEntityEventDto: type: object required: [id, entityType, eventType, originalEntityId, occurredAt] properties: id: type: string format: uuid entityType: type: string enum: [ user, client, agent, client_user, provisioning_reference, deployment_workflow, deployment_run, ] eventType: type: string enum: [created, updated, deleted] originalEntityId: type: string format: uuid originalUserId: type: string format: uuid description: Original user ID of the actor who performed the event clientId: type: string format: uuid description: Client ID for agent events; link to chat when agentId present agentId: type: string format: uuid description: Agent ID for agent events; link to chat when present clientName: type: string description: Client name for agent events; display "client --> agent" agentName: type: string description: Agent name for agent events; display "client --> agent" occurredAt: type: string format: date-time StatisticsEntityEventListDto: type: object required: [data, total, limit, offset] properties: data: type: array items: $ref: '#/components/schemas/StatisticsEntityEventDto' total: type: integer limit: type: integer offset: type: integer TicketPriority: type: string enum: [low, medium, high, critical] TicketStatus: type: string enum: [draft, todo, in_progress, prototype, done, closed] TicketActorType: type: string enum: [human, ai, system] TicketActionType: type: string description: Ticket activity row discriminator; stored as varchar(64) in the database. enum: - CREATED - FIELD_UPDATED - STATUS_CHANGED - PRIORITY_CHANGED - WORKSPACE_MOVED - PARENT_CHANGED - DELETED - COMMENT_ADDED - CONTENT_APPLIED_FROM_AI - BODY_GENERATION_STARTED - PROTOTYPE_PROMPT_GENERATED - AUTOMATION_CLAIMED - AUTOMATION_STARTED - AUTOMATION_SUCCEEDED - AUTOMATION_FAILED - AUTOMATION_TIMED_OUT - AUTOMATION_ESCALATED - AUTOMATION_REQUEUED - AUTOMATION_APPROVAL_INVALIDATED - AUTOMATION_CANCELLED - AUTOMATION_APPROVED - AUTOMATION_UNAPPROVED - AUTOMATION_ELIGIBILITY_CHANGED - AUTOMATION_APPROVAL_REQUIREMENT_CHANGED - AUTOMATION_SETTINGS_UPDATED TicketMarkdownCheckboxTaskCountsDto: type: object required: [open, done] properties: open: type: integer minimum: 0 description: Count of `[ ]` style open task checkboxes in the described scope. done: type: integer minimum: 0 description: Count of `[x]` or `[X]` done checkboxes in the described scope. TicketTasksDto: type: object required: [open, done, children] properties: open: type: integer minimum: 0 description: Open checkboxes in this ticket's `content`. done: type: integer minimum: 0 description: Done checkboxes in this ticket's `content`. children: description: | Sums of open/done checkboxes on all descendant tickets (direct and nested), excluding this ticket's body. $ref: '#/components/schemas/TicketMarkdownCheckboxTaskCountsDto' AttachmentResponseDto: type: object required: [ id, clientId, ownerType, ownerId, fileName, contentType, byteSize, contentSha256, downloadUrl, createdAt, ] properties: id: { type: string, format: uuid } clientId: { type: string, format: uuid } ownerType: { type: string, enum: [ticket, knowledge_page, chat] } ownerId: { type: string, format: uuid } fileName: { type: string } contentType: { type: string } byteSize: { type: integer } contentSha256: { type: string } downloadUrl: { type: string } agentPath: type: string nullable: true description: Read-only absolute path inside agent containers when mirrored into chat context. createdByUserId: { type: string, format: uuid, nullable: true } createdAt: { type: string, format: date-time } TicketShasDto: type: object required: [short, long] properties: short: type: string description: Stable short ticket reference derived from ticket id hash. long: type: string description: Stable full ticket reference derived from ticket id hash. TicketResponseDto: type: object required: [ id, shas, clientId, title, priority, status, automationEligible, createdAt, updatedAt, tasks, ] properties: id: type: string format: uuid shas: $ref: '#/components/schemas/TicketShasDto' clientId: type: string format: uuid parentId: type: string format: uuid title: type: string content: type: string priority: $ref: '#/components/schemas/TicketPriority' status: $ref: '#/components/schemas/TicketStatus' createdByUserId: type: string format: uuid createdByEmail: type: string preferredChatAgentId: type: string format: uuid description: Preferred workspace agent for chat/AI when viewing this ticket (agent-manager agent id). preferredChatModel: type: string maxLength: 256 nullable: true description: Preferred OpenCode provider/model for chat/AI on this ticket (e.g. anthropic/claude-sonnet-4). automationEligible: type: boolean description: Whether autonomous prototyping is enabled for this ticket (ticket_automation.eligible). createdAt: type: string format: date-time updatedAt: type: string format: date-time tasks: $ref: '#/components/schemas/TicketTasksDto' attachments: type: array items: $ref: '#/components/schemas/AttachmentResponseDto' children: type: array items: $ref: '#/components/schemas/TicketResponseDto' CreateTicketDto: type: object required: [title] properties: clientId: type: string format: uuid parentId: type: string format: uuid title: type: string content: type: string priority: $ref: '#/components/schemas/TicketPriority' status: $ref: '#/components/schemas/TicketStatus' MigrateTicketDto: type: object required: [targetClientId] properties: targetClientId: type: string format: uuid description: Destination workspace (client) id MigrateTicketResponseDto: type: object required: [ticket] properties: ticket: $ref: '#/components/schemas/TicketResponseDto' description: Root ticket after migration, including nested `children` when present UpdateTicketDto: type: object properties: clientId: type: string format: uuid parentId: type: string format: uuid title: type: string content: type: string priority: $ref: '#/components/schemas/TicketPriority' status: $ref: '#/components/schemas/TicketStatus' preferredChatAgentId: type: string format: uuid description: Persist preferred workspace agent for chat/AI; send null to clear. preferredChatModel: type: string maxLength: 256 nullable: true description: Persist preferred OpenCode provider/model for chat/AI; send null to clear. TicketCommentResponseDto: type: object required: [id, ticketId, body, createdAt] properties: id: type: string format: uuid ticketId: type: string format: uuid authorUserId: type: string format: uuid authorEmail: type: string body: type: string createdAt: type: string format: date-time CreateTicketCommentDto: type: object required: [body] properties: body: type: string TicketActivityResponseDto: type: object required: [id, ticketId, occurredAt, actorType, actionType, payload] properties: id: type: string format: uuid ticketId: type: string format: uuid occurredAt: type: string format: date-time actorType: $ref: '#/components/schemas/TicketActorType' actorUserId: type: string format: uuid actorEmail: type: string actionType: $ref: '#/components/schemas/TicketActionType' payload: type: object additionalProperties: true description: > Shape depends on actionType (e.g. automation eligibility changes include { eligible: boolean }; AUTOMATION_SETTINGS_UPDATED includes { fields: string[] }; AUTOMATION_APPROVAL_INVALIDATED may include { reason: string, fields: string[] }). VerifierCommandEntryDto: type: object required: [cmd] properties: cmd: type: string maxLength: 2048 cwd: type: string maxLength: 2048 TicketVerifierProfileDto: type: object required: [commands] properties: commands: type: array maxItems: 32 items: $ref: '#/components/schemas/VerifierCommandEntryDto' UpdateTicketAutomationDto: type: object properties: eligible: type: boolean allowedAgentIds: type: array items: type: string format: uuid preferredModel: type: string maxLength: 256 nullable: true description: OpenCode provider/model for autonomous turns; required when eligible is true. includeWorkspaceContext: type: boolean contextEnvironmentIds: type: array items: type: string format: uuid autoEnrichmentEnabled: type: boolean allowedDeploymentOperations: type: array maxItems: 2 items: type: string enum: [deployment.trigger, deployment.cancel] description: >- Deployment run actions autonomous runs may request (`agenstra_deployments_trigger` / `_cancel_run`; empty: none). Approval-relevant like the other settings; the workflow rules apply on top. verifierProfile: $ref: '#/components/schemas/TicketVerifierProfileDto' requiresApproval: type: boolean defaultBranchOverride: type: string maxLength: 256 automationBranchStrategy: type: string enum: [reuse_per_ticket, new_per_run] description: > `reuse_per_ticket` (default): reuse `automation/ticket-{ticketId}` when it exists. `new_per_run`: create a fresh `automation/{runIdPrefix}` branch for every run (legacy behaviour). forceNewAutomationBranchNextRun: type: boolean description: > When true with `reuse_per_ticket`, the next automation run uses an ephemeral branch; cleared when that run starts branch setup. Lets operators force a clean branch without switching strategy permanently. TicketAutomationResponseDto: type: object required: - ticketId - eligible - allowedAgentIds - preferredModel - includeWorkspaceContext - contextEnvironmentIds - autoEnrichmentEnabled - verifierProfile - requiresApproval - approvedAt - approvedByUserId - approvalBaselineTicketUpdatedAt - defaultBranchOverride - automationBranchStrategy - forceNewAutomationBranchNextRun - nextRetryAt - consecutiveFailureCount - createdAt - updatedAt properties: ticketId: type: string format: uuid eligible: type: boolean allowedAgentIds: type: array items: type: string format: uuid preferredModel: type: string maxLength: 256 nullable: true description: OpenCode provider/model used for autonomous turns on this ticket. includeWorkspaceContext: type: boolean allowedDeploymentOperations: type: array items: type: string enum: [deployment.trigger, deployment.cancel] description: 'Deployment run actions autonomous runs may request (empty: none).' contextEnvironmentIds: type: array items: type: string format: uuid autoEnrichmentEnabled: type: boolean verifierProfile: oneOf: - $ref: '#/components/schemas/TicketVerifierProfileDto' - type: 'null' requiresApproval: type: boolean approvedAt: type: string format: date-time approvedByUserId: type: string format: uuid approvalBaselineTicketUpdatedAt: type: string format: date-time defaultBranchOverride: type: string automationBranchStrategy: type: string enum: [reuse_per_ticket, new_per_run] forceNewAutomationBranchNextRun: type: boolean nextRetryAt: type: string format: date-time consecutiveFailureCount: type: integer createdAt: type: string format: date-time updatedAt: type: string format: date-time TicketAutomationRunStatus: type: string enum: [pending, running, succeeded, failed, timed_out, escalated, cancelled] TicketAutomationRunPhase: type: string enum: [pre_improve, workspace_prep, agent_loop, verify, finalize] TicketAutomationCancellationReason: type: string enum: [user_request, approval_invalidated, lease_expired, system_shutdown] TicketAutomationRunStepResponseDto: type: object required: [id, stepIndex, phase, kind, payload, excerpt, createdAt] properties: id: type: string format: uuid stepIndex: type: integer phase: type: string kind: type: string payload: type: object additionalProperties: true excerpt: type: string createdAt: type: string format: date-time TicketAutomationRunResponseDto: type: object required: - id - ticketId - clientId - agentId - status - phase - ticketStatusBefore - branchName - baseBranch - baseSha - startedAt - finishedAt - updatedAt - iterationCount - completionSignalSeen - verificationPassed - failureCode - summary - cancelRequestedAt - cancelledByUserId - cancellationReason properties: id: type: string format: uuid ticketId: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid status: $ref: '#/components/schemas/TicketAutomationRunStatus' phase: $ref: '#/components/schemas/TicketAutomationRunPhase' ticketStatusBefore: type: string branchName: type: string baseBranch: type: string baseSha: type: string startedAt: type: string format: date-time finishedAt: type: string format: date-time updatedAt: type: string format: date-time iterationCount: type: integer completionSignalSeen: type: boolean verificationPassed: type: boolean failureCode: type: string description: > Present when a run ends unsuccessfully. Includes values such as verify_command_failed, commit_failed (git commit after successful verification), push_failed (git push after that commit), agent_no_completion_status, agent_no_completion_marker (legacy), marker_without_verify, agent_provider_error, vcs_dirty_workspace, and others defined by the controller. summary: type: object additionalProperties: true cancelRequestedAt: type: string format: date-time cancelledByUserId: type: string format: uuid cancellationReason: oneOf: - $ref: '#/components/schemas/TicketAutomationCancellationReason' - type: 'null' steps: type: array items: $ref: '#/components/schemas/TicketAutomationRunStepResponseDto' TicketAutomationRunChatTicketSummaryDto: type: object description: Ticket fields included in chat timeline bubbles for automation runs. required: [ id, clientId, title, priority, status, automationEligible, preferredChatAgentId, createdAt, updatedAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid title: type: string priority: $ref: '#/components/schemas/TicketPriority' status: $ref: '#/components/schemas/TicketStatus' automationEligible: type: boolean preferredChatAgentId: type: string format: uuid createdAt: type: string format: date-time updatedAt: type: string format: date-time TicketAutomationRunChatOpenActionDto: type: object required: [type, ticketId, runId, label] properties: type: type: string enum: [openTicketAutomationRun] ticketId: type: string format: uuid runId: type: string format: uuid label: type: string description: Suggested button label (UI may use i18n instead). ContextInjectionDto: type: object properties: includeWorkspace: type: boolean environmentIds: type: array items: type: string ticketShas: type: array items: type: string knowledgeShas: type: array items: type: string planShas: type: array description: Plans of the chat's environment linked as context (agent specific). items: type: string autoEnrichmentEnabled: type: boolean TicketAutomationRunChatEventDto: type: object description: > Payload for WebSocket event `ticketAutomationRunChatUpsert` on namespace **clients** (not proxied from agent-manager). `timelineAt` uses `run.startedAt` when `hydrate` is true (historic replay after login) and `run.updatedAt` when `hydrate` is false (live updates). Clients merge with chat messages by this timestamp. required: [timelineAt, hydrate, ticket, run, actions] properties: timelineAt: type: string format: date-time hydrate: type: boolean ticket: $ref: '#/components/schemas/TicketAutomationRunChatTicketSummaryDto' run: $ref: '#/components/schemas/TicketAutomationRunResponseDto' actions: type: array items: $ref: '#/components/schemas/TicketAutomationRunChatOpenActionDto' contextInjection: $ref: '#/components/schemas/ContextInjectionDto' ChatPlanResponseDto: type: object required: [ id, clientId, agentId, chatId, status, phase, sourcePrompt, resumeSessionSuffix, completionSignalSeen, startedAt, createdAt, updatedAt, ] properties: shas: type: object nullable: true description: Context reference (`plan:`; sha1 of the id). `short` = first 7 characters. properties: short: { type: string } long: { type: string } id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid chatId: type: string format: uuid status: type: string enum: [ pending, exploring, ready, refining, executing, executed, failed, cancelled, ] phase: type: string enum: [explore, draft, refine, ready] sourcePrompt: type: string planMarkdown: type: string nullable: true summary: type: string nullable: true contextInjection: allOf: - $ref: '#/components/schemas/ContextInjectionDto' nullable: true model: type: string nullable: true resumeSessionSuffix: type: string completionSignalSeen: type: boolean failureCode: type: string nullable: true failureMessage: type: string nullable: true createdByUserId: type: string format: uuid nullable: true startedAt: type: string format: date-time finishedAt: type: string format: date-time nullable: true executionStartedAt: type: string format: date-time nullable: true description: First entry into `executing`. Once set the plan is read-only for good (retries included). lastEditedAt: type: string format: date-time nullable: true description: Last content edit by a workspace user (plans page). lastEditedByUserId: type: string format: uuid nullable: true editable: type: boolean description: > True while a workspace user may edit the plan: it never entered execution and is not being drafted by the agent (status `ready`, `failed` or `cancelled`). createdAt: type: string format: date-time updatedAt: type: string format: date-time ChatPlanListResponseDto: type: object required: [items, total] properties: items: type: array items: $ref: '#/components/schemas/ChatPlanResponseDto' total: type: integer minimum: 0 description: Every plan matching the filter (all pages). UpdateChatPlanDto: type: object required: [expectedUpdatedAt] properties: planMarkdown: type: string maxLength: 200000 description: New plan body (markdown, must not be blank). summary: type: string maxLength: 512 description: Plan title; empty clears it (the original request is shown instead). expectedUpdatedAt: type: string format: date-time description: > `updatedAt` of the version the user edited. A plan changed in between (agent refine, another user, execution) is refused with 409. ChatPlanActivityResponseDto: type: object required: [id, planId, occurredAt, actorType, actionType, payload] properties: id: { type: string, format: uuid } planId: { type: string, format: uuid } occurredAt: { type: string, format: date-time } actorType: { type: string, enum: [human, ai, system] } actorUserId: { type: string, format: uuid, nullable: true } actorEmail: { type: string, nullable: true } actionType: type: string enum: [ CREATED, DRAFT_UPDATED, REFINE_REQUESTED, CONTENT_UPDATED, EXECUTION_STARTED, EXECUTED, FAILED, CANCELLED, RETRY_REQUESTED, ] payload: type: object additionalProperties: true description: > Action details: `chatId` (CREATED), `phase` / `ready` (DRAFT_UPDATED), `instructions` (REFINE_REQUESTED), `fields` (CONTENT_UPDATED), `editedByUser` / `planMarkdownLength` (EXECUTION_STARTED), `code` / `message` (FAILED). CreateAgentTaskDto: type: object required: [title, prompt, cronExpression, model] properties: title: type: string maxLength: 200 prompt: type: string maxLength: 20000 cronExpression: type: string maxLength: 128 description: Five-field cron expression (minute hour day-of-month month day-of-week); occurrences at least AGENT_TASK_MIN_INTERVAL_MINUTES apart timezone: type: string maxLength: 64 description: IANA time zone (default UTC) model: type: string maxLength: 256 description: OpenCode provider/model enabled: type: boolean allowedHandoffAgentIds: type: array maxItems: 10 items: type: string format: uuid description: >- Other agents of the same workspace the runs may hand off work to (`agenstra_handoff_create`; empty: no handoffs). Approved content like the prompt: a change by the agent clears the approval; the edit form approves only when it sends title, prompt, model, cronExpression and allowedHandoffAgentIds. allowedDeploymentOperations: type: array maxItems: 2 items: type: string enum: [deployment.trigger, deployment.cancel] description: >- Deployment run actions the runs may request without asking (`agenstra_deployments_trigger` / `_cancel_run`; empty: none). Approved content like the prompt: a change by the agent clears the approval; the edit form approves only when it sends the complete content including allowedDeploymentOperations. UpdateAgentTaskDto: type: object properties: title: type: string maxLength: 200 prompt: type: string maxLength: 20000 cronExpression: type: string maxLength: 128 description: Five-field cron expression (minute hour day-of-month month day-of-week); occurrences at least AGENT_TASK_MIN_INTERVAL_MINUTES apart timezone: type: string maxLength: 64 description: IANA time zone (default UTC) model: type: string maxLength: 256 description: OpenCode provider/model enabled: type: boolean allowedHandoffAgentIds: type: array maxItems: 10 items: type: string format: uuid description: >- Other agents of the same workspace the runs may hand off work to (`agenstra_handoff_create`; empty: no handoffs). Approved content like the prompt: a change by the agent clears the approval; the edit form approves only when it sends title, prompt, model, cronExpression and allowedHandoffAgentIds. allowedDeploymentOperations: type: array maxItems: 2 items: type: string enum: [deployment.trigger, deployment.cancel] description: >- Deployment run actions the runs may request without asking (`agenstra_deployments_trigger` / `_cancel_run`; empty: none). Approved content like the prompt: a change by the agent clears the approval; the edit form approves only when it sends the complete content including allowedDeploymentOperations. DeploymentProvider: type: string enum: [github, gitlab, jenkins] ConnectionAuthType: type: string enum: [app, token] description: >- `app`: GitHub App installation tokens (GitHub only, default there). `token`: personal / project access token (GitHub, GitLab) or Jenkins user API token (HTTP Basic with `username`). ConnectionTestStatus: type: string enum: [untested, ok, failed] DeploymentConnectionWorkspaceAccess: type: string enum: [all, selected] DeploymentConnectionSummary: type: object description: Connection metadata only; `token` and `privateKey` are encrypted at rest and never returned. required: - id - label - provider - baseUrl - authType - appId - installationId - username - workspaceAccess - allowedClientIds - lastTestStatus - lastTestMessage - lastTestedAt - createdAt - updatedAt properties: id: type: string format: uuid label: type: string provider: $ref: '#/components/schemas/DeploymentProvider' baseUrl: type: string nullable: true description: Self-hosted API base URL (GHE `https://host/api/v3`, GitLab root, Jenkins root); null = provider default. authType: $ref: '#/components/schemas/ConnectionAuthType' appId: type: string nullable: true installationId: type: string nullable: true username: type: string nullable: true workspaceAccess: $ref: '#/components/schemas/DeploymentConnectionWorkspaceAccess' allowedClientIds: type: array items: type: string format: uuid lastTestStatus: $ref: '#/components/schemas/ConnectionTestStatus' lastTestMessage: type: string nullable: true lastTestedAt: type: string format: date-time nullable: true createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateDeploymentConnectionDto: type: object description: >- Required per auth type: GitHub `app` → `appId`, `installationId`, `privateKey` (PEM RSA); GitHub / GitLab `token` → `token`; Jenkins → `baseUrl`, `username`, `token`. `workspaceAccess: selected` requires at least one existing workspace in `allowedClientIds`. required: [label, provider] properties: label: type: string maxLength: 200 provider: $ref: '#/components/schemas/DeploymentProvider' baseUrl: type: string nullable: true maxLength: 512 description: Absolute http(s) URL without credentials, query or fragment. authType: $ref: '#/components/schemas/ConnectionAuthType' token: type: string maxLength: 8192 writeOnly: true username: type: string maxLength: 320 appId: type: string pattern: '^\d+$' maxLength: 64 installationId: type: string pattern: '^\d+$' maxLength: 64 privateKey: type: string maxLength: 16384 writeOnly: true workspaceAccess: $ref: '#/components/schemas/DeploymentConnectionWorkspaceAccess' allowedClientIds: type: array maxItems: 500 items: type: string format: uuid UpdateDeploymentConnectionDto: type: object description: All fields optional; `provider` is immutable. Omitted secrets keep the stored ones. properties: label: type: string maxLength: 200 baseUrl: type: string nullable: true maxLength: 512 description: null / empty resets to the provider default (rejected for Jenkins). authType: $ref: '#/components/schemas/ConnectionAuthType' token: type: string maxLength: 8192 writeOnly: true username: type: string maxLength: 320 appId: type: string pattern: '^\d+$' maxLength: 64 installationId: type: string pattern: '^\d+$' maxLength: 64 privateKey: type: string maxLength: 16384 writeOnly: true workspaceAccess: $ref: '#/components/schemas/DeploymentConnectionWorkspaceAccess' allowedClientIds: type: array maxItems: 500 items: type: string format: uuid ConnectionTestResult: type: object required: [ok, testedAt] properties: ok: type: boolean message: type: string maxLength: 512 testedAt: type: string format: date-time DeploymentConnectionOption: type: object description: What a workspace admin sees of a deployment connection when picking one for a workflow. required: [id, label, provider, lastTestStatus] properties: id: type: string format: uuid label: type: string provider: $ref: '#/components/schemas/DeploymentProvider' lastTestStatus: $ref: '#/components/schemas/ConnectionTestStatus' DeploymentRepositorySummary: type: object required: [id, name, fullName, defaultBranch, url, private] properties: id: type: string description: Provider id used in workflow definitions (`owner/repo`, GitLab project id, Jenkins job full name). name: type: string fullName: type: string defaultBranch: type: [string, 'null'] url: type: [string, 'null'] private: type: boolean DeploymentBranchSummary: type: object required: [name, sha, default] properties: name: type: string sha: type: [string, 'null'] default: type: boolean DeploymentProviderWorkflowSummary: type: object required: [id, name, path, state] properties: id: type: string name: type: string path: type: [string, 'null'] state: type: [string, 'null'] DeploymentInputs: type: object description: >- Workflow inputs (GitHub), pipeline variables (GitLab) or build parameters (Jenkins). At most 25 entries; keys match `^[A-Za-z_][A-Za-z0-9_.-]*$` (at most 100 characters), values are strings of at most 1000 characters. maxProperties: 25 propertyNames: pattern: '^[A-Za-z_][A-Za-z0-9_.-]*$' maxLength: 100 additionalProperties: type: string maxLength: 1000 ApproveDeploymentWorkflowDto: type: object required: [updatedAt] properties: updatedAt: type: string format: date-time description: '`updatedAt` of the workflow summary the admin reviewed.' DeploymentWorkflowSummary: type: object required: [ id, clientId, connectionId, provider, connectionLabel, name, description, repository, workflow, defaultRef, defaultInputs, scope, agentIds, agentTriggerEnabled, enabled, approvalStatus, approvedAt, createdBy, updatedBy, createdByAgentId, lastRunStatus, lastRunConclusion, lastRunAt, createdAt, updatedAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid connectionId: type: string format: uuid provider: $ref: '#/components/schemas/DeploymentProvider' connectionLabel: type: string name: type: string description: type: [string, 'null'] repository: type: string description: Provider repository (`owner/repo`, GitLab project id or path, Jenkins job full name). workflow: type: [string, 'null'] description: GitHub workflow file or id; null for GitLab and Jenkins. defaultRef: type: [string, 'null'] defaultInputs: $ref: '#/components/schemas/DeploymentInputs' scope: type: string enum: [global, environments] description: '`global`: every environment of the workspace; `environments`: the assigned `agentIds` only.' agentIds: type: array items: type: string format: uuid agentTriggerEnabled: type: boolean description: Whether available environments may trigger and cancel runs through the `agenstra` MCP server. enabled: type: boolean approvalStatus: type: string enum: [approved, pending] description: >- `pending`: proposed or changed by an environment (MCP), waiting for a workspace admin (`POST .../approval` or saving the complete editor form); nobody can start runs, and only the proposing environment sees it through MCP. approvedAt: type: [string, 'null'] format: date-time createdBy: type: string enum: [user, agent] updatedBy: type: string enum: [user, agent] createdByAgentId: type: [string, 'null'] format: uuid description: 'Environment that proposed the workflow (`createdBy: agent`).' lastRunStatus: oneOf: - $ref: '#/components/schemas/DeploymentRunStatus' - type: 'null' lastRunConclusion: oneOf: - $ref: '#/components/schemas/DeploymentRunConclusion' - type: 'null' lastRunAt: type: [string, 'null'] format: date-time createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateDeploymentWorkflowDto: type: object required: [connectionId, name, repository] properties: connectionId: type: string format: uuid description: Deployment connection usable by this workspace. name: type: string maxLength: 200 description: type: [string, 'null'] maxLength: 2000 repository: type: string maxLength: 512 workflow: type: [string, 'null'] maxLength: 512 description: GitHub workflow file or id (required for GitHub Actions). defaultRef: type: [string, 'null'] maxLength: 255 defaultInputs: $ref: '#/components/schemas/DeploymentInputs' scope: type: string enum: [global, environments] default: global agentIds: type: array maxItems: 100 description: Environments of this workspace; at least one for `scope = environments`, ignored for `global`. items: type: string format: uuid agentTriggerEnabled: type: boolean default: false enabled: type: boolean default: true UpdateDeploymentWorkflowDto: type: object description: All fields optional; omitted fields stay unchanged. properties: connectionId: type: string format: uuid name: type: string maxLength: 200 description: type: [string, 'null'] maxLength: 2000 repository: type: string maxLength: 512 workflow: type: [string, 'null'] maxLength: 512 defaultRef: type: [string, 'null'] maxLength: 255 defaultInputs: $ref: '#/components/schemas/DeploymentInputs' scope: type: string enum: [global, environments] agentIds: type: array maxItems: 100 items: type: string format: uuid agentTriggerEnabled: type: boolean enabled: type: boolean TriggerDeploymentRunDto: type: object properties: ref: type: string minLength: 1 maxLength: 255 description: Branch / tag; defaults to the workflow default ref, then the repository default branch. inputs: $ref: '#/components/schemas/DeploymentInputs' agentId: type: string format: uuid description: Environment the run is triggered for (the workflow must be global or assigned to it). DeploymentRunStatus: type: string enum: [queued, in_progress, completed] DeploymentRunConclusion: type: string enum: [success, failure, cancelled, skipped, timed_out, neutral] DeploymentRunSummary: type: object required: [ id, clientId, workflowId, workflowName, agentId, providerRunId, name, status, conclusion, ref, sha, url, inputs, triggeredBy, triggeredByUserId, startedAt, completedAt, createdAt, updatedAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid workflowId: type: string format: uuid workflowName: type: string agentId: type: [string, 'null'] format: uuid description: Environment the run was triggered for / by (null for workspace level and external runs). providerRunId: type: [string, 'null'] description: GitHub run id, GitLab pipeline id, Jenkins build number (`queue:{id}` until the build starts); null until the provider reports the run. name: type: [string, 'null'] status: $ref: '#/components/schemas/DeploymentRunStatus' conclusion: oneOf: - $ref: '#/components/schemas/DeploymentRunConclusion' - type: 'null' ref: type: [string, 'null'] sha: type: [string, 'null'] url: type: [string, 'null'] inputs: $ref: '#/components/schemas/DeploymentInputs' triggeredBy: type: string enum: [user, agent, external] triggeredByUserId: type: [string, 'null'] format: uuid startedAt: type: [string, 'null'] format: date-time completedAt: type: [string, 'null'] format: date-time createdAt: type: string format: date-time updatedAt: type: string format: date-time DeploymentRunListResponse: type: object required: [items, total] properties: items: type: array items: $ref: '#/components/schemas/DeploymentRunSummary' total: type: integer minimum: 0 DeploymentRunJobSummary: type: object required: [id, name, status, conclusion, startedAt, completedAt, url] properties: id: type: string description: Provider job id (Jenkins returns the single pseudo job `console`). name: type: string status: $ref: '#/components/schemas/DeploymentRunStatus' conclusion: oneOf: - $ref: '#/components/schemas/DeploymentRunConclusion' - type: 'null' startedAt: type: [string, 'null'] format: date-time completedAt: type: [string, 'null'] format: date-time url: type: [string, 'null'] DeploymentRunDetail: type: object required: [run, jobs] properties: run: $ref: '#/components/schemas/DeploymentRunSummary' jobs: type: array items: $ref: '#/components/schemas/DeploymentRunJobSummary' DeploymentRunLogs: type: object required: [logs, truncated] properties: logs: type: string truncated: type: boolean description: True when only the tail was returned. DeploymentSyncResult: type: object required: [synced] properties: synced: type: integer minimum: 0 description: New or changed runs. AgentTaskResponseDto: type: object required: [ id, clientId, agentId, title, prompt, cronExpression, timezone, model, enabled, allowedHandoffAgentIds, approvalStatus, approvedAt, createdBy, updatedBy, createdAt, updatedAt, ] properties: id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid title: type: string prompt: type: string cronExpression: type: string timezone: type: string model: type: string enabled: type: boolean allowedHandoffAgentIds: type: array items: type: string format: uuid description: Approved agents the runs may hand off work to (agents deleted or moved since do not count) allowedDeploymentOperations: type: array items: type: string enum: [deployment.trigger, deployment.cancel] description: 'Approved deployment run actions of the runs (empty: none)' nextRunAt: type: string format: date-time nullable: true lastRunAt: type: string format: date-time nullable: true lastRunStatus: type: string enum: [running, awaiting_handoff, succeeded, failed] nullable: true approvalStatus: type: string enum: [approved, pending] description: Tasks created / changed by the agent wait for a user's approval before they run approvedAt: type: string format: date-time nullable: true createdBy: type: string enum: [user, agent] updatedBy: type: string enum: [user, agent] createdAt: type: string format: date-time updatedAt: type: string format: date-time AgentTaskRunResponseDto: type: object required: [ id, taskId, clientId, agentId, trigger, status, scheduledFor, startedAt, ] properties: id: type: string format: uuid taskId: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid trigger: type: string enum: [schedule, manual] status: type: string enum: [running, awaiting_handoff, succeeded, failed] description: >- `awaiting_handoff`: the run's turn ended while one of its handoffs is open; the response continues the run in its own session. Counts as the task's active run (no second run, minimum interval). scheduledFor: type: string format: date-time startedAt: type: string format: date-time finishedAt: type: string format: date-time nullable: true outputExcerpt: type: string nullable: true description: Tail of the agent's final answer (max 4000 characters) failureMessage: type: string nullable: true awaitingHandoffSince: type: string format: date-time nullable: true description: Set while the run waits for a handoff response (timeout AGENT_TASK_HANDOFF_WAIT_TIMEOUT_MS) transcript: type: array description: Forwarded `chatEvent` frames of the run's turn (only with `includeTranscript=true`; deltas omitted, strings capped). items: type: object required: [payload, timestamp] properties: payload: type: object timestamp: type: number AgentTaskDetailResponseDto: type: object required: [task, runs] properties: task: $ref: '#/components/schemas/AgentTaskResponseDto' runs: type: array items: $ref: '#/components/schemas/AgentTaskRunResponseDto' AgentTaskRunChatEventDto: type: object description: Socket `agentTaskRunChatUpsert` (namespace clients) — run card in the agent's main chat. required: [timelineAt, hydrate, task, run, actions] properties: timelineAt: type: string format: date-time hydrate: type: boolean task: type: object required: [id, clientId, agentId, title, cronExpression, timezone, enabled] properties: id: type: string format: uuid clientId: type: string format: uuid agentId: type: string format: uuid title: type: string cronExpression: type: string timezone: type: string enabled: type: boolean run: $ref: '#/components/schemas/AgentTaskRunResponseDto' actions: type: array items: type: object required: [type, taskId, runId, label] properties: type: type: string enum: [openAgentTask] taskId: type: string runId: type: string label: type: string ChatPlanChatEventDto: type: object description: > Payload for WebSocket event `chatPlanUpsert` on namespace **clients**. `timelineAt` uses `plan.startedAt` when `hydrate` is true and `plan.updatedAt` when false. Clients merge with chat messages by chatId + this timestamp. required: [timelineAt, hydrate, plan, actions] properties: timelineAt: type: string format: date-time hydrate: type: boolean plan: $ref: '#/components/schemas/ChatPlanResponseDto' actions: type: array items: $ref: '#/components/schemas/ChatPlanChatActionDto' ChatPlanChatActionDto: type: object required: [type, planId, chatId, label] properties: type: type: string enum: [openChatPlan, executeChatPlan] planId: type: string format: uuid chatId: type: string format: uuid label: type: string PrototypePromptResponseDto: type: object required: [prompt] properties: prompt: type: string StartBodyGenerationSessionDto: type: object properties: agentId: type: string format: uuid StartBodyGenerationSessionResponseDto: type: object required: [generationId, expiresAt, activity] properties: generationId: type: string format: uuid expiresAt: type: string format: date-time activity: $ref: '#/components/schemas/TicketActivityResponseDto' ApplyGeneratedBodyDto: type: object required: [generationId, content] properties: generationId: type: string format: uuid content: type: string AtlassianConnectionAuthType: type: string enum: [app, token] description: >- `app`: OAuth 2.0 client credentials of an Atlassian service account (REST via `https://api.atlassian.com/ex/{jira|confluence}/{cloudId}`). `token`: account email + API token (HTTP Basic against the site URL). AtlassianConnectionTestStatus: type: string enum: [untested, ok, failed] AtlassianSiteConnectionResponseDto: type: object description: >- Connection metadata only; API tokens and OAuth client secrets are stored encrypted at rest and are never returned. required: [id, baseUrl, authType, lastTestStatus, createdAt, updatedAt] properties: id: type: string format: uuid label: type: string nullable: true baseUrl: type: string authType: $ref: '#/components/schemas/AtlassianConnectionAuthType' accountEmail: type: string nullable: true description: '`token` connections only.' oauthClientId: type: string nullable: true description: OAuth client id of the service account credential (`app` connections only; not a secret). cloudId: type: string nullable: true description: Atlassian Cloud id resolved from `{baseUrl}/_edge/tenant_info` (`app` connections). lastTestStatus: $ref: '#/components/schemas/AtlassianConnectionTestStatus' lastTestMessage: type: string nullable: true maxLength: 512 lastTestedAt: type: string format: date-time nullable: true createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateAtlassianSiteConnectionDto: type: object description: >- `authType` defaults to `app` (requires `oauthClientId` + `oauthClientSecret`); `token` requires `accountEmail` + `apiToken`. Fields of the other auth type are ignored. required: [baseUrl] properties: label: type: string maxLength: 200 baseUrl: type: string format: uri maxLength: 512 authType: $ref: '#/components/schemas/AtlassianConnectionAuthType' accountEmail: type: string format: email maxLength: 320 apiToken: type: string maxLength: 4096 description: Atlassian API token; persisted with AES-256-GCM encryption (write-only). oauthClientId: type: string maxLength: 255 oauthClientSecret: type: string maxLength: 4096 description: OAuth client secret of the service account credential; persisted with AES-256-GCM encryption (write-only). UpdateAtlassianSiteConnectionDto: type: object description: >- All fields optional. Omitted secrets keep the stored ones; switching `authType` requires the credentials of the new type. Changing site or credentials resets the test status to `untested`. properties: label: type: string maxLength: 200 nullable: true baseUrl: type: string format: uri maxLength: 512 authType: $ref: '#/components/schemas/AtlassianConnectionAuthType' accountEmail: type: string format: email maxLength: 320 apiToken: type: string maxLength: 4096 description: When omitted, token is unchanged. If set, stored with AES-256-GCM encryption. oauthClientId: type: string maxLength: 255 oauthClientSecret: type: string maxLength: 4096 description: When omitted, secret is unchanged. If set, stored with AES-256-GCM encryption. AtlassianConnectionTestResultDto: type: object required: [ok, testedAt] properties: ok: type: boolean message: type: string maxLength: 512 testedAt: type: string format: date-time ExternalImportProviderId: type: string enum: [atlassian] ExternalImportKind: type: string enum: [jira, confluence] ExternalImportConfigResponseDto: type: object properties: id: type: string format: uuid provider: $ref: '#/components/schemas/ExternalImportProviderId' importKind: $ref: '#/components/schemas/ExternalImportKind' atlassianConnectionId: type: string format: uuid clientId: type: string format: uuid enabled: type: boolean jiraBoardId: type: integer jql: type: string importTargetTicketStatus: $ref: '#/components/schemas/TicketStatus' confluenceSpaceKey: type: string confluenceRootPageId: type: string cql: type: string agenstraParentTicketId: type: string format: uuid agenstraParentFolderId: type: string format: uuid lastRunAt: type: string format: date-time lastError: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time CreateExternalImportConfigDto: type: object required: [provider, importKind, atlassianConnectionId, clientId] properties: provider: $ref: '#/components/schemas/ExternalImportProviderId' importKind: $ref: '#/components/schemas/ExternalImportKind' atlassianConnectionId: type: string format: uuid clientId: type: string format: uuid enabled: type: boolean jiraBoardId: type: integer jql: type: string importTargetTicketStatus: $ref: '#/components/schemas/TicketStatus' confluenceSpaceKey: type: string confluenceRootPageId: type: string cql: type: string agenstraParentTicketId: type: string format: uuid agenstraParentFolderId: type: string format: uuid UpdateExternalImportConfigDto: type: object properties: atlassianConnectionId: type: string format: uuid clientId: type: string format: uuid enabled: type: boolean jiraBoardId: type: integer jql: type: string importTargetTicketStatus: $ref: '#/components/schemas/TicketStatus' confluenceSpaceKey: type: string confluenceRootPageId: type: string cql: type: string agenstraParentTicketId: type: string format: uuid agenstraParentFolderId: type: string format: uuid WebhookEventTypeResponseDto: type: object properties: type: { type: string } description: { type: string } UpdateState: type: string enum: [up_to_date, update_available, unknown] DependencyHealthStatus: type: string enum: [healthy, degraded, unknown, not_applicable] InstanceDependencyHealthDto: type: object properties: redis: { $ref: '#/components/schemas/DependencyHealthStatus' } queue: { $ref: '#/components/schemas/DependencyHealthStatus' } database: { $ref: '#/components/schemas/DependencyHealthStatus' } opensearch: { $ref: '#/components/schemas/DependencyHealthStatus' } ChangelogEntryDto: type: object properties: text: { type: string } scope: { type: string, enum: [product, shared] } product: { type: string, enum: [agenstra, decabill] } category: { type: string } ScopedChangelogDto: type: object properties: product: type: array items: { $ref: '#/components/schemas/ChangelogEntryDto' } shared: type: array items: { $ref: '#/components/schemas/ChangelogEntryDto' } ServiceInstanceRecordDto: type: object properties: instanceId: { type: string } serviceName: { type: string } role: { type: string } hostname: { type: string } installedVersion: { type: string } updateState: { $ref: '#/components/schemas/UpdateState' } lastHeartbeatAt: { type: string, format: date-time } dependencies: { $ref: '#/components/schemas/InstanceDependencyHealthDto' } ReleaseSnapshotDto: type: object properties: tagName: { type: string } name: { type: string } body: { type: string } htmlUrl: { type: string, format: uri } publishedAt: { type: string, format: date-time } changelog: type: array items: { $ref: '#/components/schemas/ChangelogEntryDto' } scopedChangelog: { $ref: '#/components/schemas/ScopedChangelogDto' } UpdatesStatusSummaryDto: type: object properties: installedVersion: { type: string } latestVersion: { type: string, nullable: true } updateState: { $ref: '#/components/schemas/UpdateState' } lastCheckAt: { type: string, format: date-time, nullable: true } lastCheckStatus: { type: string, enum: [success, failed, pending, unknown] } instanceCount: { type: integer } outdatedInstanceCount: { type: integer } UpdatesFullStateDto: allOf: - $ref: '#/components/schemas/UpdatesStatusSummaryDto' - type: object properties: release: { $ref: '#/components/schemas/ReleaseSnapshotDto', nullable: true, } instances: type: array items: { $ref: '#/components/schemas/ServiceInstanceRecordDto' } scopedChangelog: { $ref: '#/components/schemas/ScopedChangelogDto' } UpdateCheckTriggerResultDto: type: object properties: jobId: { type: string } enqueuedAt: { type: string, format: date-time } CreateWebhookEndpointDto: type: object required: [name, url, httpMethod, subscribedEvents, authType] properties: name: { type: string } url: { type: string, format: uri } httpMethod: { type: string, enum: [POST, GET] } subscribedEvents: type: array items: { type: string } enabled: { type: boolean } authType: { type: string, enum: [none, authorization, custom_header, query_param], } authHeaderName: { type: string } authValue: { type: string } clientId: { type: string, format: uuid, nullable: true } deliveryLogRetentionDays: { type: integer, minimum: 1, maximum: 365 } deliveryLogMaxEntries: { type: integer, minimum: 1, maximum: 10000 } UpdateWebhookEndpointDto: type: object properties: name: { type: string } url: { type: string, format: uri } httpMethod: { type: string, enum: [POST, GET] } subscribedEvents: type: array items: { type: string } enabled: { type: boolean } authType: { type: string, enum: [none, authorization, custom_header, query_param], } authHeaderName: { type: string } authValue: { type: string } clientId: { type: string, format: uuid, nullable: true } deliveryLogRetentionDays: { type: integer, minimum: 1, maximum: 365, nullable: true } deliveryLogMaxEntries: { type: integer, minimum: 1, maximum: 10000, nullable: true } WebhookEndpointResponseDto: type: object properties: id: { type: string, format: uuid } scopeKey: { type: string } clientId: { type: string, format: uuid, nullable: true } name: { type: string } url: { type: string } httpMethod: { type: string, enum: [POST, GET] } subscribedEvents: type: array items: { type: string } enabled: { type: boolean } authType: { type: string } authHeaderName: { type: string, nullable: true } hasAuthValue: { type: boolean } consecutiveFailures: { type: integer } disabledReason: { type: string, nullable: true } deliveryLogRetentionDays: { type: integer, nullable: true } deliveryLogMaxEntries: { type: integer, nullable: true } signingSecret: { type: string } createdAt: { type: string, format: date-time } updatedAt: { type: string, format: date-time } WebhookDeliveryResponseDto: type: object properties: id: { type: string, format: uuid } endpointId: { type: string, format: uuid } eventId: { type: string, format: uuid } eventType: { type: string } payload: { type: object, additionalProperties: true } httpStatus: { type: integer, nullable: true } responseBody: { type: string, nullable: true } success: { type: boolean } attempt: { type: integer } errorMessage: { type: string, nullable: true } createdAt: { type: string, format: date-time } PaginatedWebhookDeliveriesResponseDto: type: object properties: items: type: array items: $ref: '#/components/schemas/WebhookDeliveryResponseDto' total: { type: integer } KnowledgeNodeResponseDto: type: object required: [id, shas, clientId, nodeType, title, sortOrder, createdAt, updatedAt] properties: id: { type: string, format: uuid } shas: type: object required: [short, long] properties: short: { type: string } long: { type: string } clientId: { type: string, format: uuid } nodeType: { type: string, enum: [folder, page] } parentId: { type: string, format: uuid, nullable: true } title: { type: string } content: { type: string, nullable: true } sortOrder: { type: integer } attachments: type: array items: { $ref: '#/components/schemas/AttachmentResponseDto' } createdAt: { type: string, format: date-time } updatedAt: { type: string, format: date-time } children: type: array items: { $ref: '#/components/schemas/KnowledgeNodeResponseDto' } searchMatch: type: boolean description: >- Only on `GET /knowledge/tree` with `search`: `true` for matching nodes, `false` for ancestor folders included as context. CreateKnowledgeNodeDto: type: object required: [nodeType, title] properties: clientId: { type: string, format: uuid } parentId: { type: string, format: uuid, nullable: true } nodeType: { type: string, enum: [folder, page] } title: { type: string, maxLength: 500 } content: { type: string } UploadKnowledgeTextFileDto: type: object required: [filename, content] properties: filename: { type: string, maxLength: 500 } content: { type: string, maxLength: 10485760 } UploadKnowledgeTextDto: type: object required: [files] properties: clientId: { type: string, format: uuid } parentId: { type: string, format: uuid, nullable: true } onConflict: { type: string, enum: [reject, replace, number], default: reject } files: type: array minItems: 1 maxItems: 100 items: $ref: '#/components/schemas/UploadKnowledgeTextFileDto' UploadKnowledgeTextRejectedDto: type: object required: [filename, reason] properties: filename: { type: string } reason: { type: string } UploadKnowledgeTextResultDto: type: object required: [created, updated, rejected] properties: created: type: array items: $ref: '#/components/schemas/KnowledgeNodeResponseDto' updated: type: array items: $ref: '#/components/schemas/KnowledgeNodeResponseDto' rejected: type: array items: $ref: '#/components/schemas/UploadKnowledgeTextRejectedDto' UpdateKnowledgeNodeDto: type: object properties: parentId: { type: string, format: uuid, nullable: true } title: { type: string, maxLength: 500 } content: { type: string, nullable: true } ReorderKnowledgeNodeDto: type: object required: [sortOrder] properties: sortOrder: { type: integer, minimum: 0, maximum: 100000 } KnowledgeRelationResponseDto: type: object required: [id, clientId, sourceType, sourceId, targetType, createdAt] properties: id: { type: string, format: uuid } clientId: { type: string, format: uuid } sourceType: { type: string, enum: [ticket, page] } sourceId: { type: string, format: uuid } targetType: { type: string, enum: [ticket, folder, page] } targetNodeId: { type: string, format: uuid, nullable: true } targetTicketLongSha: { type: string, nullable: true } createdAt: { type: string, format: date-time } CreateKnowledgeRelationDto: type: object required: [clientId, sourceType, sourceId, targetType] properties: clientId: { type: string, format: uuid } sourceType: { type: string, enum: [ticket, page] } sourceId: { type: string, format: uuid } targetType: { type: string, enum: [ticket, folder, page] } targetNodeId: { type: string, format: uuid } targetTicketSha: { type: string, maxLength: 40 } KnowledgePromptContextResponseDto: type: object required: [promptSections] properties: promptSections: type: array items: { type: string } KnowledgePageActivityResponseDto: type: object required: [id, pageId, occurredAt, actorType, actionType, payload] properties: id: { type: string, format: uuid } pageId: { type: string, format: uuid } occurredAt: { type: string, format: date-time } actorType: { type: string, enum: [human, ai, system] } actorUserId: { type: string, format: uuid, nullable: true } actorEmail: { type: string, nullable: true } actionType: type: string enum: [ CREATED, FIELD_UPDATED, CONTENT_UPDATED, PARENT_CHANGED, SORT_ORDER_CHANGED, DELETED, DUPLICATED, RELATION_ADDED, RELATION_REMOVED, ] payload: { type: object, additionalProperties: true } WorkspaceIndexStatusDto: type: object required: [status, docCount] properties: status: type: string enum: [missing, indexing, ready, error] docCount: type: integer minimum: 0 message: type: string nullable: true WorkspaceSearchHitDto: type: object required: [path, fileName, fileType, size] properties: path: { type: string } fileName: { type: string } fileType: { type: string } size: { type: integer } matches: type: array description: Content line matches (full mode). Empty when only the path matched. items: $ref: '#/components/schemas/WorkspaceSearchMatchDto' snippet: type: string nullable: true description: First match snippet (compat; prefer matches) line: type: integer nullable: true description: First match line (compat; prefer matches) WorkspaceSearchMatchDto: type: object required: [line, snippet] properties: line: { type: integer, minimum: 1 } snippet: { type: string } WorkspaceSearchResponseDto: type: object required: [status, hits, total] properties: status: type: string enum: [missing, indexing, ready, error] hits: type: array items: $ref: '#/components/schemas/WorkspaceSearchHitDto' total: type: integer minimum: 0 OpencodeLayerFileResponseDto: type: object required: [ id, scope, path, emittedPath, entryKind, content, contentSha, updatedAt, ] properties: id: type: string format: uuid scope: type: string enum: [global, workspace] clientId: type: string format: uuid nullable: true path: type: string description: Path as entered (sanitized; no managed prefix) emittedPath: type: string description: Same as path; written into agent `/app` trees as entered entryKind: type: string enum: [file, directory] content: type: string description: Plaintext after AES-256-GCM decrypt (empty for directories) contentSha: type: string updatedAt: type: string format: date-time OpencodeLayerFileListEntryDto: type: object required: [name, path, entryKind] properties: name: type: string path: type: string entryKind: type: string enum: [file, directory] OpencodeLayerFileListResponseDto: type: object required: [path, entries] properties: path: type: string entries: type: array items: $ref: '#/components/schemas/OpencodeLayerFileListEntryDto' CreateOpencodeLayerFileDto: type: object required: [path, entryKind] properties: path: type: string entryKind: type: string enum: [file, directory] content: type: string UpsertOpencodeLayerFileDto: type: object properties: content: type: string entryKind: type: string enum: [file, directory] EffectiveEgressPolicy: type: object description: Fully resolved egress policy with per-entry provenance required: [ mode, allowHosts, denyHosts, denyUrlPatterns, networkAllow, blockPrivateNetworks, blockIpLiterals, logAllowed, scalarSources, ] properties: mode: type: string enum: [off, monitor, enforce, offline] allowHosts: type: array items: type: object required: [value, source] properties: value: type: string source: type: string enum: [global, workspace, environment] denyHosts: type: array items: type: object required: [value, source] properties: value: type: string source: type: string enum: [global, workspace, environment] denyUrlPatterns: type: array items: type: object required: [value, source] properties: value: type: string source: type: string enum: [global, workspace, environment] networkAllow: type: array items: type: object required: [protocol, ports, destinations, source] properties: protocol: type: string enum: [tcp, udp] ports: type: string description: Single port (22) or range (1000-2000) destinations: type: array items: type: string description: type: string source: type: string enum: [global, workspace, environment] blockPrivateNetworks: type: boolean blockIpLiterals: type: boolean logAllowed: type: boolean scalarSources: type: object description: Layer that set each scalar (null = platform default) properties: mode: type: string nullable: true enum: [global, workspace, environment, null] blockPrivateNetworks: type: string nullable: true enum: [global, workspace, environment, null] blockIpLiterals: type: string nullable: true enum: [global, workspace, environment, null] logAllowed: type: string nullable: true enum: [global, workspace, environment, null] EffectiveMessageFilterRule: type: object description: Message filter rule from the layered config (`message_filters` root key) required: [name, pattern, flags, direction, action, enabled, source] properties: name: type: string pattern: type: string flags: type: string direction: type: string enum: [incoming, outgoing, bidirectional] action: type: string enum: [drop, replace, flag] replacement: type: string enabled: type: boolean source: type: string enum: [global, workspace, environment] EffectivePlatformSecurityPolicy: type: object description: > Effective platform security policy for a scope (Security: Web traffic / Message filters), resolved global, workspace, environment with per-entry provenance. required: [egress, messageFilters] properties: egress: $ref: '#/components/schemas/EffectiveEgressPolicy' messageFilters: type: array items: $ref: '#/components/schemas/EffectiveMessageFilterRule' AgentEgressGuardRuntimeDto: type: object required: [running, startedAt, activeRevision, proxyRunning, dnsRunning] properties: running: type: boolean startedAt: type: string format: date-time nullable: true activeRevision: type: string nullable: true description: Policy revision the guard reports as active proxyRunning: type: boolean dnsRunning: type: boolean AgentEgressStatusDto: type: object description: Egress guard status of one agent environment required: [status, mode, guardContainerId, policyRevision, appliedAt, lastError] properties: status: type: string enum: [inactive, active, failed] mode: type: string enum: [off, monitor, enforce, offline] guardContainerId: type: string nullable: true policyRevision: type: string nullable: true appliedAt: type: string format: date-time nullable: true lastError: type: string nullable: true guard: $ref: '#/components/schemas/AgentEgressGuardRuntimeDto' AgentEgressEventDto: type: object description: One aggregated guard decision required: [ seq, agentId, kind, decision, host, rule, matchedEntry, matchedSource, method, httpStatus, sampleUrl, count, bytesIn, bytesOut, firstSeenAt, lastSeenAt, mode, policyRevision, message, ] properties: seq: type: string description: Monotonic cursor (stringified bigint) agentId: type: string format: uuid kind: type: string enum: [web, dns, network, guard] decision: type: string enum: [allowed, blocked, observed, error] host: type: string nullable: true rule: type: string nullable: true matchedEntry: type: string nullable: true matchedSource: type: string nullable: true enum: [global, workspace, environment, null] method: type: string nullable: true httpStatus: type: integer nullable: true sampleUrl: type: string nullable: true count: type: integer bytesIn: type: integer bytesOut: type: integer firstSeenAt: type: string format: date-time lastSeenAt: type: string format: date-time mode: type: string nullable: true policyRevision: type: string nullable: true message: type: string nullable: true AgentEgressDetailsDto: type: object description: Egress status plus the effective policy and message filters in force required: [agentId, status, policy, messageFilters, recentEvents] properties: agentId: type: string format: uuid status: $ref: '#/components/schemas/AgentEgressStatusDto' policy: allOf: - $ref: '#/components/schemas/EffectiveEgressPolicy' nullable: true messageFilters: type: array items: $ref: '#/components/schemas/EffectiveMessageFilterRule' recentEvents: type: array items: $ref: '#/components/schemas/AgentEgressEventDto' EvaluateEgressDestinationDto: type: object required: [destination] properties: destination: type: string minLength: 1 maxLength: 2048 description: Hostname, IP address or URL (scheme / path optional) EgressEvaluationResponseDto: type: object required: [host, decision, rule, mode] properties: host: type: string decision: type: string enum: [allowed, blocked, observed] rule: type: string nullable: true matchedEntry: type: string nullable: true source: type: string nullable: true mode: type: string scheme: type: string nullable: true enum: [http, https, null] description: Plain-HTTP URL rules only apply to http:// URLs (HTTPS paths are not visible without TLS interception) OpencodeConfigResponseDto: type: object required: [config, overrides, locks, secretKeys] properties: config: type: object additionalProperties: true overrides: type: object additionalProperties: true description: > Raw JSON overrides for this layer, merged over `config` before cross-layer merge (same heredity locks as `config`). locks: type: array items: type: string description: > Explicit JSON Pointer locks authored on this layer (global / workspace). Empty on Environment responses. Lower layers receive these via expanded lockedPaths. secretKeys: type: array items: type: string effective: type: object additionalProperties: true description: > Full merged config for this scope (agent → workspace → global). Each layer is compose(config, overrides) before cross-layer merge. Platform keys such as model_allow / model_deny are retained for the editor; worker sync materializes them separately. The `config` / `overrides` fields remain the editable overlays for the current layer only. lockedPaths: type: array items: type: string description: > JSON Pointer paths locked by a higher layer (presence-derived and explicit locks, including expanded /tabs/{id} locks) inheritedAdditive: type: array items: type: object required: [path] properties: path: type: string keys: type: array items: type: string items: type: array platformPolicy: $ref: '#/components/schemas/EffectivePlatformSecurityPolicy' egress: $ref: '#/components/schemas/AgentEgressStatusDto' updatedAt: type: string format: date-time sync: type: object nullable: true description: Durable per-agent effective-config sync target (agent GET/PUT) properties: syncStatus: type: string enum: [pending, synced, failed] desiredRevision: type: string appliedRevision: type: string nullable: true lastError: type: string nullable: true lastSyncedAt: type: string format: date-time nullable: true OpencodeProviderDto: type: object required: [id, name, env, models] properties: id: type: string name: type: string env: type: array items: type: string models: type: array items: type: object required: [id, name] properties: id: type: string name: type: string npm: type: string api: type: string OpencodeProvidersListDto: type: object required: [providers, total, limit, offset] properties: providers: type: array items: $ref: '#/components/schemas/OpencodeProviderDto' total: type: integer limit: type: integer offset: type: integer OpencodeMcpServerDto: type: object required: [name, title, description, version, status, packages, remotes] properties: name: type: string description: Reverse-DNS MCP Registry server name title: type: string description: type: string version: type: string status: type: string description: Registry lifecycle status (active, deprecated) websiteUrl: type: string packages: type: array items: type: object additionalProperties: true remotes: type: array items: type: object additionalProperties: true repository: type: object additionalProperties: true publishedAt: type: string format: date-time registryUpdatedAt: type: string format: date-time OpencodeMcpServersListDto: type: object required: [servers, total, limit, offset] properties: servers: type: array items: $ref: '#/components/schemas/OpencodeMcpServerDto' total: type: integer limit: type: integer offset: type: integer OpencodeAgentsListResponseDto: type: object required: [agents] properties: agents: type: array items: type: object required: [name, mode, builtIn] properties: name: type: string description: type: string mode: type: string enum: [subagent, primary, all] builtIn: type: boolean prompt: type: string temperature: type: number color: type: string model: type: object properties: modelID: type: string providerID: type: string OpencodeCommandsListResponseDto: type: object required: [commands] properties: commands: type: array items: type: object required: [name] properties: name: type: string description: type: string agent: type: string model: type: string subtask: type: boolean source: type: string enum: [command, mcp, skill] OpencodeMcpServerStatusDto: type: object required: [name, status] properties: name: type: string status: type: string enum: [connected, disabled, failed, needs_auth, needs_client_registration] error: type: string OpencodeMcpStatusListResponseDto: type: object required: [servers] properties: servers: type: array items: $ref: '#/components/schemas/OpencodeMcpServerStatusDto' OpencodeMcpAuthStartResponseDto: type: object required: [authorizationUrl] properties: authorizationUrl: type: string format: uri oauthState: type: string UpsertOpencodeConfigDto: type: object properties: config: type: object nullable: true additionalProperties: true overrides: type: object nullable: true additionalProperties: true description: > Raw JSON patch merged over `config` for this layer. Same credential, v1-key, and heredity checks as `config`. Empty object clears overrides when provided. locks: type: array nullable: true items: type: string description: > Explicit JSON Pointer locks for lower layers (global / workspace only). Empty array clears locks. Rejected on Environment PUT when non-empty. secrets: type: object nullable: true additionalProperties: type: string CreateClientVncSessionResponseDto: type: object required: [ticket, expiresIn] properties: ticket: type: string description: Single-use opaque ticket for the controller VNC WebSocket gateway expiresIn: type: integer minimum: 1 description: Ticket lifetime in seconds AgentGraphNode: type: object required: [id, type, label] properties: id: type: string type: type: string enum: - environment - module - file - symbol - package - doc - concept - instruction - language - directory - mount - prompt - session - ticket - knowledge - plan - attachment - skill - mcp-server - command - agent-profile - plugin - tool - workspace - knowledge-folder label: type: string path: type: string community: type: integer attrs: type: object additionalProperties: true AgentGraphEdge: type: object required: [from, to, type] properties: from: type: string to: type: string type: type: string enum: - contains - imports - depends_on - defines - links_to - documents - written_in - mounted_at - attached - available - used - modified - relates_to - member_of - references confidence: type: string enum: [extracted, inferred] attrs: type: object additionalProperties: true AgentGraphBuildStatus: type: string enum: [missing, building, ready, stale, failed] AgentGraphStatus: type: object required: [ environmentId, status, builtAt, buildDurationMs, truncated, error, layers, languages, fileCount, ] properties: environmentId: type: string status: $ref: '#/components/schemas/AgentGraphBuildStatus' builtAt: type: string format: date-time nullable: true buildDurationMs: type: integer nullable: true truncated: type: boolean error: type: string nullable: true layers: type: object additionalProperties: type: object properties: nodes: type: integer edges: type: integer nodesByType: type: object additionalProperties: type: integer languages: type: object additionalProperties: type: integer fileCount: type: integer AgentGraphHub: type: object required: [id, type, label, degree] properties: id: type: string type: type: string label: type: string path: type: string degree: type: integer AgentGraphPromptSummary: type: object required: [ id, environmentId, chatSessionId, messageId, origin, startedAt, finishedAt, counts, ] properties: id: type: string environmentId: type: string chatSessionId: type: string nullable: true messageId: type: string nullable: true origin: type: string enum: [chat, hidden, ephemeral] excerpt: type: string startedAt: type: string format: date-time finishedAt: type: string format: date-time nullable: true counts: type: object additionalProperties: type: integer AgentGraphOverview: type: object required: [scope, status, modules, hubs, communities, instructions] properties: scope: type: string enum: [environment, workspace, global] environmentId: type: string status: $ref: '#/components/schemas/AgentGraphStatus' workingDirectory: type: string mountPath: type: string modules: type: array items: type: object required: [id, label, files] properties: id: type: string label: type: string path: type: string files: type: integer hubs: type: array items: $ref: '#/components/schemas/AgentGraphHub' communities: type: array items: type: object required: [id, size, label] properties: id: type: integer size: type: integer label: type: string directory: type: string instructions: type: array items: type: object required: [id, label] properties: id: type: string label: type: string path: type: string recentPrompts: type: array description: Omitted for PATs without `agent_chats:read` items: $ref: '#/components/schemas/AgentGraphPromptSummary' AgentGraphDocument: type: object required: [ version, scope, layer, generatedAt, nodes, edges, truncated, totalNodes, totalEdges, ] properties: version: type: integer enum: [1] scope: type: string enum: [environment, workspace, global] layer: type: string enum: [all, code, paths, references, knowledge, global] offset: type: integer nextOffset: type: integer nullable: true environmentId: type: string clientId: type: string format: uuid generatedAt: type: string format: date-time nodes: type: array items: $ref: '#/components/schemas/AgentGraphNode' edges: type: array items: $ref: '#/components/schemas/AgentGraphEdge' truncated: type: boolean description: True when the document was cut to `limit` nodes (highest degree kept first) totalNodes: type: integer totalEdges: type: integer AgentGraphNodeRelation: type: object required: [edge, node] properties: edge: $ref: '#/components/schemas/AgentGraphEdge' node: $ref: '#/components/schemas/AgentGraphNode' AgentGraphNodeDetail: type: object required: [node, outgoing, incoming, truncated] properties: node: $ref: '#/components/schemas/AgentGraphNode' outgoing: type: array items: $ref: '#/components/schemas/AgentGraphNodeRelation' incoming: type: array items: $ref: '#/components/schemas/AgentGraphNodeRelation' truncated: type: boolean absolutePath: type: string AgentGraphSearchResponse: type: object required: [query, hits, byType] properties: query: type: string hits: type: array items: type: object required: [environmentId, node, score] properties: environmentId: type: string node: $ref: '#/components/schemas/AgentGraphNode' score: type: number absolutePath: type: string byType: type: object additionalProperties: type: integer AgentGraphPathResponse: type: object required: [from, to, found, nodes, edges] properties: from: type: string to: type: string found: type: boolean nodes: type: array items: $ref: '#/components/schemas/AgentGraphNode' edges: type: array items: $ref: '#/components/schemas/AgentGraphEdge' AgentGraphFileResponse: type: object required: [ environmentId, path, file, symbols, imports, importedBy, documentedBy, prompts, ] properties: environmentId: type: string path: type: string absolutePath: type: string file: allOf: - $ref: '#/components/schemas/AgentGraphNode' nullable: true language: type: string symbols: type: array items: $ref: '#/components/schemas/AgentGraphNode' imports: type: array items: $ref: '#/components/schemas/AgentGraphNode' importedBy: type: array items: $ref: '#/components/schemas/AgentGraphNode' documentedBy: type: array items: $ref: '#/components/schemas/AgentGraphNode' prompts: type: array description: Empty for PATs without `agent_chats:read` items: $ref: '#/components/schemas/AgentGraphPromptSummary' AgentGraphPromptReference: type: object required: [kind, type, ref, label] properties: kind: type: string enum: [attached, available, used, modified] type: type: string ref: type: string label: type: string path: type: string tool: type: string count: type: integer AgentGraphReferencesResponse: type: object required: [environmentId, prompts] properties: environmentId: type: string prompts: type: array items: $ref: '#/components/schemas/AgentGraphPromptSummary' prompt: allOf: - $ref: '#/components/schemas/AgentGraphPromptSummary' - type: object required: [references] properties: references: type: array items: $ref: '#/components/schemas/AgentGraphPromptReference' AgentGraphRefreshResponse: type: object required: [environmentId, queued, status] properties: environmentId: type: string queued: type: boolean status: $ref: '#/components/schemas/AgentGraphBuildStatus' AgentGraphWorkspaceSnapshotStatus: type: object required: [clientId, status, builtAt, error, nodes, edges] properties: clientId: type: string format: uuid status: $ref: '#/components/schemas/AgentGraphBuildStatus' builtAt: type: string format: date-time nullable: true error: type: string nullable: true nodes: type: integer edges: type: integer OpenAiError: type: object required: [error] properties: error: type: object required: [message, type, param, code] properties: message: type: string type: type: string description: invalid_request_error, permission_error, rate_limit_error or server_error param: type: string nullable: true code: type: string nullable: true OpenAiModel: type: object required: [id, object, created, owned_by] properties: id: type: string description: '`default` or an OpenCode `provider/model` id' object: type: string enum: [model] created: type: integer owned_by: type: string OpenAiModelList: type: object required: [object, data] properties: object: type: string enum: [list] data: type: array items: $ref: '#/components/schemas/OpenAiModel' OpenAiChatCompletionRequest: type: object required: [model, messages] additionalProperties: true description: | OpenAI Chat Completions request. Function tools are offered to the agent (client tools: the agent calls them, the client runs them); hosted / custom tool types are ignored. Fields without an Agenstra equivalent (temperature, top_p, max_tokens, response_format, …) are accepted and ignored. `n` must be 1. properties: model: type: string messages: type: array minItems: 1 items: type: object required: [role] properties: role: type: string enum: [system, developer, user, assistant, tool, function] tool_call_id: type: string description: 'Results of client tool calls (`role: tool`) continue the paused turn' name: type: string content: oneOf: - type: string - type: array items: type: object - type: 'null' stream: type: boolean tools: type: array maxItems: 128 items: type: object properties: type: type: string enum: [function] function: $ref: '#/components/schemas/OpenAiFunctionDefinition' tool_choice: description: "'auto', 'none', 'required', { type: 'function', function: { name } } or { type: 'allowed_tools', allowed_tools: { mode, tools } }" oneOf: - type: string enum: [auto, none, required] - type: object parallel_tool_calls: type: boolean functions: type: array deprecated: true items: $ref: '#/components/schemas/OpenAiFunctionDefinition' function_call: deprecated: true oneOf: - type: string enum: [auto, none] - type: object properties: name: type: string stream_options: type: object properties: include_usage: type: boolean chat_id: type: string description: Agenstra extension - chat session UUID or `conv_…` id tool_activity: type: boolean description: Agenstra extension - report the agent's own tool calls as `reasoning_content` (read-only) metadata: type: object additionalProperties: type: string OpenAiChatCompletion: type: object required: [id, object, created, model, choices, usage] properties: id: type: string object: type: string enum: [chat.completion] created: type: integer model: type: string system_fingerprint: type: string nullable: true choices: type: array items: type: object properties: index: type: integer message: type: object properties: role: type: string enum: [assistant] content: type: string refusal: type: string nullable: true reasoning_content: type: string description: Opt-in agent tool activity summary (one line per tool) tool_calls: type: array description: 'Client tool calls the client must run and answer with `role: tool` messages' items: type: object properties: id: type: string type: type: string enum: [function] function: type: object properties: name: type: string arguments: type: string function_call: type: object deprecated: true properties: name: type: string arguments: type: string finish_reason: type: string enum: [stop, content_filter, tool_calls, function_call] usage: $ref: '#/components/schemas/OpenAiUsage' OpenAiUsage: type: object properties: prompt_tokens: type: integer completion_tokens: type: integer total_tokens: type: integer prompt_tokens_details: type: object properties: cached_tokens: type: integer completion_tokens_details: type: object properties: reasoning_tokens: type: integer OpenAiResponseRequest: type: object required: [model, input] additionalProperties: true properties: model: type: string input: oneOf: - type: string - type: array items: type: object instructions: type: string conversation: oneOf: - type: string - type: object properties: id: type: string previous_response_id: type: string stream: type: boolean chat_id: type: string tool_activity: type: boolean description: Agenstra extension - report the agent's own tool calls as `mcp_call` output items (read-only) tools: type: array description: 'Function tools (`{ type: function, name, description, parameters }`) the agent may call; hosted tools are ignored' items: type: object tool_choice: oneOf: - type: string enum: [auto, none, required] - type: object parallel_tool_calls: type: boolean metadata: type: object additionalProperties: type: string OpenAiResponse: type: object required: [id, object, created_at, status, model, output] properties: id: type: string object: type: string enum: [response] created_at: type: integer status: type: string enum: [in_progress, completed, incomplete, failed] model: type: string output: type: array description: Assistant `message`; with tool activity also `mcp_call` items (tools the agent ran, read-only) items: oneOf: - type: object description: Assistant message - $ref: '#/components/schemas/OpenAiMcpCallItem' - $ref: '#/components/schemas/OpenAiFunctionCallItem' output_text: type: string previous_response_id: type: string nullable: true conversation: type: object nullable: true properties: id: type: string incomplete_details: type: object nullable: true error: type: object nullable: true usage: type: object nullable: true OpenAiConversationRequest: type: object properties: metadata: type: object additionalProperties: type: string description: '`title` names the chat session' OpenAiConversation: type: object required: [id, object, created_at, metadata] properties: id: type: string description: '`conv_`' object: type: string enum: [conversation] created_at: type: integer metadata: type: object additionalProperties: type: string OpenAiConversationItem: type: object required: [type, id, status, role, content] properties: type: type: string enum: [message] id: type: string status: type: string enum: [completed, incomplete] role: type: string enum: [user, assistant] content: type: array items: type: object properties: type: type: string enum: [input_text, output_text] text: type: string created_at: type: integer OpenAiMcpCallItem: type: object description: A tool the agent ran in its own workspace (server-side, never executed by the client) required: [type, id, server_label, name, arguments, status] properties: type: type: string enum: [mcp_call] id: type: string server_label: type: string enum: [agenstra] name: type: string arguments: type: string description: JSON-serialized arguments (truncated to 4000 characters) output: type: string nullable: true description: Tool output (truncated to 4000 characters) error: type: string nullable: true status: type: string enum: [in_progress, completed, failed] OpenAiFunctionDefinition: type: object required: [name] properties: name: type: string pattern: '^[a-zA-Z0-9_-]{1,64}$' description: type: string maxLength: 4096 parameters: type: object description: JSON schema of the arguments (at most 16 KB) strict: type: boolean OpenAiFunctionCallItem: type: object description: A client tool call of the agent; answer it with a `function_call_output` input item (`call_id`) required: [type, id, call_id, name, arguments, status] properties: type: type: string enum: [function_call] id: type: string call_id: type: string name: type: string arguments: type: string status: type: string enum: [in_progress, completed]