API reference
Use the production API URL assigned to your workspace. Send your workspace key as a Bearer token as shown in Authenticate. The schemas below describe the API envelope. Use the input and output schemas supplied for your assigned model to build the decision payload.
Download OpenAPI contract (.json)Append a corrected outcome
POST /v1/decisions/{decision_id}/corrections
Path and header parameters
decision_id(path, required)
Request body schema
{
"additionalProperties": false,
"properties": {
"output": {
"additionalProperties": false,
"properties": {
"choice": {
"type": "string"
}
},
"required": [
"choice"
],
"type": "object"
},
"reason": {
"maxLength": 500,
"type": "string"
}
},
"required": [
"output",
"reason"
],
"type": "object"
}Responses and errors
201 · Successful response
{
"properties": {
"decision_id": {
"format": "uuid",
"type": "string"
},
"decision_revision": {
"minimum": 1,
"type": "integer"
},
"output": {
"properties": {
"choice": {
"type": "string"
}
},
"required": [
"choice"
],
"type": "object"
}
},
"required": [
"decision_id",
"decision_revision",
"output"
],
"type": "object"
}400 · Invalid correction.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}401 · Missing, invalid or revoked workspace key.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}403 · The key lacks correction scope.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}404 · Decision unavailable in this workspace.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}409 · The decision revision was invalidated.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}503 · Decision or policy schema unavailable.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}Execute a published model
POST /v1/models/{slug}/execute
Path and header parameters
slug(path, required)Idempotency-Key(header, optional). Replays the same successful request for 24 hours.
Request body schema
{
"additionalProperties": false,
"properties": {
"inputs": {
"type": "object"
},
"reference_id": {
"maxLength": 256,
"type": "string"
}
},
"required": [
"inputs"
],
"type": "object"
}Responses and errors
200 · Successful response
{
"properties": {
"cached": {
"type": "boolean"
},
"decision_id": {
"format": "uuid",
"type": "string"
},
"decision_revision": {
"minimum": 1,
"type": "integer"
},
"execution_id": {
"format": "uuid",
"type": "string"
},
"model": {
"pattern": "^[-a-zA-Z0-9_]+$",
"type": "string"
},
"output": {
"properties": {
"choice": {
"type": "string"
}
},
"required": [
"choice"
],
"type": "object"
},
"policy_version": {
"minimum": 1,
"type": "integer"
},
"processing_time_ms": {
"minimum": 0,
"type": "integer"
},
"reference_id": {
"nullable": true,
"type": "string"
},
"source": {
"enum": [
"ai",
"memory"
],
"type": "string"
},
"status": {
"enum": [
"completed",
"provisional"
],
"type": "string"
}
},
"required": [
"execution_id",
"decision_id",
"decision_revision",
"reference_id",
"model",
"policy_version",
"status",
"output",
"source",
"cached",
"processing_time_ms"
],
"type": "object"
}400 · Invalid input or idempotency key.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}401 · Missing, invalid or revoked workspace key.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}404 · Published model unavailable in this workspace.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}409 · Idempotency key was used with a different request.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}503 · Decision unavailable or a matching request is in progress.
Retry-After· Present for decision_busy.
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}