Read File Text

Return a file's text content, parsed out of the stored bytes. This reads the file; it writes nothing — POST /api/v2/files/{fileId}/unzip is the endpoint that unzips an archive into the workspace. Answers 400 for a type no parser supports, naming the raw-bytes download as the escape hatch, and 413 for a file above the extraction ceiling. A generated document is extracted from its compiled artifact rather than its generation source, so one still compiling answers 409 and is worth retrying. degraded: true means text extraction did not fully succeed and the returned text may be incomplete or synthesized from the file's raw bytes. Do not treat it as authoritative content. The legacy .doc and .ppt parsers deliberately return best-effort content rather than failing, so this flag — not an error status — is how a partial extraction is reported. truncated separately reports that a parser limit stopped extraction early.

GET/api/v2/files/{fileId}/text
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

fileId*string

File identifier.

Match^[A-Za-z0-9_-]+$
Length1 <= length <= 128

Query Parameters

workspaceId*string

Workspace that owns the file.

Length1 <= length <= 128
maxBytes?integer

Optional ceiling on the source bytes fed to the parser, lowering but never raising the server limit.

Range1 <= value <= 26214400

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://www.sim.ai/api/v2/files/string/text?workspaceId=string" \  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "fileId": "string",
    "name": "string",
    "type": "string",
    "text": "string",
    "truncated": true,
    "degraded": true,
    "degradedReason": "string",
    "charCount": 0,
    "byteCount": 0
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid request"
  }
}
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "API key required"
  }
}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "Insufficient workspace permissions",
    "details": {
      "code": "INSUFFICIENT_WORKSPACE_ROLE"
    }
  }
}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Not found"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "message": "File already exists"
  }
}
{
  "error": {
    "code": "PAYLOAD_TOO_LARGE",
    "message": "Request body is too large"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "API rate limit exceeded",
    "details": {
      "retryAfter": "2026-01-01T00:00:30.000Z"
    }
  }
}
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal server error"
  }
}
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Service temporarily unavailable"
  }
}