Update Document

Rename a document, enable or disable it for search, set any of its 17 tag slots, or requeue it for processing. Absent fields are unchanged, and derived indexing state is read-only. Resolve a tag display name to its slot with GET /api/v2/knowledge/{id}/tags. The returned document omits the connector provenance the detail read carries. A workspace API key is rejected with 403; use a personal API key.

PATCH/api/v2/knowledge/{id}/documents/{documentId}
X-API-Key<token>

Your Sim API key, personal or workspace-scoped. Generate one under Settings, then API Keys. Operations that reject workspace keys say so in their own description.

In: header

Path Parameters

id*string

Unique knowledge base identifier.

Length1 <= length
documentId*string

Unique knowledge document identifier.

Length1 <= length

Request Body

application/json

Filename, search state, tag slot values, or a processing retry.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://www.sim.ai/api/v2/knowledge/string/documents/string" \  -H "X-API-Key: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",    "enabled": false,    "tag1": "billing"  }'
{
  "data": {
    "id": "b2d4f8a0-1c3e-4a5b-9d7c-2e6f0a8b4c12",
    "knowledgeBaseId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "filename": "getting-started.pdf",
    "fileSize": 248913,
    "mimeType": "application/pdf",
    "processingStatus": "completed",
    "chunkCount": 24,
    "tokenCount": 8123,
    "characterCount": 41205,
    "enabled": true,
    "createdAt": "2025-06-18T16:45:00Z",
    "tags": {
      "category": "billing",
      "priority": 2
    }
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}