Update a training file
PATCH/v2/training_data/files/{id}
Renames a training file, replaces content, or sets externalId / source. Indexing is attempted before returning when content is available. Check status and indexStatus; HTTP success alone does not establish search readiness. Serialize updates to a source identity in your pipeline.
Update a training file
curl https://do.featurebase.app/v2/training_data/files/$ID \
-X PATCH \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $FEATUREBASE_API_KEY" \
-d '{
"content": "# Refund policy\\n\\nCustomers can request a refund within 60 days of purchase…",
"externalId": "kb-article-1842",
"name": "refund-policy-v2.md",
"source": "resolved-conversations"
}'{
"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"
}Returns Examples
{
"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"
}