API docs
API reference

Outcome sources

Turn the results your systems already record into the cases a model is scored against.

An outcome source connects a system of record and keeps an evaluation file current from it. Where a source maps records onto the chat format to train on, an outcome source names the two fields that make a scored case: the field holding the case and the field holding the result your business already wrote down for it. Point it at the CRM, the ticketing queue or the ERP where the answer lives, and every refresh writes a fresh set of cases with their real outcomes.

That is what turns a score into a business measure. The model is not being judged against a public benchmark; it is being judged against what actually happened, on the same records your team is already accountable for.

Reference it from a benchmark and every evaluation scores against the current rows, so a model can be re-scored as new records arrive and the result compared with every release before it.

An outcome source starts in connecting while its credentials are checked and its first records are read, then settles at ready or error. Each refresh runs running and then succeeded or failed, and the file it writes goes through the same validation every upload does. The source's file_id always names the latest ready version.

type is the catalogue slug of the system you are connecting, the same catalogue the training sources draw on, for example salesforce, zendesk or postgresql. The catalogue of 95 sources is on the Data connectors page of the Nucleus AI website.

Create an outcome source

POST/v1/outcome-sourcesscope: train

Connects a system of record and schedules its first read. Connecting is not idempotent: retrying a timed-out request can create a duplicate. Send an Idempotency-Key header if your client retries automatically. See Errors and retries.

Body parameters

typestringrequired

The catalogue slug of the system, for example zendesk.

credentialsobjectrequired

The connection details for that system, in the shape its catalogue entry documents.

case_fieldstringrequired

The field holding the case the model is asked about, for example the body of a ticket.

outcome_fieldstringrequired

The field holding the result the system recorded, for example the queue a ticket was routed to or whether it closed inside its SLA. This is what the model's answer is scored against.

filterstring

An expression selecting which records are used, so closed records or one product line can be scored on their own.

refreshstringdefault: manual

How often the source refreshes: hourly, daily, weekly or manual. A manual source refreshes only when you call Refresh an outcome source.

project_idstring

Attach the source to a project. Keys bound to a different project cannot read it.

curl https://api.nucleus-ai.io/v1/outcome-sources \
  -H "Authorization: Bearer $NUCLEUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "zendesk",
    "credentials": { "subdomain": "acme", "api_token": "..." },
    "case_field": "description",
    "outcome_field": "assignee_group",
    "filter": "status == \"closed\"",
    "refresh": "daily"
  }'
200 OK
{
  "id": "osrc_2Km",
  "type": "zendesk",
  "status": "connecting",
  "case_field": "description",
  "outcome_field": "assignee_group",
  "refresh": "daily",
  "file_id": null,
  "cases": null,
  "created_at": "2026-09-08T09:04:00Z"
}

List outcome sources

GET/v1/outcome-sourcesscope: read

Returns your connected outcome sources, newest first. See Pagination for how limit, offset and the cursor object behave across list endpoints.

Query parameters

typestring

Filter to one catalogue slug, for example zendesk.

statusstring

Filter to one status: connecting, ready or error.

project_idstring

Only sources in this project.

limitinteger

Maximum number of sources to return.

offsetinteger

Number of sources to skip from the start of the list.

curl "https://api.nucleus-ai.io/v1/outcome-sources?status=ready" \
  -H "Authorization: Bearer $NUCLEUS_API_KEY"
200 OK
{
  "outcome_sources": [
    {
      "id": "osrc_2Km",
      "type": "zendesk",
      "status": "ready",
      "cases": 1200,
      "refresh": "daily",
      "refreshed_at": "2026-09-08T04:00:00Z"
    }
  ]
}

Retrieve an outcome source

GET/v1/outcome-sources/{outcome_source_id}scope: read

Returns one outcome source, including its field mapping, its schedule and the file it currently writes to. Poll it after connecting and after a refresh; status and the last refresh record report where it sits in its schedule.

Path parameters

outcome_source_idstringrequired

ID of the outcome source.

curl https://api.nucleus-ai.io/v1/outcome-sources/osrc_2Km \
  -H "Authorization: Bearer $NUCLEUS_API_KEY"
200 OK
{
  "id": "osrc_2Km",
  "type": "zendesk",
  "status": "ready",
  "case_field": "description",
  "outcome_field": "assignee_group",
  "filter": "status == \"closed\"",
  "refresh": "daily",
  "file_id": "file_4kEv1",
  "cases": 1200,
  "refreshed_at": "2026-09-08T04:00:00Z",
  "created_at": "2026-09-08T09:04:00Z"
}

Update an outcome source

PATCH/v1/outcome-sources/{outcome_source_id}scope: train

Changes the field mapping, the filter or the schedule. Send only the fields you are changing. A change to case_field, outcome_field or filter takes effect on the next refresh, so call Refresh an outcome source if you want it applied now.

Path parameters

outcome_source_idstringrequired

ID of the outcome source.

Body parameters

case_fieldstring

A new field to read the case from.

outcome_fieldstring

A new field to read the recorded result from.

filterstring

A new expression selecting which records are used.

refreshstring

A new schedule: hourly, daily, weekly or manual.

curl -X PATCH https://api.nucleus-ai.io/v1/outcome-sources/osrc_2Km \
  -H "Authorization: Bearer $NUCLEUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "refresh": "hourly" }'
200 OK
{
  "id": "osrc_2Km",
  "type": "zendesk",
  "status": "ready",
  "refresh": "hourly",
  "refreshed_at": "2026-09-08T04:00:00Z"
}

Refresh an outcome source

POST/v1/outcome-sources/{outcome_source_id}/refreshscope: train

Reads the system now, without waiting for the schedule. Use it after changing a mapping, or to pick up records written since the last run. The refresh runs asynchronously and returns 202 Accepted with the refresh record.

Path parameters

outcome_source_idstringrequired

ID of the outcome source.

curl -X POST https://api.nucleus-ai.io/v1/outcome-sources/osrc_2Km/refresh \
  -H "Authorization: Bearer $NUCLEUS_API_KEY"
202 Accepted
{
  "id": "osrf_8Vt",
  "outcome_source": "osrc_2Km",
  "status": "running",
  "started_at": "2026-09-08T10:15:00Z"
}

Disconnect an outcome source

DELETE/v1/outcome-sources/{outcome_source_id}scope: train

Disconnects the system and stops the schedule. The files it has already written are kept and any benchmark built on them keeps working; the set simply stops updating.

Path parameters

outcome_source_idstringrequired

ID of the outcome source.

curl -X DELETE https://api.nucleus-ai.io/v1/outcome-sources/osrc_2Km \
  -H "Authorization: Bearer $NUCLEUS_API_KEY"
200 OK
{
  "id": "osrc_2Km",
  "deleted": true
}
Outcome sources | Nucleus AI API