SparkientDocs
Api reference

Decision types

GET
/api/v1/decision-types

List all decision types with pagination.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Query Parameters

page?Page
Range1 <= value
Default1
page_size?Page Size
Range1 <= value <= 100
Default20

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/decision-types"
{}
POST
/api/v1/decision-types

Create a new decision type with its first version.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Payload for creating a new decision type.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/decision-types" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "options": [      "string",      "string"    ]  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "active_version": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "version_number": 0,    "options": [      "string"    ],    "reason_codes": [      "string"    ],    "hard_rules": [      {}    ],    "input_schema": {},    "confidence_thresholds": {},    "escalation_policy": {},    "created_at": "2019-08-24T14:15:22Z"  },  "pii_fields": [],  "retention_days": 0,  "fallback_option": "string",  "model_deployed": false,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/api/v1/decision-types/{decision_type_id}

Get a decision type by ID with its active version.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Path Parameters

decision_type_id*Decision Type Id
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "active_version": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "version_number": 0,    "options": [      "string"    ],    "reason_codes": [      "string"    ],    "hard_rules": [      {}    ],    "input_schema": {},    "confidence_thresholds": {},    "escalation_policy": {},    "created_at": "2019-08-24T14:15:22Z"  },  "pii_fields": [],  "retention_days": 0,  "fallback_option": "string",  "model_deployed": false,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/api/v1/decision-types/{decision_type_id}

Soft-delete a decision type.

Sets deleted_at so the row is excluded from all queries. Associated data (versions, examples, policies, logs) is preserved for audit purposes.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Path Parameters

decision_type_id*Decision Type Id
Formatuuid

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
PUT
/api/v1/decision-types/{decision_type_id}

Update a decision type.

Only creates a new immutable version when logic fields change (options, reason_codes, hard_rules, input_schema, confidence_thresholds, escalation_policy). Metadata-only changes (name, description, pii_fields, retention_days) update the DecisionType row without bumping the version.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Path Parameters

decision_type_id*Decision Type Id
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Payload for updating a decision type (all fields optional).

Response Body

application/json

application/json

curl -X PUT "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "active_version": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "version_number": 0,    "options": [      "string"    ],    "reason_codes": [      "string"    ],    "hard_rules": [      {}    ],    "input_schema": {},    "confidence_thresholds": {},    "escalation_policy": {},    "created_at": "2019-08-24T14:15:22Z"  },  "pii_fields": [],  "retention_days": 0,  "fallback_option": "string",  "model_deployed": false,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/api/v1/decision-types/{decision_type_id}/versions

List all versions for a decision type.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Path Parameters

decision_type_id*Decision Type Id
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "version_number": 0,    "options": [      "string"    ],    "reason_codes": [      "string"    ],    "hard_rules": [      {}    ],    "input_schema": {},    "confidence_thresholds": {},    "escalation_policy": {},    "created_at": "2019-08-24T14:15:22Z"  }]
GET
/api/v1/decision-types/{decision_type_id}/versions/{version_id}

Get a specific version of a decision type.

Authorization

AuthorizationBearer <token>

A 64-character hexadecimal Sparkient API key. Create a key in the Sparkient dashboard and send it as Authorization: Bearer YOUR_API_KEY.

In: header

Path Parameters

decision_type_id*Decision Type Id
Formatuuid
version_id*Version Id
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "version_number": 0,  "options": [    "string"  ],  "reason_codes": [    "string"  ],  "hard_rules": [    {}  ],  "input_schema": {},  "confidence_thresholds": {},  "escalation_policy": {},  "created_at": "2019-08-24T14:15:22Z"}