Read a document

Read one document as Markdown and obtain its metadata.

{
    "title": "Read a document",
    "description": "",
    "method": "GET",
    "baseUrl": "https://app.docuwriter.ai",
    "endpoint": "/api/spaces/{space}/documents/{spaceMenuItem}",
    "headers": [
        {
            "key": "Authorization",
            "value": "Bearer YOUR_API_TOKEN",
            "type": "string",
            "required": true
        },
        {
            "key": "Accept",
            "value": "application/json",
            "type": "string",
            "required": true
        }
    ],
    "queryParams": [],
    "pathParams": [
        {
            "key": "space",
            "value": "Numeric Space ID.",
            "type": "integer",
            "required": true
        },
        {
            "key": "spaceMenuItem",
            "value": "Numeric document/menu-item ID belonging to the Space.",
            "type": "integer",
            "required": true
        }
    ],
    "bodyType": "none",
    "requestBody": "",
    "formData": [],
    "rawBody": "",
    "responses": {
        "200": {
            "description": "HTTP 200: success: true, message, and data containing id, name, content, type, parent_id, space_id, url, created_at, updated_at. content is the Markdown representation. Public Spaces additionally return public_url. Illustrative JSON example; sample values are fictional. Some optional or additional resource fields may be omitted.",
            "body": "{\n  \"success\": true,\n  \"data\": {\n    \"id\": 456,\n    \"name\": \"Payment lifecycle\",\n    \"parent_id\": null,\n    \"space_id\": 123,\n    \"content\": \"# Payment lifecycle\\n\\nPayments move from pending to settled.\"\n  },\n  \"message\": \"Document retrieved successfully\"\n}"
        },
        "401": {
            "description": "Missing or invalid account API token.Missing or invalid account API token. Example JSON response.",
            "body": "{\n  \"message\": \"Unauthenticated.\"\n}"
        }
    }
}

Request notes

  • Both path IDs are numeric. 456 must belong to Space 123.

Usage notes

  • Requires management access to the Space.
  • A document from another Space returns 404; lack of access returns 403.
  • For downloads, see Export documents.
  • Read the latest content before an update because the update endpoint replaces supplied content.

API authentication.

Updated