# Get Document Content History — Linear

> Return the revision history for a Linear document — each entry shows when the content changed and which users made the edit. Provide the document's UUID or slugId (same format as Get Document). Use Search Documents to find the document ID…

- Key: `linear-get-document-content-history`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Linear (`linear`) — https://pipedream.com/apps/linear.md
- This page (HTML): https://pipedream.com/apps/linear/actions/get-document-content-history
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/linear/actions/get-document-content-history/get-document-content-history.mjs

## Description

Return the revision history for a Linear document — each entry shows when the content changed and which users made the edit. Provide the document's UUID or slugId (same format as **Get Document**). Use **Search Documents** to find the document ID. Each history entry includes `id`, `contentDataSnapshotAt` (timestamp of the snapshot), and `actorIds` (list of user UUIDs who contributed to that revision). `contentData` is a serialized TipTap rich-text snapshot — include it in `fields` only when you need to render or diff the raw document structure; for a quick summary, `contentDataSnapshotAt` and `actorIds` are sufficient. The tool makes two API calls internally: first it resolves the document to its content ID, then it fetches the history. Example: `documentId: "10b5bc2940c7"` → returns `[{id: "9d3c86fd-...", contentDataSnapshotAt: "2025-03-01T14:22:10Z", actorIds: ["3fd8c25f-..."]}]`. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/objects/Query?query=documentContentHistory).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `documentId` | `string` | Yes | The UUID or slugId of the document. A UUID looks like a1b2c3d4-0000-0000-0000-000000000001; a slugId is the short alphanumeric code at the end of the document URL (e.g. 10b5bc2940c7). Use Search Documents to find document IDs. |
| `fields` | `string[]` | No | Field names to return for each history entry. Defaults to a compact set: id, contentDataSnapshotAt, actorIds. Add contentData only when you need the full TipTap rich-text snapshot for diffing or rendering — it is a large nested object. e.g. ["id", "contentDataSnapshotAt", "contentData"] |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "linear",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "linear-get-document-content-history",
  arguments: {
    documentId: "Document ID",
    fields: ["Fields"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "linear-get-document-content-history",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    linear: { authProvisionId: "apn_xxxxxxx" },
    documentId: "Document ID",
    fields: ["Fields"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "linear-get-document-content-history",
    "configured_props": {
      "linear": { "authProvisionId": "apn_xxxxxxx" },
      "documentId": "Document ID",
      "fields": ["Fields"]
    }
  }'
```

---

- App: https://pipedream.com/apps/linear.md · All apps: https://pipedream.com/apps
