Skip to content
Dashboard

List training files

GET/v2/training_data/files

Returns uploaded training files, newest first, with cursor pagination. Filter by externalId (exact) or source. The extracted text is omitted from list responses — compare contentHash to detect changes, and retrieve a single file to read it.

Query ParametersExpand Collapse
cursor: optional string

An opaque cursor for pagination. Use the nextCursor value from a previous response to fetch the next page of results.

maxLength512
externalId: optional string

Only return the entry with this externalId

minLength1
maxLength255
limit: optional number

A limit on the number of objects to be returned, between 1 and 100.

minimum1
maximum100
source: optional string

Only return entries with this source label

minLength1
maxLength100
status: optional "processing" or "completed" or "failed"

Only return files in this processing state

One of the following:
"processing"
"completed"
"failed"
Header ParametersExpand Collapse
"Featurebase-Version": optional "2026-08-19.orbit" or "2026-01-01.nova" or "2025-12-12.clover"
One of the following:
"2026-08-19.orbit"
"2026-01-01.nova"
"2025-12-12.clover"
ReturnsExpand Collapse
data: array of TrainingFile { id, characterCount, contentHash, 15 more }

Array containing the actual response elements

id: string

Training file ID

characterCount: number

Characters of extracted text

contentHash: string

SHA-256 (hex) of the stored source: for inline text and content edits the trimmed text, for uploads and URLs the original bytes. Compare it with your own hash to detect changes without downloading content.

contentPreview: string

First 200 characters of the extracted text

createdAt: string

ISO timestamp of the upload

externalId: string

Your own identifier for this file, if one was set

fileSize: number

Size of the originally uploaded source in bytes (unchanged by content edits)

indexStatus: "pending" or "indexed" or "failed"

Whether the content is searchable by the AI agent. pending while indexing, indexed when the AI agent can use it, failed if indexing failed (the content is stored and indexing is retried hourly).

One of the following:
"pending"
"indexed"
"failed"
mimeType: string

MIME type of the originally uploaded source

name: string

File name shown in the dashboard

object: "training_file"

Object type identifier

processingError: string

Conversion error message when status is failed

source: string

Pipeline label, if one was set

status: "processing" or "completed" or "failed"

processing while the file is being converted to text, completed once the content is stored, failed if conversion failed (see processingError).

One of the following:
"processing"
"completed"
"failed"
updatedAt: string

ISO timestamp of the last change

wordCount: number

Words of extracted text

content: optional string

Full extracted text (markdown). Returned when retrieving or updating a single file; omitted from list and create responses.

outcome: optional "created" or "updated" or "unchanged"

On create and update responses: created, updated (same externalId or same name and bytes, content replaced and re-indexed), or unchanged (identical content, nothing done). Absent on reads.

One of the following:
"created"
"updated"
"unchanged"
nextCursor: string

Cursor to use for fetching the next page. Null if there are no more results.

maxLength512
object: "list"

String representing the object type

List training files

curl https://do.featurebase.app/v2/training_data/files \
    -H "Authorization: Bearer $FEATUREBASE_API_KEY"
{
  "data": [
    {
      "id": "67ec1234abcd5678ef901234",
      "characterCount": 12840,
      "contentHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "contentPreview": "# Refund policy\n\nCustomers can request a refund within 30 days…",
      "createdAt": "2026-09-03T10:15:00.000Z",
      "externalId": "kb-article-1842",
      "fileSize": 48213,
      "indexStatus": "indexed",
      "mimeType": "application/pdf",
      "name": "refund-policy.pdf",
      "object": "training_file",
      "processingError": null,
      "source": "resolved-conversations",
      "status": "completed",
      "updatedAt": "2026-09-03T10:15:30.000Z",
      "wordCount": 2130,
      "content": "# Refund policy\n\nCustomers can request a refund within 30 days of purchase…",
      "outcome": "created"
    }
  ],
  "nextCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9",
  "object": "list"
}
Returns Examples
{
  "data": [
    {
      "id": "67ec1234abcd5678ef901234",
      "characterCount": 12840,
      "contentHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "contentPreview": "# Refund policy\n\nCustomers can request a refund within 30 days…",
      "createdAt": "2026-09-03T10:15:00.000Z",
      "externalId": "kb-article-1842",
      "fileSize": 48213,
      "indexStatus": "indexed",
      "mimeType": "application/pdf",
      "name": "refund-policy.pdf",
      "object": "training_file",
      "processingError": null,
      "source": "resolved-conversations",
      "status": "completed",
      "updatedAt": "2026-09-03T10:15:30.000Z",
      "wordCount": 2130,
      "content": "# Refund policy\n\nCustomers can request a refund within 30 days of purchase…",
      "outcome": "created"
    }
  ],
  "nextCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9",
  "object": "list"
}