Reference
API reference
Base URLs, authentication, errors, rate limits, tracing and the index of every gateway and control-plane operation.
GebSecure exposes two HTTP APIs, both versioned in the path (/v1). The operation pages are generated at build
time from the OpenAPI 3.1 documents docs/openapi/gateway.json
and docs/openapi/api.json, which
npm run openapi regenerates from the running route schemas — so this reference changes whenever the API does.
Response bodies come from the SDK model definitions (sdks/spec/models.json), listed on the Models
page.
| API | Base URL | For |
|---|---|---|
| Gateway (data plane) | https://gateway.gebsecure.com (local: http://localhost:4100) |
agents: authorize, execute, approvals polling, inspection and DLP, MCP, database queries, browser sessions, agent spans |
| Control plane | https://api.gebsecure.com (local: http://localhost:4000) |
people and tooling: auth and SSO, tenancy, agents and credentials, policies, approvals, vault, connections, audit, compliance, analytics |
A running API serves interactive Swagger UI at /docs outside production.
Authentication#
Send Authorization: Bearer <credential> where the credential is:
- an access token — an EdDSA-signed JWT from
POST /v1/auth/token(machines: client credentials,private_key_jwt, refresh tokens, RFC 8693 delegation exchange) or from a user session (POST /v1/auth/login, SSO). LifetimeACCESS_TOKEN_TTL(10 minutes by default); public keys atGET /.well-known/jwks.json; - an API key (
gsk_…).
Client secrets (gsa_…) are never bearer credentials — exchange them first:
curl -s "$GEBSECURE_API_URL/v1/auth/token" -H 'content-type: application/json' \
-d '{"grant_type":"client_credentials","client_secret":"gsa_…","scope":"authorize execute"}'
# {"access_token":"eyJ…","token_type":"Bearer","expires_in":600,"scope":"authorize execute"}Operations marked None (public endpoint) need no credential (sign-up, login, token, SAML metadata…). Every
other operation also checks the caller's permissions (for example policies:deploy, approvals:decide) and the
organization's access policies — see Identity.
Errors#
Errors are RFC 9457 application/problem+json. title is the machine-readable code and type links to its
documentation; requestId and traceId identify the request in logs and traces. This is a real response:
{
"type": "https://docs.gebsecure.com/errors/validation_failed",
"title": "validation_failed",
"status": 422,
"detail": "Request validation failed",
"instance": "/v1/authorize",
"details": { "issues": [{ "path": "/action", "message": "invalid action" }] },
"requestId": "07116e07-3d40-47ad-b8b8-d65bdc939b4d",
"traceId": "9e11433f523b00f9c8027642bea114ed"
}| Code | HTTP | Meaning |
|---|---|---|
bad_request |
400 | The request is malformed (unparseable JSON, wrong content type, an invalid header). |
payload_too_large |
413 | The request body exceeds the size limit (2 MiB) and was refused before parsing (HTTP 413). |
unsupported_media_type |
415 | The request body uses a content type the endpoint does not accept (HTTP 415). |
validation_failed |
422 | The request is well-formed but a field is missing or invalid. details lists the issues. |
unauthenticated |
401 | No credentials, or the credentials are invalid, expired or revoked. |
forbidden |
403 | The caller is authenticated but not allowed to do this. details.reason distinguishes organization access policies. |
not_found |
404 | The resource does not exist or is not visible to the caller (tenant isolation hides other organizations’ resources). |
conflict |
409 | The request conflicts with the current state of the resource. |
precondition_failed |
412 | A precondition of the operation is not met. |
rate_limited |
429 | Too many requests. The response carries Retry-After. |
quota_exceeded |
429 | A usage limit is exhausted. Reported as HTTP 429 like rate_limited. |
payment_required |
402 | The organization’s subscription is past due or suspended (HTTP 402). Usage is limited to Free plan quotas and plan changes are blocked until the balance is settled. |
approval_required |
403 | The operation needs a human approval before it can proceed. |
policy_denied |
403 | A policy denied the action. Denials of agent actions are normally results, not errors. |
upstream_error |
502 | A system GebSecure called on the caller’s behalf failed (connector API, MCP server, database). |
timeout |
504 | The operation did not complete in time (HTTP 504). |
unavailable |
503 | The service or a dependency is temporarily unavailable (HTTP 503). |
internal |
500 | An unexpected server error (HTTP 500). |
Denials and approval requirements of agent actions are results, not errors: POST /v1/authorize answers 200
with decision: "DENY" or "APPROVAL_REQUIRED", and POST /v1/execute answers with an ExecuteResult (403
denied, 202 awaiting_approval, 502/504 failed). forbidden responses caused by an organization access
policy carry details.reason (wrong_region, org_pending_deletion, ip_not_allowed, sso_required,
mfa_required) — see Troubleshooting.
Request and response conventions#
- JSON request and response bodies (
content-type: application/json), up to 2 MB per request. - Identifiers are prefixed (
agt_,pol_,apr_,env_,dec_…). - Pagination: list endpoints that paginate take
limitandcursorand return{data, nextCursor}; passnextCursorback ascursoruntil it isnull. The audit log also supportsafterSeqtailing. - Rate limits: authenticated requests are limited per principal (
RATE_LIMIT_AUTH_PER_MINUTE,RATE_LIMIT_TOKEN_PER_MINUTEand per-route groups); responses carryx-ratelimit-limitandx-ratelimit-remaining, and a 429 carriesRetry-After. - Idempotency:
POST /v1/executededuplicates on the body fieldidempotencyKey— the same key and request replay the original result (replayed: true), the same key with a different request is aconflict. - Tracing: send a W3C
traceparentto join your trace; every response carriestraceparentandx-request-id(you may supply your ownx-request-id, 8–128 characters ofA–Z a–z 0–9 . _ -). - Dry runs:
authorize,execute, DLP scans and database queries acceptdryRun: trueto evaluate without side effects.
Health and metadata#
Every service answers GET /healthz (liveness), GET /readyz (database and Redis reachable; 503 when degraded)
and GET /.well-known/jwks.json. GET /metrics (Prometheus) is internal and not routed by the ingress.
All operations#
Gateway (data plane) — 21 operations#
Authorization — POST /v1/authorize, POST /v1/authorize/batch
Approvals — GET /v1/approvals/{id}
Execution — POST /v1/execute, GET /v1/executions, GET /v1/executions/{id}, POST /v1/executions/{id}/cancel, POST /v1/executions/{id}/retry
Inspection & DLP — POST /v1/inspect, POST /v1/dlp/scan
MCP — GET /v1/mcp-servers, POST /v1/mcp, POST /v1/mcp/{server}
Tracing — POST /v1/traces/spans
Database gateway — POST /v1/db/query
Browser sessions — GET /v1/browser/sessions, POST /v1/browser/sessions, GET /v1/browser/sessions/{id}, DELETE /v1/browser/sessions/{id}, POST /v1/browser/sessions/{id}/actions, GET /v1/browser/sessions/{id}/replay
Control plane — 377 operations#
Authentication & sessions — POST /v1/auth/signup, POST /v1/auth/login, POST /v1/auth/mfa/challenge, GET /v1/me/mfa, POST /v1/me/mfa/enroll, POST /v1/me/mfa/confirm, POST /v1/me/mfa/verify, POST /v1/me/mfa/disable, POST /v1/me/mfa/recovery-codes, POST /v1/auth/refresh, POST /v1/auth/token, POST /v1/auth/logout, POST /v1/auth/switch-org, GET /v1/auth/me, GET /v1/auth/sessions, DELETE /v1/auth/sessions/{id}, POST /v1/auth/password, POST /v1/auth/sso/start, POST /v1/auth/sso/oidc/callback, POST /v1/auth/sso/exchange, GET /v1/auth/providers, POST /v1/auth/oauth/{provider}/start, GET /v1/auth/oauth/{provider}/callback, POST /v1/auth/oauth/exchange, GET /v1/me/identities, DELETE /v1/me/identities/{provider}, POST /v1/auth/sso/saml/acs/{id}
Members — POST /v1/members/{userId}/mfa/reset, POST /v1/invitations/accept, POST /v1/invitations/accept-new, GET /v1/members, PATCH /v1/members/{id}, DELETE /v1/members/{id}, GET /v1/invitations, POST /v1/invitations, PATCH /v1/invitations/{id}, DELETE /v1/invitations/{id}, POST /v1/invitations/bulk
Organizations — POST /v1/orgs, GET /v1/regions, GET /v1/org, PATCH /v1/org
Workspaces — GET /v1/workspaces, POST /v1/workspaces, PATCH /v1/workspaces/{id}, DELETE /v1/workspaces/{id}
Projects — GET /v1/projects, POST /v1/projects, GET /v1/projects/{id}, PATCH /v1/projects/{id}, DELETE /v1/projects/{id}, GET /v1/projects/{id}/role-bindings, POST /v1/projects/{id}/role-bindings, DELETE /v1/projects/{id}/role-bindings/{bindingId}
Environments — POST /v1/projects/{id}/environments, PATCH /v1/environments/{id}, DELETE /v1/environments/{id}
Teams — GET /v1/teams, POST /v1/teams, GET /v1/teams/{id}, DELETE /v1/teams/{id}, POST /v1/teams/{id}/members, DELETE /v1/teams/{id}/members/{userId}
Agents — GET /v1/agents, POST /v1/agents, GET /v1/agents/{id}, PATCH /v1/agents/{id}, DELETE /v1/agents/{id}, POST /v1/agents/{id}/status, GET /v1/agent-groups, POST /v1/agent-groups, GET /v1/agent-groups/{id}, PATCH /v1/agent-groups/{id}, DELETE /v1/agent-groups/{id}, POST /v1/agent-groups/{id}/members, GET /v1/agents/{id}/credentials, POST /v1/agents/{id}/credentials
Credentials — POST /v1/credentials/{id}/rotate, POST /v1/credentials/{id}/revoke
Service accounts — GET /v1/service-accounts, POST /v1/service-accounts, POST /v1/service-accounts/{id}/status, GET /v1/service-accounts/{id}/credentials, POST /v1/service-accounts/{id}/credentials
API keys — GET /v1/api-keys, POST /v1/api-keys, DELETE /v1/api-keys/{id}
Applications — GET /v1/applications, POST /v1/applications, POST /v1/applications/{id}/credentials
Audit — GET /v1/audit/events, GET /v1/audit/events/{id}, GET /v1/audit/export, POST /v1/audit/verify
Policies — GET /v1/policies, POST /v1/policies, GET /v1/policies/{id}, PUT /v1/policies/{id}, DELETE /v1/policies/{id}, GET /v1/policies/{id}/versions/{versionId}, GET /v1/policies/{id}/diff, GET /v1/policies/{id}/deployments, POST /v1/policies/{id}/deploy, POST /v1/policies/{id}/rollback, POST /v1/policies/{id}/tests, PUT /v1/policies/{id}/tests, DELETE /v1/policies/{id}/tests/{testId}, POST /v1/policies/{id}/tests/run, POST /v1/policies/validate, POST /v1/policies/simulate, GET /v1/policies/conflicts, GET /v1/policy-templates
Authorization (control plane) — GET /v1/authz/roles, POST /v1/authz/roles, PATCH /v1/authz/roles/{id}, DELETE /v1/authz/roles/{id}, POST /v1/authz/role-bindings, DELETE /v1/authz/role-bindings/{id}, GET /v1/authz/relationships, POST /v1/authz/relationships
Risk — GET /v1/risk/assessments, GET /v1/risk/dashboard, PATCH /v1/risk/config, GET /v1/risk/rules, POST /v1/risk/rules, PATCH /v1/risk/rules/{id}, DELETE /v1/risk/rules/{id}
Approvals — GET /v1/approvals, GET /v1/approvals/{id}, POST /v1/approvals/{id}/decision, POST /v1/approvals/{id}/cancel, POST /v1/approvals/{id}/comments
Delegation — GET /v1/delegations, POST /v1/delegations, GET /v1/delegations/graph, GET /v1/delegations/{id}/chain, POST /v1/delegations/{id}/revoke
Webhooks — GET /v1/event-types, GET /v1/webhooks, POST /v1/webhooks, PATCH /v1/webhooks/{id}, DELETE /v1/webhooks/{id}, POST /v1/webhooks/{id}/verify, POST /v1/webhooks/{id}/rotate-secret, POST /v1/webhooks/{id}/test, GET /v1/webhooks/{id}/deliveries, POST /v1/webhook-deliveries/{id}/replay
Notifications — GET /v1/notification-channels, POST /v1/notification-channels, POST /v1/notification-channels/{id}/test, DELETE /v1/notification-channels/{id}, POST /v1/chat-identities
Vault (secrets) — GET /v1/secrets, POST /v1/secrets, GET /v1/secrets/{id}, PATCH /v1/secrets/{id}, DELETE /v1/secrets/{id}, POST /v1/secrets/{id}/rotate, POST /v1/secrets/{id}/revoke
Connectors & connections — GET /v1/connectors, GET /v1/connectors/{key}, POST /v1/connectors/rest/import, POST /v1/connectors/rest/import/policy, GET /v1/connections, POST /v1/connections, GET /v1/connections/{id}, PATCH /v1/connections/{id}, DELETE /v1/connections/{id}, GET /v1/connections/{id}/onboarding, POST /v1/connections/{id}/onboarding/plan, POST /v1/connections/{id}/onboarding/draft, POST /v1/connections/{id}/onboarding/apply, POST /v1/connections/{id}/health, POST /v1/connections/{id}/oauth/start, POST /v1/connections/{id}/oauth/client-credentials, POST /v1/connections/{id}/oauth/jwt-bearer, POST /v1/connections/oauth/callback, POST /v1/connections/{id}/oauth/account, GET /v1/oauth-apps, PUT /v1/oauth-apps/{provider}, DELETE /v1/oauth-apps/{provider}
Bulk Operations — GET /v1/bulk-operations, POST /v1/bulk-operations, GET /v1/bulk-operations/{id}, POST /v1/bulk-operations/{id}/cancel, POST /v1/bulk-operations/{id}/retry
Execution — GET /v1/executions, POST /v1/executions, GET /v1/executions/{id}, POST /v1/executions/{id}/cancel, POST /v1/executions/{id}/retry
DLP — GET /v1/dlp/config, POST /v1/dlp/rules, PATCH /v1/dlp/rules/{id}, DELETE /v1/dlp/rules/{id}, PUT /v1/dlp/default-rules, POST /v1/dlp/detectors, DELETE /v1/dlp/detectors/{id}, POST /v1/dlp/scan, GET /v1/dlp/events, GET /v1/dlp/dashboard
Prompt injection — GET /v1/injection/policy, PATCH /v1/injection/policy, GET /v1/injection/detections, DELETE /v1/injection/taint/{id}, POST /v1/inspect
Detection & alerts — GET /v1/alerts, GET /v1/alerts/{id}, PATCH /v1/alerts/{id}, GET /v1/detection/config, PATCH /v1/detection/config, GET /v1/detection/analytics
Simulation — POST /v1/simulations/run, GET /v1/simulations/runs, GET /v1/simulations/runs/{id}, GET /v1/simulations/runs/{id}/report, GET /v1/simulations/library, GET /v1/simulations/scenario-sets, POST /v1/simulations/scenario-sets, GET /v1/simulations/scenario-sets/{id}, PATCH /v1/simulations/scenario-sets/{id}, DELETE /v1/simulations/scenario-sets/{id}
Tracing — GET /v1/traces, GET /v1/traces/stats, GET /v1/traces/{traceId}, GET /v1/replay/{principalId}
Evaluation — GET /v1/evaluations/suites, GET /v1/evaluations, POST /v1/evaluations, GET /v1/evaluations/{id}, PATCH /v1/evaluations/{id}, DELETE /v1/evaluations/{id}, POST /v1/evaluations/{id}/run, GET /v1/evaluations/{id}/runs, GET /v1/evaluation-runs/{id}, GET /v1/evaluation-runs/{id}/report
Analytics — GET /v1/analytics/overview, GET /v1/analytics/agents, GET /v1/analytics/security, GET /v1/analytics/authorization, GET /v1/analytics/executions, GET /v1/analytics/approvals, GET /v1/analytics/risk, GET /v1/analytics/usage, GET /v1/analytics/costs, GET /v1/analytics/settings, PATCH /v1/analytics/settings, GET /v1/analytics/alert-rules, POST /v1/analytics/alert-rules, PATCH /v1/analytics/alert-rules/{id}, DELETE /v1/analytics/alert-rules/{id}, GET /v1/analytics/export
SSO — GET /v1/sso/connections, POST /v1/sso/connections, PATCH /v1/sso/connections/{id}, DELETE /v1/sso/connections/{id}, GET /v1/sso/saml/{id}/metadata, GET /v1/sso/domains, POST /v1/sso/domains, POST /v1/sso/domains/{id}/verify, POST /v1/sso/domains/{id}/regenerate-token, DELETE /v1/sso/domains/{id}, GET /v1/sso/group-mappings, POST /v1/sso/group-mappings, DELETE /v1/sso/group-mappings/{id}
Governance — GET /v1/readiness, GET /v1/approval-rules, POST /v1/approval-rules, POST /v1/approval-rules/plan, GET /v1/roles/custom, POST /v1/roles/custom, PATCH /v1/roles/custom/{id}, DELETE /v1/roles/custom/{id}, GET /v1/governance/sod-rules, POST /v1/governance/sod-rules, PATCH /v1/governance/sod-rules/{id}, DELETE /v1/governance/sod-rules/{id}, GET /v1/governance/sod-violations, GET /v1/governance/admin-policies, PUT /v1/governance/admin-policies, GET /v1/governance/access-reviews, POST /v1/governance/access-reviews, GET /v1/governance/access-reviews/{id}, POST /v1/governance/access-reviews/{id}/items/{itemId}/decision, POST /v1/governance/access-reviews/{id}/complete, POST /v1/governance/access-reviews/{id}/cancel, GET /v1/governance/access-reviews/{id}/export
SCIM tokens — GET /v1/scim/tokens, POST /v1/scim/tokens, DELETE /v1/scim/tokens/{id}
Compliance — GET /v1/compliance/controls, GET /v1/compliance/encryption, POST /v1/compliance/evidence/collect, GET /v1/compliance/evidence, GET /v1/compliance/evidence/{id}, POST /v1/compliance/reports, GET /v1/compliance/retention, PATCH /v1/compliance/retention, POST /v1/compliance/data-requests/export, POST /v1/compliance/data-requests/erasure, GET /v1/compliance/data-requests, POST /v1/org/deletion, DELETE /v1/org/deletion
Incidents — GET /v1/incidents, POST /v1/incidents, GET /v1/incidents/{id}, PATCH /v1/incidents/{id}
SIEM — GET /v1/siem/destinations, POST /v1/siem/destinations, PATCH /v1/siem/destinations/{id}, DELETE /v1/siem/destinations/{id}
MCP — GET /v1/mcp/servers, POST /v1/mcp/servers, GET /v1/mcp/servers/{id}, PATCH /v1/mcp/servers/{id}, DELETE /v1/mcp/servers/{id}, POST /v1/mcp/servers/{id}/refresh, POST /v1/mcp/servers/{id}/tools/{tool}/review, GET /v1/mcp/servers/{id}/onboarding, POST /v1/mcp/servers/{id}/onboarding/plan, POST /v1/mcp/servers/{id}/onboarding/draft, POST /v1/mcp/servers/{id}/onboarding/apply, POST /v1/mcp/servers/{id}/tools/review, GET /v1/mcp/sessions, GET /v1/mcp/sessions/{id}
Database gateway — GET /v1/database/connections, POST /v1/database/connections, GET /v1/database/connections/{id}, PATCH /v1/database/connections/{id}, DELETE /v1/database/connections/{id}, GET /v1/database/connections/{id}/policy, PUT /v1/database/connections/{id}/policy, GET /v1/database/connections/{id}/onboarding, POST /v1/database/connections/{id}/onboarding/plan, POST /v1/database/connections/{id}/onboarding/draft, POST /v1/database/connections/{id}/onboarding/apply, POST /v1/database/connections/{id}/test, GET /v1/database/queries, GET /v1/database/queries/{id}
Browser sessions — GET /v1/browser/settings, PUT /v1/browser/settings, GET /v1/browser/profiles, POST /v1/browser/profiles, PATCH /v1/browser/profiles/{id}, DELETE /v1/browser/profiles/{id}, GET /v1/browser/sessions, GET /v1/browser/sessions/{id}, GET /v1/browser/sessions/{id}/replay, GET /v1/browser/sessions/{id}/artifacts/{artifactId}, POST /v1/browser/sessions/{id}/terminate
Billing — GET /v1/billing/plans, GET /v1/billing/entitlements, GET /v1/billing/subscription, GET /v1/billing/usage, GET /v1/billing/upcoming-invoice, GET /v1/billing/plan-change-preview, POST /v1/billing/subscription/plan, POST /v1/billing/subscription/cancel, POST /v1/billing/subscription/resume, GET /v1/billing/invoices, GET /v1/billing/invoices/{id}, GET /v1/billing/invoices/{id}/html, GET /v1/billing/invoices/{id}/pdf, GET /v1/billing/profile, PATCH /v1/billing/profile, POST /v1/billing/payment-methods/setup-intent, GET /v1/billing/payment-methods, POST /v1/billing/payment-methods/{id}/default, GET /v1/billing/alert-rules, POST /v1/billing/alert-rules, DELETE /v1/billing/alert-rules/{id}
Platform — GET /v1/support-access, GET /v1/support-access/policy, PUT /v1/support-access/policy, POST /v1/support-access/{id}/{action}, GET /v1/status/incidents, GET /v1/feature-flags