Submit Samples API
api
samples
ingest
Submit samples to a project via API
Send LLM interaction samples to a specific project. The API persists a Sample
and enqueues a pipeline run to populate auto-grades. The response returns thesampleId immediately.
Endpoint
- Method:
POST - URL:
https://boltfoundry.com/api/2025-10/teams/:teamSlug/projects/:projectSlug/samples/ingest - Example with placeholders:
https://boltfoundry.com/api/2025-10/teams/example-team/projects/example-project/samples/ingest
Auth
- Header:
X-BF-API-Key: bf_write_only_key_<id> - Content type:
Content-Type: application/json
Request body
Required
userInput(string)assistantResponse(string)
Optional
assistantContext(string) - conversation context before the turnlabel(string) - human-readable name; autogenerated if omittedreferenceData(object) - arbitrary JSON to help you track the samplerunMetadata(object) - extra JSON passed to the underlying runrequestId(string) - idempotency key (see below)
curl example
curl -X POST "https://boltfoundry.com/api/2025-10/teams/example-team/projects/example-project/samples/ingest" \
-H "Content-Type: application/json" \
-H "X-BF-API-Key: bf_write_only_key_<your_api_key_id>" \
--data-raw '{
"userInput": "Summarize the attached report",
"assistantResponse": "Here is the summary...",
"label": "Customer report QA #42",
"referenceData": { "ticketId": 42 }
}'
Response
- 200 OK
- Body:
{ "sampleId": "sample:..." }
- Body:
Idempotency (optional)
Provide a stable id to dedupe retries.
- Body field:
requestId: "<your-id>" - Or header:
X-BF-Event-ID: <your-id>
If the id matches a previous request for the same project, the API returns the
existing sampleId.
Errors
- 400
invalid_payload- body is missing required fields or has wrong types- Example:
{ "error": "invalid_payload", "message": "userInput is required and must be a string" }
- Example:
- 401
missing_api_key- noX-BF-API-Keyheader present - 401
invalid_api_key- key format or id is invalid - 403
organization_mismatch-:teamSlugin the URL does not match the API
key's organization - 404
project_not_found-:projectSlugis unknown for the organization - 405
method_not_allowed- method is notPOST - 500
internal_error- unexpected server error
Notes
- API version:
2025-10(current) - Auto-grades are linked asynchronously when the run completes; the sample is
usable immediately for adding reference grades.