SparkientDocs
Api reference

Examples

GET
/api/v1/decision-types/{decision_type_id}/examples

List training examples with filtering and 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

Path Parameters

decision_type_id*Decision Type Id
Formatuuid

Query Parameters

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

Filter by source: user, synthetic

reviewed?|

Filter by reviewed status

Response Body

application/json

application/json

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

Upload user-provided training examples.

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 bulk-creating training examples.

Accepts either the canonical {"examples": [...]} envelope or a bare JSON array [{...}, ...] for convenience. The latter is silently wrapped before validation.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08/examples" \  -H "Content-Type: application/json" \  -d '{    "examples": [      {        "input_payload": {}      }    ]  }'
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "input_payload": {},    "expected_decision": "string",    "confidence": 0,    "reason_codes": [      "string"    ],    "source": "string",    "reviewed": true,    "created_at": "2019-08-24T14:15:22Z"  }]
POST
/api/v1/decision-types/{decision_type_id}/examples/generate

Generate synthetic training examples using the teacher model.

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.

Request to generate synthetic training examples via LLM.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/decision-types/497f6eca-6276-4993-bfeb-53cbbbba6f08/examples/generate" \  -H "Content-Type: application/json" \  -d '{}'
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "input_payload": {},    "expected_decision": "string",    "confidence": 0,    "reason_codes": [      "string"    ],    "source": "string",    "reviewed": true,    "created_at": "2019-08-24T14:15:22Z"  }]
GET
/api/v1/decision-types/{decision_type_id}/examples/stats

Get a summary of training data distribution without paginating through all examples. Returns counts by source (user/synthetic), by decision option, and totals.

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/examples/stats"
{  "total": 0,  "labelled": 0,  "unlabelled": 0,  "by_source": {    "property1": 0,    "property2": 0  },  "by_decision": {    "property1": 0,    "property2": 0  },  "options": [    "string"  ],  "max_allowed": 5000}
DELETE
/api/v1/decision-types/{decision_type_id}/examples/{example_id}

Delete a single training example.

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
example_id*Example Id
Formatuuid

Response Body

application/json

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