Skip to main content

API Reference

Base URL: https://api.sandbox.openprodkt.com

Interactive docs: Swagger UI and OpenAPI JSON

This reference is organized by module so customers can find the surface they need without needing to know the implementation details behind it.

Prefer a language client? See SDKs.

Conventions​

List endpoints accept limit (1-100, default 25) and offset, and return total alongside the results. Most also accept search for case-insensitive partial matching.

GET /v1/assets?limit=25&offset=0&search=invoice

Write operations additionally require an appropriate role. See Auth and Access.

Public endpoints​

MethodPathDescription
GET/healthHealth check
GET/docsInteractive API docs
GET/swaggerInteractive API docs (legacy alias)
GET/openapi.jsonOpenAPI schema (JSON)
GET/openapi.yamlOpenAPI schema (YAML)

Authentication​

OpenProdkt uses two credential types:

  1. JWT for human Console sessions.
  2. API keys for machine workloads.

Header format:

Authorization: Bearer <jwt-or-api-key>

Identity and workspace​

This module covers organization setup, sign-in, profile access, settings, and member invites.

MethodPathPurpose
POST/auth/registerCreate an organization and first owner
GET/auth/onboarding-requests/{id}Check onboarding request status
POST/auth/request-codeRequest one-time login code
POST/auth/verifyExchange code for JWT
POST/auth/logoutRevoke the current session
GET/meCurrent user profile
GET/settingsWorkspace settings
GET/membersList workspace members
POST/membersInvite workspace member
POST/members/{id}/activateReactivate a member
POST/members/{id}/deactivateDeactivate a member

Register example:

{
"organizationName": "Acme Ltd",
"email": "owner@acme.com"
}

Governance decisions​

This module covers decision evaluation and the playground. Applications call /v1/evaluate through an SDK or framework adapter. The transparent proxy calls /v1/proxy/evaluate. Both use the same canonical request.

MethodPathCallerPurpose
POST/v1/evaluateSDKs and framework adaptersAuthorize an operation
POST/v1/proxy/evaluateTransparent proxy (requires proxy.enabled)Authorize a proxied request; never returns 202
POST/v1/playground/decisionConsole playgroundTest a policy; not an application contract

Request example:

{
"version": "v1",
"asset": { "id": "ast_e8f1a2c3" },
"operation_id": "pay-2026-001",
"transport": { "kind": "http" },
"metadata": {
"operation": "payment.execute",
"amount": 12000,
"currency": "USD"
}
}

operation_id is required and must identify one business operation. Put all context inside metadata. Top-level action, amount, and workflow fields are rejected with 400.

Typical pending response (/v1/evaluate, HTTP 202):

{
"version": "v1",
"operation_id": "pay-2026-001",
"decision": "approval_required",
"decisionId": "dec_9f2a1c4e",
"approvalId": "apr_5c6d7e8f",
"approvalStatus": "pending",
"payload_hash": "sha256:<hash>",
"approval_expires_at": "2026-09-13T11:15:00Z"
}

Status codes:

StatusMeaning
200Allowed, including a validated redemption of an approved operation
202Approval pending (/v1/evaluate only)
400Invalid request
402Decision, approval, or notification quota exhausted
403Denied, or the approval is rejected, expired, revoked, or consumed. On /v1/proxy/evaluate, a pending approval also returns 403 with a challenge
404Referenced approval does not exist
409asset_identity_conflict, operation_id_conflict, approval_retry_mismatch, or operation_in_progress
503Policy evaluation failed; the request fails closed

Inventory​

This module covers the inventory concepts customers use to describe what they are governing.

MethodPath
GET, POST/v1/assets
PATCH, DELETE/v1/assets/{id}
GET, POST/v1/groups
PATCH, DELETE/v1/groups/{id}
GET/v1/integration-presets

Asset discovery​

Detection points report assets that are not yet registered. Requires the asset_discovery:write scope.

MethodPathPurpose
POST/v1/asset-discoveriesSubmit an observation
GET/v1/asset-discoveriesList pending observations
DELETE/v1/asset-discoveries/{id}Dismiss an observation

Discovery is observation only. It does not evaluate a policy, return an outcome, or create a decision. The discovery_id you supply is the idempotency key, so repeated sightings aggregate rather than duplicate.

{
"discovery_id": "dsc_01J...",
"asset": {
"key": "billing.refund-api",
"displayName": "Billing Refund API",
"kind": "rest_api",
"environment": "production"
},
"metadata": { "operation": "refund", "amount": 250 }
}

Asset example:

{
"name": "invoice-agent",
"environment": "sandbox",
"group": "payments"
}

Group example:

{
"name": "payments",
"approvers": "finance-lead@acme.com,owner@acme.com"
}

Policies​

This module covers policy creation and lifecycle.

MethodPath
GET, POST/v1/policies
PATCH, DELETE/v1/policies/{id}
POST/v1/policies/{id}/clone
GET/v1/policies/{id}/revisions
PATCH/v1/policies/{id}/activation
POST/v1/policies/{id}/rollback

Every change to a policy creates a revision. rollback restores an earlier revision and records the rollback as a new revision, so history is never discarded.

Policy condition example:

{
"field": "amount",
"operator": ">",
"value": 5000
}

Approvals and history​

This module covers the review queue and traceability surfaces. See Approvals & Webhooks for the full delivery model (webhook, app-managed retry, short wait, polling).

MethodPathPurpose
GET/v1/approvalsList pending/resolved approvals
GET/v1/approvals/{id}Get a single approval (polling/short-wait)
POST/v1/approvals/{id}/approveApprove decision
POST/v1/approvals/{id}/rejectReject decision
POST/v1/approvals/{id}/revokeRevoke a pending or approved approval
GET/v1/decision-explorerDecision history
GET/v1/auditAudit trail
GET/v1/usageUsage counters

Approval example:

{
"id": "apr_5c6d7e8f",
"decisionId": "dec_9f2a1c4e",
"assetId": "invoice-agent",
"policyId": "pol_8a1b2c3d",
"requesterId": "key_4f5e6d7c",
"status": "pending",
"expiresAt": "2026-09-13T11:15:00Z"
}

Webhooks​

Register an endpoint to receive signed, async approval lifecycle events — the recommended delivery model over polling. See Approvals & Delivery.

MethodPathPurpose
GET, POST/v1/webhooksList / register a webhook endpoint
POST/v1/webhooks/{id}/rotateRotate the signing secret
DELETE/v1/webhooks/{id}Remove a webhook endpoint

Event types: approval.pending, approval.approved, approval.rejected, approval.expired, and approval.revoked. Each delivery includes X-OpenProdkt-Event-Id and X-OpenProdkt-Timestamp headers. X-OpenProdkt-Signature uses the form v1=sha256=<hex> and contains an HMAC-SHA256 of the exact timestamp header, a period, and the raw request body, using the endpoint secret (shown once, at creation or rotation).

Access and permissions​

This module covers API keys and machine permissions.

MethodPath
GET, POST/v1/api-keys
POST/v1/api-keys/{id}/rotate
POST/v1/api-keys/{id}/revoke

Delivery and integrations​

This module covers the public API and SDK contract.

SurfacePath
API docs/swagger
OpenAPI schema/openapi.json

Response expectations​

  1. Success responses return JSON.
  2. Validation errors return 400.
  3. Authentication failures return 401.
  4. Permission failures return 403.
  5. State conflicts return 409.
  6. Rate or quota limits return 429.

Only 429 and 5xx responses are worth retrying. See the Developer Guide for retry and pagination guidance.

Source of truth​

Use /openapi.json for exact request and response schemas.