Skip to content

API reference

Read text document

documents.ReadTextDocumentReadAPI key

Read a text document’s current Markdown and revision, including live editor changes.

POST/v1/operations/documents.ReadTextDocument
On this page

Access & visibility

Allow documents.ReadTextDocument on your API key.

Workspace access by default. Private member data requires approved member delegation through Brigg-Act-As; the key supplies permissions while private ownership and project boundaries remain enforced.

Set up authentication · Choose permissions

Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.

file_idstringRequired

Use the file_id of a collaborative text document. Find an existing document with ListDocuments and select kind=text_document. An uploaded PDF, Word file or plain-text file is not a collaborative text document. documents.CreateTextDocument.

At least 1 character.

Work with text and saved versions

All documents use a stable file_id. Select document_kind=text_document from the listing for these collaborative text operations. Read text document returns its current Markdown and location.

For an exact change, use Edit text document with the existing text and its replacement; this avoids sending an old full copy over another edit. Replace text document replaces the entire Markdown body. Send the read response’s revision as expected_revision to refuse intervening changes atomically. Re-read before resolving a failed match or revision conflict.

A saved version_id identifies historical content. List versions before reading or reverting one, and use Checkpoint text document when you need a named saved point. A revert changes current content; it is not just a historical read.

Response

Returns 200 OK with a JSON body.

Reads the live editor state before returning Markdown, including recent edits. Use this operation before an exact replacement. GetTextDocumentContent instead reads the last stored projection and can lag behind open editors.

file_idstringRequired

The same stable identity supplied as file_id. This response uses camelCase; later requests still use file_id.

filenamestringRequired

Current document name. A collaborative text document is not an uploaded PDF or Word file and does not require a filename extension.

scopestring or nullRequired

Current document collection: org is workspace-shared, user is personal, and resources is the resources collection. Null means no collection is recorded; it does not grant access. This is location metadata, not a request to move the document.

pathstringRequired

Folder path within the current collection. An empty string is the collection root.

word_countnumberRequired

Word count of the returned or saved text, excluding Markdown formatting.

revisionstringRequired

Opaque token identifying this exact content. Pass it as expected_revision to a text edit. It is not a history version_id and cannot be used to select an export version.

mdstringRequired

Document content formatted as Markdown.

Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See HTTP errors and safe retries and limits.

HTTP status Code What to do
400 invalid_json Send a JSON object with Content-Type: application/json.
400 invalid_input Check the request fields and types.
401 invalid_key The workspace API key is missing, invalid or revoked.
403 forbidden Check the key’s operation and resource grants. If Brigg-Act-As is supplied, the key must be authorized to delegate to that member.
404 not_found The requested operation or resource is not available to this credential.
429 rate_limited Wait for Retry-After before retrying.
409 not_text_document This file is not a collaborative text document. Use CreateTextDocument or select kind=text_document from ListDocuments.

Next steps

Download OpenAPI · Versioning & retirement

JSON schemas

Use the complete schemas for validation or client generation.

Full request JSON schema
{
  "type": "object",
  "properties": {
    "file_id": {
      "type": "string",
      "minLength": 1,
      "description": "Use the file_id of a collaborative text document. Find an existing document with [ListDocuments](/developers/reference/documents/ListDocuments) and select kind=text_document. An uploaded PDF, Word file or plain-text file is not a collaborative text document. [documents.CreateTextDocument](/developers/reference/documents/CreateTextDocument)."
    }
  },
  "required": [
    "file_id"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "file_id": "f_project_notes"
    }
  ]
}
Full response JSON schema
{
  "type": "object",
  "properties": {
    "file_id": {
      "type": "string",
      "description": "The same stable identity supplied as file_id. This response uses camelCase; later requests still use file_id."
    },
    "filename": {
      "type": "string",
      "description": "Current document name. A collaborative text document is not an uploaded PDF or Word file and does not require a filename extension."
    },
    "scope": {
      "type": [
        "string",
        "null"
      ],
      "description": "Current document collection: org is workspace-shared, user is personal, and resources is the resources collection. Null means no collection is recorded; it does not grant access. This is location metadata, not a request to move the document."
    },
    "path": {
      "type": "string",
      "description": "Folder path within the current collection. An empty string is the collection root."
    },
    "word_count": {
      "type": "number",
      "description": "Word count of the returned or saved text, excluding Markdown formatting."
    },
    "revision": {
      "type": "string",
      "description": "Opaque token identifying this exact content. Pass it as expected_revision to a text edit. It is not a history version_id and cannot be used to select an export version."
    },
    "md": {
      "type": "string",
      "description": "Document content formatted as Markdown."
    }
  },
  "required": [
    "file_id",
    "filename",
    "scope",
    "path",
    "word_count",
    "revision",
    "md"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "file_id": "f_project_notes",
      "filename": "Project notes",
      "scope": "org",
      "path": "Projects",
      "word_count": 7,
      "revision": "tdr_before_edit",
      "md": "# Project notes\n\nThe kickoff is on Tuesday."
    }
  ]
}

Search by operation name or what you want to build.

Use arrow keys to browse. Enter opens a result.