# OpenDocs documentation (full text) Source: https://docs.opendocs.cc --- URL: https://docs.opendocs.cc/

Documentation

Your agent writes it. OpenDocs publishes it.

{/* Keep each paragraph on one line: across lines MDX wraps the text in a second

, and the nested paragraph breaks React hydration. */}

OpenDocs turns the Markdown your agent writes into organized, shareable links and on-brand PDF and Word files. You don't learn a tool: you paste one prompt into your agent, then ask for what you need in plain words.

```text title="Paste this into Claude Code, Codex, Cursor or any agent" I'd like you to set up OpenDocs: Markdown publishing for agents (shareable links, plus PDF and DOCX export). Install as a skill if I have npm: npx skills add opendocs-cc/skills --skill opendocs -g -y If not, do this instead: curl -fsSL https://opendocs.cc/install.sh | bash The npx installer may end with "PromptScript does not support global skill installation". That's a known installer bug that only affects PromptScript; the skill is still installed. Then sign me up (it's free): ask for my email, run opendocs login --email , and I'll paste the 6-digit code it sends me. After that, read the agent quickstart at https://docs.opendocs.cc/getting-started/agent-quickstart.md and ask me what I'd like to publish ```

Your agent installs OpenDocs, emails you a sign-in code and asks what to publish. Free for up to 50 documents. Walk through the quickstart or sign up in the browser.

## Then just ask

“Publish the Q3 investor update to the Investors project and send me the PDF.”

A link your workspace can open, and a branded PDF next to the file.

“Share the onboarding handbook with {"dana@halvard.example"}.”

Dana gets an email and can read that one document.

“Use the Boardroom preset with our logo.”

Every PDF and Word file follows your brand from now on.

“Roll the pricing spec back to yesterday’s version.”

The old version comes back as a new one. Nothing is lost.

More things to ask your agent

## Find your way around
Your agent Set up your agent Claude Code, Codex, Cursor, Copilot, Cline and any agent that can run a command. Concepts How OpenDocs works Workspaces, projects, documents and versions. Documents Publish and update Stable links that keep every version. Exports PDF, Word and branding Presets, fonts, your logo and footer. Sharing Who can see a document Private, workspace, shared with people or public. Integrations Google Drive and e-signatures Save to Drive folders. Send documents for signing. Reference CLI and REST API Every command your agent runs, and every endpoint.
## For agents Every page is also available as Markdown: add `.md` to the URL. Start with the [agent quickstart](/getting-started/agent-quickstart), find every page in [llms.txt](https://docs.opendocs.cc/llms.txt), or read the whole site in one file at [llms-full.txt](https://docs.opendocs.cc/llms-full.txt). --- URL: https://docs.opendocs.cc/getting-started/quickstart # Quickstart You need an agent that can run terminal commands (Claude Code, Codex, Cursor, GitHub Copilot, Cline, Aider and others) and an email address. No browser sign-up, no API keys to copy. It takes about two minutes and it's free for up to 50 documents. ## 1. Copy the prompt Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from here:
```text title="Paste this into your agent" I'd like you to set up OpenDocs: Markdown publishing for agents (shareable links, plus PDF and DOCX export). Install as a skill if I have npm: npx skills add opendocs-cc/skills --skill opendocs -g -y If not, do this instead: curl -fsSL https://opendocs.cc/install.sh | bash The npx installer may end with "PromptScript does not support global skill installation". That's a known installer bug that only affects PromptScript; the skill is still installed. Then sign me up (it's free): ask for my email, run opendocs login --email , and I'll paste the 6-digit code it sends me. After that, read the agent quickstart at https://docs.opendocs.cc/getting-started/agent-quickstart.md and ask me what I'd like to publish ```
Already have an account? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email and workspace filled in, so your agent signs you in instead of asking. ## 2. Paste it into your agent Your agent asks to run a few commands. Approve them: - **Install the OpenDocs skill.** With Node.js it uses `npx skills add`; without it, the `install.sh` script. The skill is a set of instructions that teaches your agent the OpenDocs commands and the rules that go with them, such as asking before making anything public. With Node.js, your agent may also install the OpenDocs CLI (`npm install -g @opendocs.cc/cli`). - **Sign you in.** It runs `opendocs login --email `, which sends you a 6-digit code. If the `npx` install ends with an error about PromptScript, that's a known bug in the installer that only affects PromptScript. The skill is installed for your other agents. ## 3. Enter the code Check your inbox for an email from OpenDocs and paste the code into the chat. Codes expire after 10 minutes; if yours did, ask your agent to send a new one. If the email is new to OpenDocs, this creates your account, a workspace at `opendocs.cc/` and a Default project. Your agent saves an API key named after itself (for example `claude-code`), so it stays signed in. ## 4. Ask for your first document Your agent reads the [agent quickstart](agent-quickstart.md) and asks what you'd like to publish. Ask for anything you'd normally write up: > **Ask your agent** > > "Write a one-page summary of this project's README and publish it." > > "Turn my notes from today's call into a client update and send me the PDF." You get a link like `opendocs.cc//project-summary`. Only members of your workspace can open it until you decide otherwise, and the link stays the same every time the document is updated. Ask for a PDF and it lands next to the Markdown file. ## Other ways to start - **Sign up in the browser.** Create an account at [opendocs.cc/signup](https://opendocs.cc/signup), then copy the prompt from the **Connect your agent** card in the dashboard. - **Try it without an account.** Ask your agent to publish anonymously. You get a link anyone can open for 24 hours, plus a claim link to keep it. See [Share with people](../visibility/sharing-and-anonymous-links.md). - **Type the commands yourself.** Everything your agent does is an `opendocs` command. See [Use the CLI yourself](cli-quickstart.md). ## Next - [What to ask your agent](what-to-ask.md): publishing, exports, branding, sharing, versions, Drive and e-signatures. - [How OpenDocs works](how-opendocs-works.md): workspaces, projects, documents and versions. - [Set up your agent](../integrations/overview.md): notes for Claude Code, Codex, Cursor and others. --- URL: https://docs.opendocs.cc/getting-started/what-to-ask # What to ask your agent Once OpenDocs is set up, you work with it by asking your agent. There are no special phrases: say what you want the way you'd ask a colleague. These prompts show what's possible and what happens when you ask. Your agent checks with you before anything that's hard to undo or reaches other people: making a document public, changing the export theme, sending a document for signing, deleting. ## Publish and update | Ask | What happens | | --- | --- | | "Publish the launch plan." | The Markdown becomes a link only your workspace can open. | | "Write release notes for v2.4 and publish them." | Your agent writes the file, then publishes it. | | "Publish everything in the `docs` folder." | One link per file, in one batch. | | "I edited the handbook, update it." | Same link, new version. Nobody needs a new URL. | | "Publish this without an account." | A link anyone can open for 24 hours, plus a claim link to keep it. | More: [Publish](../publishing/publish.md), [Sync a folder](../publishing/sync-and-history.md). ## PDF, Word and branding | Ask | What happens | | --- | --- | | "Send me the board report as a PDF." | A typeset PDF lands next to the Markdown file. | | "Publish the proposal and give me a Word file too." | A link and a `.docx` (Pro and Team). | | "Export everything in the Investors project as PDFs." | One PDF per document, in a folder. | | "Use the Boardroom preset with our logo." | Every export follows it from now on. Your agent asks you first. | | "Make our brand color navy and the font IBM Plex Sans." | Same, with your own color and font. | More: [PDF, Word and branding](../publishing/branded-exports.md). ## Organize | Ask | What happens | | --- | --- | | "Put this in the Product project." | Filed under `opendocs.cc//projects/product/...` | | "Start a project for the Northwind engagement." | A new project for that body of work. | | "Move the old specs to Archive." | The documents move; their content doesn't change. | | "What's in the Investors project?" | A list of its documents with their links. | More: [Projects](../publishing/projects.md), [Find, download and remove](../publishing/list-get-pull-unpublish.md). ## Share | Ask | What happens | | --- | --- | | "Share the onboarding handbook with dana@halvard.example." | Dana gets an email and can read that one document. | | "Let anyone at northwind.example read the proposal." | Everyone with a verified email at that domain can open it. | | "Make the changelog public." | Anyone with the link can read it. Your agent confirms first. | | "Keep the salary bands private to me." | Only you can open it. | | "Invite Sam to our workspace." | Sam gets an invitation email to accept. | More: [Who can see a document](../visibility/overview.md), [Workspaces and teams](../visibility/workspaces-and-team-access.md). ## Versions | Ask | What happens | | --- | --- | | "Who changed the pricing spec, and when?" | Every version with who published it and through which agent. | | "Show me what the spec said on Monday." | The Markdown of that version. | | "Roll the spec back to yesterday." | The old content comes back as a new version. History is kept. | More: [Updates and versions](../publishing/update-and-version-history.md). ## Google Drive and e-signatures These need Pro or Team and a one-time connection in the dashboard's **Integrations** tab. | Ask | What happens | | --- | --- | | "Save the board minutes to the Board Minutes folder as a PDF." | The file lands in that Drive folder, and OpenDocs keeps a record. | | "Send the consulting agreement to Ines Duarte, ines@northwind.example, for signing." | Your agent prepares a draft, shows you the signers, and sends only when you confirm. | | "Has Northwind signed yet?" | The status of each signer. | | "Download the signed agreement and file it in Signed Agreements." | The signed PDF and its audit certificate, saved to Drive. | More: [Google Drive](../integrations/google-drive.md), [E-signatures](../integrations/docuseal.md). ## Tips - **Name the project** when a document belongs to a client, product or team. Your agent files it there, and the URL says where it lives. - **Say who it's for.** "For the team" keeps the default. "For the client" usually means sharing with their email or exporting a PDF, not making it public. - **Ask for the link back.** Your agent always gets one; asking makes it end its reply with it. --- URL: https://docs.opendocs.cc/getting-started/how-opendocs-works # How OpenDocs works Agents are good at writing. What they write ends up as Markdown files that are hard to share: teammates can't open them without the repo, clients want a PDF, and the next rewrite overwrites the last one. OpenDocs gives each of those files a home: a link that stays the same, a branded PDF or Word file when someone needs one, and a history of every version. ## The loop 1. You ask your agent for a document, or for something done to one. 2. Your agent writes or edits a Markdown file in your folder. 3. It runs an `opendocs` command (the skill taught it how). 4. OpenDocs stores the new version and returns a link, plus a PDF or Word file if you asked for one. 5. Your agent gives you the link. The Markdown file in your folder stays the source of truth. OpenDocs keeps a snapshot of each version you publish, so you can read and restore old ones. ## Workspaces, projects, documents ```text workspace halvard opendocs.cc/halvard ├─ project Default opendocs.cc/halvard/ ├─ project Investors opendocs.cc/halvard/projects/investors/ │ ├─ document Q3 investor update .../projects/investors/q3-investor-update │ │ ├─ version 3 today, via Claude Code │ │ ├─ version 2 yesterday, via Cursor │ │ └─ version 1 Monday, by Dana │ └─ document Board deck notes └─ project Handbook ``` - **Workspace.** Your team's space. Members can read and edit every document in it that isn't private. Your first workspace is created when you sign up, at `opendocs.cc/`. - **Project.** A group of documents for one client, product or team, the way a branch keeps a body of work apart in a repo. Every workspace has a Default project; documents there sit right under the workspace in the URL. Your agent files each document in the right project when you name one. - **Document.** One Markdown file with a stable URL. The URL never changes when the document is updated, so links you've sent keep working. - **Version.** Every publish of changed content is a new version, recording who published it and through which agent. Rolling back publishes an old version again as the newest one, so nothing is ever lost. ## Who can see what Every document has one visibility: | Visibility | Who can open it | | --- | --- | | `workspace` (default) | Members of the workspace | | `private` | Only you | | `public` | Anyone with the link, if the workspace allows public documents | You can also share a single document with specific email addresses or a whole email domain, without adding those people to your workspace. Your agent never makes a document public without asking you first. See [Who can see a document](../visibility/overview.md). ## Exports PDF and Word files are typeset from the same Markdown by OpenDocs's converter, not printed from a web page. They use your workspace's export theme on every plan: a preset or your own brand color and font, and your logo. Pro and Team can also set their own footer; Free exports end with "Made with OpenDocs". See [PDF, Word and branding](../publishing/branded-exports.md). ## How your agent talks to OpenDocs | Way in | What it is | Used when | | --- | --- | --- | | The skill | Instructions that teach your agent the commands and rules | Always; the setup prompt installs it | | The CLI | The `opendocs` command (`npm install -g @opendocs.cc/cli`) | The agent's main tool when Node.js is available | | Bash client | `scripts/opendocs.sh` in the skill folder, needs `curl` and `jq` | Machines without Node.js | | REST API | `https://api.opendocs.cc` with an API key | Custom tools and backend jobs | All four use the same account and the same API key. See [Set up your agent](../integrations/overview.md) and the [REST API reference](../api-reference/authentication.md). ## What renders Documents support GitHub-flavored Markdown: tables, task lists, code with syntax highlighting, alerts such as `> [!NOTE]`, math, images and footnotes, with heading anchors and a table of contents. Fenced `private` blocks are left out of what readers see. See [Markdown that renders](../publishing/rendering-and-metadata.md). --- URL: https://docs.opendocs.cc/getting-started/plans-and-limits # Plans and limits The agent workflow, the CLI and the REST API work the same on every plan. Plans differ in how much you can keep, how many people and workspaces you have, and whether exports carry your brand. Prices are on [opendocs.cc/pricing](https://opendocs.cc/pricing). ## Plans | | Free | Pro | Team | | --- | --- | --- | --- | | Price | $0 | $8/month or $72/year | $4 per member/month, or $3 billed yearly. 3-seat minimum | | Published documents | 50 per workspace | Unlimited | Unlimited | | Workspaces you own | 1 | 2, more as add-ons | Unlimited | | Members per workspace | 3 | 5 | Unlimited | | PDF export | Yes, with a "Made with OpenDocs" footer | Yes | Yes | | Word (.docx) export | No | Yes | Yes | | Export branding (presets, color, font, logo) | Yes | Yes | Yes | | Your own export footer, or none | No | Yes | Yes | | Google Drive and e-signatures | No | Yes | Yes | | Custom domain | No | 1 per workspace | 1 per workspace | | Sharing, public documents, version history | Yes | Yes | Yes | | API keys, CLI and agent skill | Yes | Yes | Yes | | Support | Community | Email | Priority | Paid features follow the workspace: Word export, the export footer, integrations and the [custom domain](../publishing/custom-domains.md) work in a workspace whose owner is on Pro or Team, for every member of it. ## The 50-document cap on Free The cap counts **published** documents in a workspace. These don't count: - **Updates.** A new version of an existing document doesn't use a slot. - **Unpublished documents.** Unpublishing frees a slot right away. - **Files you haven't published.** Markdown on your machine isn't counted. When the cap is reached, existing documents stay up and keep working, updates included. New publishes are refused until you unpublish something or upgrade. > **Ask your agent** > > "How many documents do I have left on the Free plan?" > > "Unpublish the drafts from last month to free up some room." ### Under the hood `opendocs whoami --json` and `GET /api/v1/me` return the live count for the active workspace: ```json { "quota": { "documents": { "plan": "free", "limit": 50, "used": 47, "remaining": 3 } } } ``` On Pro and Team, `limit` and `remaining` are `null`, meaning unlimited. Over the cap, both `POST /api/v1/publish` and `POST /api/v1/publish/batch` answer `403 document_limit`. A batch is checked before anything is written: if it doesn't fit, nothing is published. The CLI runs the same check before uploading. ```json { "error": "document_limit", "plan": "free", "limit": 50, "used": 50, "message": "Your free plan allows 50 published documents. You currently have 50." } ``` A batch error also carries `requested` and `workspaceId`. See [Errors](../errors.md). ## Workspaces and members - **Workspaces you own** are counted against your plan. Pro includes 2; the owner can add more from **Billing** in the dashboard. Team has no limit. - **Members** are capped per workspace on Free (3) and Pro (5), counting pending invitations. Team has no cap. - **Roles** work on every plan. Every workspace has an owner, and members can be made admins. Members can read and edit every document that isn't private. Managing a document (its visibility, sharing, moving, unpublishing or deleting) is for its author and the workspace's owners and admins, who also manage people and settings. See [Workspaces and teams](../visibility/workspaces-and-team-access.md). ## How Team billing works - Team is billed to the account that buys it, so only the workspace owner can buy or change the plan. - Seats follow confirmed membership: a seat is added when someone accepts an invitation and released when they're removed or leave, with a minimum of 3. Changes are prorated. - One person counts once, however many of your workspaces they're in. ## Downgrading and canceling Cancel any time from **Billing**. Paid features stay until the end of the billing period, then the account is on Free. Every document stays published and readable. On Free you can't publish new documents beyond the cap, and new exports end with the "Made with OpenDocs" footer. Your logo, brand color and font stay; your own footer is kept and applies again if you upgrade. A custom domain is paused: its links redirect to opendocs.cc until you upgrade again. ## Rate limits The same on every plan, per account for signed-in requests and per IP otherwise, per minute: | What | Limit | | --- | --- | | All API traffic (per IP) | 600 requests | | Publish | 120 requests | | Batch publish (up to 25 documents each) | 20 requests | | Export | 120 requests | | Batch export (up to 10 documents each) | 30 requests | | Exports running at the same time | 4 | | Anonymous publish (per IP, per hour; 50 a day) | 20 | They're sized so an agent can republish and re-export a folder of 50 long documents in one run. Over a limit, the API answers `429 rate_limited` with a `Retry-After` header, and the CLI (0.4.6 or later) waits and retries on its own. ## Which plan - **Trying it with your agent, or a handful of documents:** Free. - **Client-facing PDFs without the OpenDocs footer, Word files, more than 50 documents, your own domain, Drive or e-signatures:** Pro. - **A team that shares workspaces:** Team. --- URL: https://docs.opendocs.cc/integrations/overview # Set up your agent OpenDocs works with any agent that can run a terminal command or make an HTTP request. You set it up once by pasting one prompt into your agent. After that you ask in plain language ("Publish the Q3 investor update to the Investors project and send me the PDF") and your agent runs the commands. These agents have their own page with setup notes: [Claude Code](claude-code.md), [Codex](codex.md), [Cursor](cursor.md), [GitHub Copilot](copilot.md), [Cline](cline.md), [Aider](aider.md), [OpenClaw](openclaw.md) and [Hermes Agent](hermes-agent.md). Gemini CLI and other agents that support skills work the same way. To have your agent publish plans, specs and reports without being asked each time, add a few lines to `AGENTS.md` or `CLAUDE.md`: see [Tell your agent when to publish](agent-instructions.md). :::tip Using the Claude or ChatGPT app? Chat apps can't run commands, so they connect through the [OpenDocs MCP server](mcp.md) instead: add one URL, sign in with your OpenDocs account and ask. Coding tools can use MCP too, but the skill and CLI below are better for local files, folders and images. ::: :::note Looking for Google Drive or e-signatures? Those are product integrations you connect in the dashboard's **Integrations** tab, not agent setup. See [Google Drive](google-drive.md) and [E-signatures with DocuSeal](docuseal.md). ::: ## Start with one prompt Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc) and paste it into your agent. The full text is also on the [Quickstart](../getting-started/quickstart.md). If you already have an account, use the **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) instead: its prompt has your email and workspace filled in, so your agent signs you in rather than asking. The prompt asks your agent to install the OpenDocs skill, sign you up with an emailed code, read the [agent quickstart](../getting-started/agent-quickstart.md) and ask what you'd like to publish. What happens next: 1. **Your agent installs the OpenDocs skill.** It asks to run the installer. Approve it. With Node.js it may also install the OpenDocs CLI. 2. **It asks for your email** and runs `opendocs login --email`, which sends you a 6-digit code. Approve that command too. 3. **You paste the code** into the chat. Codes expire after 10 minutes. A new email gets an account, a workspace at `opendocs.cc/` and a Default project; an existing one signs in. 4. **It asks what you'd like to publish.** From here on you ask for documents, PDFs, shares and versions in your own words. See [What to ask your agent](../getting-started/what-to-ask.md). Most agents ask before running a command. Approving the `npx`, `curl`, `npm` and `opendocs` commands during setup is expected. If the `npx` install ends with an error about PromptScript, that's a known installer bug that only affects PromptScript; the skill is installed for your other agents. ## What your agent gets | Piece | What it is | When it's used | | --- | --- | --- | | **The skill** | A `SKILL.md` file of instructions: the commands, plus rules like "ask before making anything public". See [The OpenDocs skill](../getting-started/skill-md.md). | Always. It's how your agent knows what to do when you mention a document, a PDF or a share. | | **The CLI** | The `opendocs` command (`npm install -g @opendocs.cc/cli`, Node.js 20+). | The default way agents work: it handles sign-in, folders, local images, batching, exports and retries. | | **The bash client** | `scripts/opendocs.sh` inside the skill folder. Needs only `curl` and `jq`. | Machines without Node.js. It covers sign-in, publish, list, pull, history, share, export, team invites and the theme. | | **The MCP server** | `https://mcp.opendocs.cc/mcp`, which you sign in to with your OpenDocs account. See [MCP server](mcp.md). | Claude, ChatGPT and other apps that can't run commands. Coding tools can use it too, without installing anything. | | **The REST API** | `https://api.opendocs.cc`, with an OpenAPI spec at `https://opendocs.cc/openapi.json`. | Agents and tools you build yourself, backend jobs, anything that can make an HTTP request. See [Authentication](../api-reference/authentication.md). | Your agent can also read these docs directly: every page is available as Markdown by adding `.md` to its URL, with an index at `https://docs.opendocs.cc/llms.txt` and everything in one file at `https://docs.opendocs.cc/llms-full.txt`. ## Under the hood ### Install the skill ```bash # Node.js 22+: installs the skill for every agent it finds on this machine npx skills add opendocs-cc/skills --skill opendocs -g -y # Only for one agent (claude-code, codex, cursor, github-copilot, cline, openclaw, hermes-agent, gemini-cli, ...) npx skills add opendocs-cc/skills --skill opendocs -g -y -a cursor # No Node.js: SKILL.md + scripts/opendocs.sh into ~/.claude/skills/opendocs, # and ~/.agents/skills/opendocs when ~/.agents or ~/.codex exists curl -fsSL https://opendocs.cc/install.sh | bash # Somewhere else (only that folder) curl -fsSL https://opendocs.cc/install.sh | OPENDOCS_SKILL_DIR="$HOME/.hermes/skills/opendocs" bash # Already have the CLI: every agent it finds, or the ones you name opendocs agent --install opendocs agent --install --agent cursor ``` Each agent page lists the folder that agent reads skills from. For agents without skill support, print the instructions into the file the agent does read: `opendocs agent` prints a short guide and `opendocs agent --full` prints the whole skill. ### Install the CLI and sign in ```bash npm install -g @opendocs.cc/cli # Node.js 20+ opendocs login --email dana@halvard.example --json # emails a 6-digit code, exits opendocs login --email dana@halvard.example --code 482913 --json opendocs login --key od_live_xxxxx --json # an existing API key ``` The code login saves an API key named after the agent to `~/.config/opendocs/config.json`. Never have an agent run bare `opendocs login`: without `--email` or `--key` it waits for a key on stdin and the tool call hangs. `opendocs login --browser` is for people at a terminal. For CI and servers, log in once with a key from the dashboard. The CLI reads `OPENDOCS_API_KEY` only during `login`, then uses the saved config: ```bash OPENDOCS_API_KEY=od_live_xxxxx opendocs login --json bash ~/.claude/skills/opendocs/scripts/opendocs.sh login --key od_live_xxxxx # bash client ``` ### Which agent published a version Every version records the agent that published it, from the `X-OpenDocs-Client` header. The CLI detects Claude Code, Cursor, Codex and Gemini CLI on its own. Elsewhere it sends `opendocs-cli`; set the name with the global `--client` flag or the `OPENDOCS_CLIENT` environment variable: ```bash export OPENDOCS_CLIENT=cline opendocs publish notes.md --client cline --json ``` API clients send the header themselves, for example `X-OpenDocs-Client: cursor/finance-bot`. ### Defaults for any agent | Practice | Why | | --- | --- | | Pass `--json` on every command | stdout becomes one JSON object; errors go to stderr with `error`, `message` and `docs_url`. | | Write the Markdown to a file first | The CLI publishes files, not stdin, and you can review the file before it goes live. | | Publish the same file again to update it | The CLI remembers what this folder published (`.opendocs/state.json`), so the URL stays the same and a new version is added. | | Publish a folder in one command | `opendocs publish ./docs --tags q3-board --json` batches 25 docs per request. Don't loop per file. | | Keep the default `workspace` visibility | Only workspace members can open it. `public` needs `--confirm-public` and a clear yes from you. | | Put each URL on its own line in the reply | Chat clients glue trailing punctuation onto links. | ```bash opendocs publish q3-investor-update.md --json opendocs publish q3-investor-update.md --project investors --export pdf --json opendocs publish ./board-pack --tags q3-board --json opendocs share q3-investor-update.md sam@halvard.example --json opendocs visibility q3-investor-update public --confirm-public --json # only when asked ``` ## Related pages - [Quickstart](../getting-started/quickstart.md): the prompt, the code, your first document - [MCP server](mcp.md): Claude, ChatGPT and other apps that connect over MCP - [Tell your agent when to publish](agent-instructions.md): copy-paste instructions for `AGENTS.md`, `CLAUDE.md` and Cursor - [The OpenDocs skill](../getting-started/skill-md.md): what it teaches and where it lives - [Agent cookbook](../agents/cookbook.md): the exact commands for each job - [Use the CLI yourself](../getting-started/cli-quickstart.md) - [CLI reference](../cli/reference.md) --- URL: https://docs.opendocs.cc/integrations/mcp # Claude, ChatGPT and other apps (MCP) The OpenDocs MCP server lets Claude, ChatGPT and other AI apps publish, export, share and send documents for you. You add one URL to the app, sign in with your OpenDocs account and choose what the app may do. It works on every plan, including Free. ```text https://mcp.opendocs.cc/mcp ``` [opendocs.cc/mcp](https://opendocs.cc/mcp) has one-click buttons for Claude, ChatGPT, Cursor and VS Code. > **Ask your app** > > "Publish this as a doc in our Legal project." > > "Make a PDF of the Acme NDA." > > "Send the employment contract to Jón for signature." :::tip MCP or the skill? Chat apps such as Claude and ChatGPT use MCP. Coding tools such as Claude Code, Codex and Cursor can use either. With a terminal, the [skill and CLI](overview.md) are better for local files, folders and images: they publish straight from disk and save PDFs next to the source. MCP needs nothing installed. ::: ## Add OpenDocs to your app Works in Claude on the web, the desktop app and the mobile app. Add it once on claude.ai and it's there in all of them. 1. Open the [Add custom connector dialog](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=OpenDocs.cc&connectorUrl=https%3A%2F%2Fmcp.opendocs.cc%2Fmcp) (the **Add to Claude** button on [opendocs.cc/mcp](https://opendocs.cc/mcp) opens the same link). The name `OpenDocs.cc` and the URL are filled in. Click **Add**. 2. Click **Connect** next to OpenDocs.cc, sign in to OpenDocs and click **Allow**. See [Signing in](#signing-in) for what you'll see. 3. Ask in any chat. To add it by hand, open Claude's connector settings, choose **Add custom connector**, name it `OpenDocs.cc` and paste `https://mcp.opendocs.cc/mcp`. - **Team and Enterprise:** an owner adds OpenDocs once in Organization settings → Connectors ([prefilled link](https://claude.ai/admin-settings/connectors?modal=add-custom-connector&connectorName=OpenDocs.cc&connectorUrl=https%3A%2F%2Fmcp.opendocs.cc%2Fmcp)). Then each person clicks **Connect** and signs in with their own OpenDocs account. - **Claude Free** allows one custom connector. - Connectors you add on claude.ai also show up in Claude Code when you're signed in with the same account. OpenDocs.cc is in ChatGPT's plugin directory. 1. Open [OpenDocs.cc in ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6adfe2405774819198b9b9c92fffaaa8) (the **Add to ChatGPT** button on [opendocs.cc/mcp](https://opendocs.cc/mcp) opens the same page), or search for OpenDocs.cc in ChatGPT's plugins. Click **Install plugin**. 2. ChatGPT opens OpenDocs: sign in and click **Allow**. See [Signing in](#signing-in) for what you'll see. 3. Ask in any chat. On a work account, your ChatGPT admin may need to allow OpenDocs.cc first. To add it by hand instead, open **Settings → Plugins** ([chatgpt.com/plugins](https://chatgpt.com/plugins)), click **+** and choose **Add custom MCP server**. Name it `OpenDocs.cc`, paste `https://mcp.opendocs.cc/mcp`, choose OAuth and click **Create as plugin**. This needs a ChatGPT plan that supports custom MCP servers. ```bash claude mcp add --transport http --scope user opendocs https://mcp.opendocs.cc/mcp ``` Then run `/mcp` in Claude Code, choose `opendocs` and sign in to OpenDocs in the browser that opens. `--scope user` makes it available in every project. If you already added OpenDocs.cc on claude.ai, it shows up in Claude Code for the same account and you can skip the command. The Codex CLI, the IDE extension and the ChatGPT desktop app share one configuration, so this sets up all three. ```bash codex mcp add opendocs --url https://mcp.opendocs.cc/mcp codex mcp login opendocs ``` The second command opens your browser to sign in to OpenDocs. To edit the config by hand, add this to `~/.codex/config.toml` and then run `codex mcp login opendocs`: ```toml title="~/.codex/config.toml" [mcp_servers.opendocs] url = "https://mcp.opendocs.cc/mcp" ``` Click **Add to Cursor** on [opendocs.cc/mcp](https://opendocs.cc/mcp). Cursor opens and shows the server; click **Install**. Or add it to `~/.cursor/mcp.json` yourself (inside `mcpServers` if you already have servers): ```json title="~/.cursor/mcp.json" { "mcpServers": { "opendocs": { "url": "https://mcp.opendocs.cc/mcp" } } } ``` Cursor's MCP settings then show that `opendocs` needs you to sign in. Click it and allow access in the browser that opens. Click **Install in VS Code** on [opendocs.cc/mcp](https://opendocs.cc/mcp), or run: ```bash code --add-mcp '{"name":"opendocs","type":"http","url":"https://mcp.opendocs.cc/mcp"}' ``` Or add it to your `mcp.json` (**MCP: Open User Configuration** in the Command Palette, or `.vscode/mcp.json` to share it with a project): ```json title="mcp.json" { "servers": { "opendocs": { "type": "http", "url": "https://mcp.opendocs.cc/mcp" } } } ``` Start the server when VS Code asks and sign in to OpenDocs in the browser. Then use Copilot Chat in agent mode. **Windsurf (Devin Desktop)** uses `serverUrl` in its MCP config, `mcp_config.json`: ```json title="mcp_config.json" { "mcpServers": { "opendocs": { "serverUrl": "https://mcp.opendocs.cc/mcp" } } } ``` **Antigravity** (which replaced Gemini CLI) takes the same JSON in `~/.gemini/config/mcp_config.json`. On the older Gemini CLI, run: ```bash gemini mcp add --transport http opendocs https://mcp.opendocs.cc/mcp ``` **Zed** goes in `settings.json`: ```json title="settings.json" { "context_servers": { "opendocs": { "url": "https://mcp.opendocs.cc/mcp" } } } ``` **JetBrains AI Assistant**, and any app that only runs local (stdio) servers, can connect through [`mcp-remote`](https://www.npmjs.com/package/mcp-remote), which needs Node.js and signs you in through your browser: ```json { "mcpServers": { "opendocs": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.opendocs.cc/mcp"] } } } ``` **Raycast:** run **Install MCP Server**, name it `opendocs` and paste the URL. **Any other app:** add a remote MCP server (Streamable HTTP) with the URL `https://mcp.opendocs.cc/mcp` and sign in when the app asks. ### With the OpenDocs CLI If you have the [CLI](../cli/reference.md), it can do the setup for you: ```bash opendocs mcp add # adds the server to every coding tool it finds opendocs mcp connect claude # opens Claude's add dialog and copies the URL opendocs mcp connect chatgpt # opens ChatGPT's plugin settings and copies the URL ``` `opendocs mcp add` uses each tool's own command where there is one (`claude mcp add`, `codex mcp add`, `code --add-mcp`) and otherwise adds only the `opendocs` entry to the tool's config, leaving your other servers alone. Each tool then asks you to sign in the first time it uses OpenDocs. ## Signing in The first time the app uses OpenDocs, it opens an OpenDocs page in your browser: 1. **Sign in** with an emailed code, Google or GitHub. New to OpenDocs? The same page creates your account, a workspace and a Default project. 2. **Check who's asking.** The page names the app ("Claude wants to use your OpenDocs account") and the account you're signed in as, with a link to use another account. 3. **Pick a workspace** if you have more than one. Pending invitations to a workspace show up here too. 4. **Choose permissions** (below) and click **Allow**. You're sent back to the app, which shows OpenDocs as connected. OpenDocs remembers your answer for that app and set of permissions, so reconnecting doesn't ask again. ## Permissions | Permission | What it allows | Default | | --- | --- | --- | | **Read documents** | Read your documents and projects | Always on | | **Create, update, share and export** | Publish and change documents, share them, export PDF and Word files | On | | **Google Drive and e-signature** | Save documents to Google Drive and send them for e-signature | On when your workspace has Drive or DocuSeal connected | | **Team and workspace admin** | Manage team members, workspaces and export branding | Off; only offered to owners and admins | The app only sees the tools your permissions allow. To allow more later, reconnect OpenDocs from the app (or disconnect it in Connected apps and add it again) and tick the permission on the consent screen. The full list is in [MCP tools](../reference/mcp-tools.md). Your plan's usual limits apply, the same as with the CLI. Google Drive and e-signatures need a workspace on Pro or Team with them connected; see [Google Drive](google-drive.md) and [E-signatures with DocuSeal](docuseal.md). ## What the AI asks you first OpenDocs tells the AI to ask you in plain words, and get a clear yes, before it: - makes a document public, - deletes a document or project, - invites people or removes them from the team, - changes the export theme, which affects every export, - sends anything for signature. For e-signatures it always creates a draft first and reads back the document, version, every signer, the order, the message and the expiry. If your workspace requires approval in the browser, you get an approval link instead. Your app may also ask you to approve tool calls on its own. Every answer ends with the document's link on its own line and who can open it. ## What works differently from the CLI | With the CLI | Over MCP | | --- | --- | | Publishes a `.md` file from disk | The AI sends the Markdown itself. Word files you upload to the chat are converted to Markdown first. | | Uploads local images | Image links in the Markdown are copied to OpenDocs when you publish. Pasted images go through an upload tool. | | Saves the PDF or Word file next to the source | You get a download link that works for 60 minutes. | | Remembers which file is which document | The AI refers to documents by link, slug or title, and updates check the version so nobody's edits are overwritten. | | Publishes whole folders | Up to 25 documents per request. Whole folders and vaults stay a CLI job. | ## Disconnect Open [Dashboard → Connected apps](https://opendocs.cc/dashboard/connected-apps) and click **Revoke** next to the app. Its access ends within a minute. You can also remove the connector in the app itself; revoking in OpenDocs makes sure it can't be used again. ## Troubleshooting **The app says it needs to sign in again.** This happens after you revoke the app, or when you ask for something your permissions don't cover. Reconnect and allow the permission: - Claude: open the connector settings, disconnect OpenDocs.cc and click **Connect** again. - ChatGPT: open **Settings → Plugins**, disconnect OpenDocs.cc and connect it again. - Claude Code: run `/mcp`, choose `opendocs` and sign in again. - Codex: run `codex mcp login opendocs`. - Cursor and VS Code: sign in again from the MCP settings. **The sign-in page says "Unverified app".** Some apps, mostly coding tools, register themselves when they first connect. OpenDocs then shows the name the app gave itself, the address it returns to after sign-in and an "Unverified app" note. Claude, ChatGPT and VS Code identify themselves and get a verified badge. If the name or address doesn't match the app you're using, click **Cancel**. **Claude says you can't add another connector.** Claude Free allows one custom connector. Remove the other one first, or use a Claude plan that allows more. **You can't install OpenDocs.cc in ChatGPT.** On a work account, an admin may need to allow it first. Adding it by hand needs a ChatGPT plan or workspace that supports custom MCP servers. **The AI doesn't use OpenDocs.** Check that the connector is turned on for this chat, then mention OpenDocs in your request: "Publish this with OpenDocs." **It doesn't connect from a work computer.** Claude and ChatGPT connect to OpenDocs from their own servers, so only the sign-in page has to load on your computer. Coding tools connect from your computer: they need HTTPS access to `mcp.opendocs.cc` and `opendocs.cc`. Proxies that strip the `Authorization` header or buffer streamed responses break MCP; ask IT to allow both hosts. ## Privacy OpenDocs only receives what the AI sends to its tools: the text of a document you publish, the email of someone you share with, the folder you save to. It never sees your chats, your other files or your other connectors. What it keeps is the same as when you publish from the CLI: your documents, their versions and who has access. Version history shows which app published each version, such as "Published from Claude". See the [Privacy Policy](https://opendocs.cc/privacy). ## For developers | What | Where | | --- | --- | | Server URL | `https://mcp.opendocs.cc/mcp` (Streamable HTTP) | | OAuth issuer | `https://opendocs.cc/api/auth` | | Authorization server metadata | `https://opendocs.cc/.well-known/oauth-authorization-server/api/auth` | | Protected resource metadata | `https://mcp.opendocs.cc/.well-known/oauth-protected-resource/mcp` | Clients discover the authorization server from the protected resource metadata, so the URL is all an MCP client needs. Access tokens are issued for the MCP server; to call the REST API directly, use an API key (see [Authentication](../api-reference/authentication.md)). ## Related pages - [MCP tools](../reference/mcp-tools.md): every tool, grouped by what it does - [Set up your agent](overview.md): the skill and CLI for coding tools - [What to ask your agent](../getting-started/what-to-ask.md) - [Google Drive](google-drive.md) and [E-signatures with DocuSeal](docuseal.md) --- URL: https://docs.opendocs.cc/integrations/browser-extension # Browser extension The OpenDocs extension adds a **Publish** button to ChatGPT, Claude and Gemini. One click turns an answer, or a whole chat, into a clean OpenDocs document: a link you can share and a PDF. You don't need an account to try it. It works in Chrome and Microsoft Edge. Install it from [opendocs.cc/extension](https://opendocs.cc/extension). ## Publish an answer 1. Open a chat on [chatgpt.com](https://chatgpt.com), [claude.ai](https://claude.ai) or [gemini.google.com](https://gemini.google.com). 2. Under the answer you want, click **Publish** (the OpenDocs icon next to Copy). 3. Check the title and where it goes, then click **Publish**. The link is copied for you. The card also has **Open**, **Download PDF** and, on Pro, **Download Word**. Turn on **Include my question** on the card to put your question above the answer, so readers know what was asked. The extension remembers your choice. ## Publish a whole chat Click **Publish** under any answer and switch the card to **Whole chat**, or open the side panel (the OpenDocs icon in the toolbar) and choose **Publish this chat**. Each of your questions appears as a quote above its answer. ## With or without an account | | Without an account | Signed in | | --- | --- | --- | | Who can open the link | Anyone with it, for 24 hours | Your workspace by default; you can make it private or public | | Size | Up to 512 KB of Markdown | Your plan's limits | | Images | Left out, with a note | Included | | PDF | Yes | Yes, with your workspace's branding | | Word | No | Pro and Team | | Update later at the same link | No | Yes | Sign in from the card or the side panel. It opens the OpenDocs sign-in page, where you can also create a free account, then asks what the extension may do. Signing in moves the documents you published from this browser in the last 24 hours into your workspace, so their content is kept. They get new links in your workspace; the anonymous links stop working. ## Choose where documents go In the side panel, pick the workspace, the project and who can see new documents. OpenDocs remembers these for the extension, the same way it does for Claude or ChatGPT over [MCP](./mcp.md). ## Update a document Signed in, publish the same answer or chat again and choose **Update**. The link stays the same and the earlier version is kept in the document's history. ## What comes along - Headings, lists, tables and code blocks, with the code's language - Math, rendered on the page and in the PDF - Web sources, as numbered footnotes with a list of sources at the end - Images, when you're signed in - The final version of a ChatGPT canvas or a Claude artifact - Reasoning ("thinking") is always left out ## Privacy - The extension only runs on chatgpt.com, claude.ai and gemini.google.com. - It reads a chat only when you click **Publish**, and only the chat open in that tab. It never stores copies of your chats. - It sends the content you chose to OpenDocs to make your document, and nothing else. - If it can't read a chat, it tells us the site, the step that failed and an error code. Never the content. - The code is open source: [github.com/opendocs-cc/opendocs-extension](https://github.com/opendocs-cc/opendocs-extension). The [Privacy Policy](https://opendocs.cc/privacy#browser-extension) has the details. To disconnect the extension from your account, open **Dashboard → Connected apps**. ## Troubleshooting **The Publish button doesn't show.** Chat sites change their pages now and then. Open the side panel and use **Publish this chat** or **Publish the last answer**; they work while we update the button. Reloading the chat tab can also help. **"Couldn't read this chat."** Some chat types aren't supported yet, such as Claude's Cowork chats. The extension has already told us; try again after the next update. **"Too long to publish without an account."** Anonymous documents can be up to 512 KB. Sign in (free) to publish longer chats. --- URL: https://docs.opendocs.cc/integrations/claude-code # Claude Code Claude Code is Anthropic's coding agent. It already writes specs, plans, decision records and changelogs as Markdown; with OpenDocs it turns them into links your team can open and PDFs you can send, without leaving the session. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Start Claude Code in your project folder (`claude`) and paste the prompt. 3. Approve the commands it asks to run: the skill installer (`npx skills add` or `install.sh`), possibly `npm install -g @opendocs.cc/cli`, and `opendocs login --email`. 4. Paste the 6-digit code from your email into the chat. Claude Code then reads the agent quickstart and asks what you'd like to publish. The skill is installed in `~/.claude/skills/opendocs`, so it's there in every project. The API key it saves is named `claude-code`, and version history shows which documents Claude Code published. ## Notes for Claude Code - **Where the skill lives.** Personal skills are in `~/.claude/skills//SKILL.md` and work in every project. Project skills in `.claude/skills/` travel with the repository. Claude Code uses the OpenDocs skill on its own when you ask to publish, share or export, and you can call it directly with `/opendocs`. - **If Claude Code doesn't see the skill**, start a new session. Setup itself doesn't need it: the prompt has Claude Code read the agent quickstart instead. - **Fewer permission prompts.** Claude Code asks before each shell command. To let OpenDocs commands run without asking, pick the "don't ask again" option when it asks, or add a rule to `.claude/settings.json`. The skill still asks you in chat before anything public, a signature request or a theme change. ```json { "permissions": { "allow": ["Bash(opendocs:*)"] } } ``` - **Install the OpenDocs.cc plugin** from the OpenDocs marketplace. It adds the skill, the MCP server and `/opendocs-cc:publish` and `/opendocs-cc:export`, and updates itself: ```text /plugin marketplace add opendocs-cc/skills /plugin install opendocs-cc@opendocs-cc ``` - **Or install the skill yourself:** ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a claude-code curl -fsSL https://opendocs.cc/install.sh | bash # no Node.js opendocs agent --install # already have the CLI opendocs agent --install .claude/skills/opendocs # this repo only; commit it to share ``` ## What to ask > **Ask your agent** > > "Write up the event-sourcing decision we just made as an ADR, publish it to the Platform project and give me the link." > > "Publish everything in docs/runbooks with the tag runbooks, then send me PDFs of the database failover and payment outage runbooks." > > "Share the Q3 investor update with the Brightwater team, everyone at @brightwater.example." Claude Code writes the file, publishes it and replies with the link on its own line, for example `opendocs.cc/halvard/projects/platform/adr-007-event-sourcing`, and says who can open it (workspace members, by default). PDFs land next to the Markdown files. Ask for a change later and it publishes the same file again: same link, new version. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json # The prompts above opendocs project list --json opendocs publish docs/adr/007-event-sourcing.md --project platform --json opendocs publish docs/runbooks --tags runbooks --json opendocs export database-failover payment-outage --format pdf -o ./exports --json opendocs share q3-investor-update.md @brightwater.example --json ``` `` arguments take a post ID, a slug, or a local `.md` file this folder published. Re-running `opendocs publish` on a file this folder already published updates it; there's no need for `opendocs update` or for keeping track of post IDs. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/codex # Codex Codex is OpenAI's coding agent, in the terminal, your IDE and the cloud. It's good at multi-step work like "write three docs, publish them and give me the links", and with OpenDocs those docs become links your team can open and PDFs you can send. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Start Codex in your project folder (`codex`), or open Codex in your IDE, and paste the prompt. 3. Approve the commands it asks to run: the skill installer (`npx skills add` or `install.sh`), possibly `npm install -g @opendocs.cc/cli`, and `opendocs login --email`. These need network access, so Codex usually asks to run them outside its sandbox. 4. Paste the 6-digit code from your email into the chat. Codex then reads the agent quickstart and asks what you'd like to publish. The skill is installed in `~/.agents/skills/opendocs`. When the CLI recognizes Codex from its environment, the API key it saves is named `codex` and version history shows which documents Codex published. ## Notes for Codex - **Where the skill lives.** Codex reads skills from `~/.agents/skills` (yours, in every project) and from `.agents/skills` inside a repository. It uses the OpenDocs skill when you ask to publish, share or export; you can also mention it directly with `$opendocs`. - **If Codex doesn't see the skill**, start a new session. Setup itself doesn't need it: the prompt has Codex read the agent quickstart instead. - **Network and the sandbox.** OpenDocs commands talk to `api.opendocs.cc`. In the default sandbox Codex asks before each one. To let them run inside the sandbox, turn on network access in `~/.codex/config.toml`: ```toml [sandbox_workspace_write] network_access = true ``` In Codex cloud tasks, internet access is off by default. Turn it on for the environment and allow at least `api.opendocs.cc` (plus `opendocs.cc` and `registry.npmjs.org` for setup). - **Make it a project habit.** Add a line to the repository's `AGENTS.md`, for example "When you finish a doc, publish it with the OpenDocs skill and reply with the link." - **Install it yourself:** ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a codex curl -fsSL https://opendocs.cc/install.sh | bash # no Node.js opendocs agent --install --agent codex # already have the CLI ``` `install.sh` writes to `~/.agents/skills/opendocs` when `~/.codex` or `~/.agents` exists, and to `~/.claude/skills/opendocs`. ## What to ask > **Ask your agent** > > "Document the schema changes on this branch as a migration guide, publish it to the Platform project and give me the link." > > "Write docs for the three new order endpoints in docs/api, publish them with the tag api-v2 and give me a table of the links." > > "Save the v3 migration guide to docs/migration-v3.md but don't publish it until I've read it." Codex writes the files, publishes them in one batch and replies with each link on its own line, for example `opendocs.cc/halvard/projects/platform/migration-v3`. Only workspace members can open them unless you ask otherwise. When you've read the draft and say "publish it", it publishes that file; later edits go to the same link as new versions. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json # The prompts above opendocs publish docs/migration-v3.md --project platform --json opendocs publish docs/api/create-order.md docs/api/get-order.md docs/api/cancel-order.md --tags api-v2 --json opendocs list --tag api-v2 --json ``` A multi-file publish returns one object with `total`, `succeeded`, `failed` and a `results` array; a batch with some failures still exits 0, so check `failed`. If versions show `opendocs-cli` instead of `codex` (Codex wasn't detected from its environment), set `OPENDOCS_CLIENT=codex` or pass `--client codex`. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/cursor # Cursor Cursor's agent reads your codebase, writes files and runs terminal commands, so it can write an API reference or a migration plan from your code and publish it in the same chat. You get a link your team can open and, when you ask, a PDF. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Open your project in Cursor, open the Agent chat and paste the prompt. 3. Approve the commands it asks to run: the skill installer (`npx skills add` or `install.sh`), possibly `npm install -g @opendocs.cc/cli`, and `opendocs login --email`. Cursor shows each command and waits for you to run it. 4. Paste the 6-digit code from your email into the chat. Cursor then reads the agent quickstart and asks what you'd like to publish. The skill is installed in `~/.cursor/skills/opendocs`. The API key it saves is named `cursor`, and version history shows which documents Cursor published. ## Notes for Cursor - **Where the skill lives.** Cursor loads skills from `~/.cursor/skills` for every project. Its agent uses the OpenDocs skill when you ask to publish, share or export. - **If Cursor doesn't see the skill**, start a new chat. Setup itself doesn't need it: the prompt has Cursor read the agent quickstart instead. - **Rules.** To make publishing part of how Cursor works in one project, add a rule in `.cursor/rules/` (the older `.cursorrules` file still works) or a line in `AGENTS.md`, for example "When you finish a doc, publish it with the OpenDocs skill and reply with the link." - **Fewer prompts.** Cursor asks before running terminal commands unless they are on the allowlist in its agent settings. Adding `opendocs` there lets OpenDocs commands run without asking; the skill still asks you in chat before anything public, a signature request or a theme change. - **Install it yourself:** ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a cursor opendocs agent --install --agent cursor # already have the CLI # No Node.js curl -fsSL https://opendocs.cc/install.sh | OPENDOCS_SKILL_DIR="$HOME/.cursor/skills/opendocs" bash ``` ## What to ask > **Ask your agent** > > "Read src/routes and write an API reference for the partner endpoints. Publish it to the Partner API project and give me the link." > > "Summarize what changed on this branch as release notes, publish them and give me a PDF for the changelog email." > > "Share the partner API reference with the Brightwater team, everyone at @brightwater.example." Cursor writes the Markdown file, publishes it and replies with the link on its own line, for example `opendocs.cc/halvard/projects/partner-api/partner-api-reference`. Only workspace members can open it until you share it. Sharing with `@brightwater.example` lets anyone with a verified address at that domain read that one document; they don't join your workspace. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json # The prompts above opendocs publish docs/partner-api-reference.md --project partner-api --json opendocs publish docs/release-notes-2.4.md --export pdf --json opendocs share docs/partner-api-reference.md @brightwater.example --json ``` With `--json`, a single publish returns one object (abridged): ```json { "postId": "8c1e4f52-6a0b-4d8e-9f3a-2b7d5c1e0a94", "slug": "partner-api-reference", "url": "/halvard/projects/partner-api/partner-api-reference", "title": "Partner API reference", "versionNumber": 1, "projectSlug": "partner-api", "projectSource": "flag" } ``` `url` is a path: prepend `https://opendocs.cc` before showing it. With `--export pdf` the object also has `export.path`, the local PDF next to the source file. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/copilot # GitHub Copilot GitHub Copilot's agent mode in VS Code, and the Copilot CLI, can run terminal commands in your workspace. With OpenDocs, the release notes, runbooks and specs it writes become links your team can open and PDFs you can send. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Open Copilot Chat in VS Code, switch to **Agent** mode and paste the prompt. In the Copilot CLI, paste it at the prompt. 3. Approve the commands it asks to run: the skill installer (`npx skills add` or `install.sh`), possibly `npm install -g @opendocs.cc/cli`, and `opendocs login --email`. Copilot shows each command and waits for you to allow it. 4. Paste the 6-digit code from your email into the chat. Copilot then reads the agent quickstart and asks what you'd like to publish. The skill is installed in `~/.copilot/skills/opendocs`. ## Notes for GitHub Copilot - **Where the skill lives.** Copilot loads personal skills from `~/.copilot/skills` and repository skills from `.github/skills`. If your version of Copilot doesn't load skills, use custom instructions instead. - **Custom instructions.** `.github/copilot-instructions.md` is added to every Copilot Chat request in the repository. Put the short OpenDocs guide there, or one line such as "When you finish a doc, publish it with the OpenDocs CLI and reply with the link": ```bash opendocs agent >> .github/copilot-instructions.md ``` - **Name the agent on versions.** OpenDocs doesn't detect Copilot on its own, so versions and the saved API key say `opendocs-cli`. Add "Pass `--client github-copilot` to every opendocs command" to your instructions to fix that. - **Be explicit about publishing.** Copilot treats the task as done when the file is written unless you ask for the link. "Publish it and give me the link" works better than assuming it will. - **Fewer prompts.** VS Code's `chat.tools.terminal.autoApprove` setting can allow `opendocs` commands without asking. The skill still asks you in chat before anything public, a signature request or a theme change. ```json { "chat.tools.terminal.autoApprove": { "opendocs": true } } ``` - **Install it yourself:** ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a github-copilot opendocs agent --install ~/.copilot/skills/opendocs # already have the CLI # No Node.js curl -fsSL https://opendocs.cc/install.sh | OPENDOCS_SKILL_DIR="$HOME/.copilot/skills/opendocs" bash ``` ## What to ask > **Ask your agent** > > "Turn the commits since v2.4.0 into release notes, publish them with the tag release and give me the link." > > "Write a troubleshooting guide for our CI from .github/workflows and publish it to the Engineering project so the team can see it." > > "Add the new environment variables section to the onboarding guide and publish it again." Copilot writes the Markdown, publishes it and replies with the link on its own line, for example `opendocs.cc/halvard/release-v2-5`. Only workspace members can open it unless you ask otherwise. Publishing the onboarding guide again keeps its link and adds a version, so people who bookmarked it see the new section. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json # The prompts above opendocs publish release-v2.5.md --tags release --client github-copilot --json opendocs publish docs/ci-troubleshooting.md --project engineering --client github-copilot --json opendocs publish docs/onboarding.md --client github-copilot --json # same file again: new version ``` If the onboarding guide was published from another machine or folder, the agent pulls it first and updates it by slug: `opendocs update docs/onboarding.md --post-id onboarding --json`. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/cline # Cline Cline is an autonomous coding agent that runs in your editor. It reads and writes files, runs terminal commands and chains steps, so "read the code, write the doc, publish it, give me the link" is one task. OpenDocs gives those docs a link your team can open and, when you ask, a PDF. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Open Cline, switch to **Act** mode (Plan mode doesn't run commands) and paste the prompt. 3. Approve the commands it asks to run: the skill installer (`npx skills add` or `install.sh`), possibly `npm install -g @opendocs.cc/cli`, and `opendocs login --email`. 4. Paste the 6-digit code from your email into the chat. Cline then reads the agent quickstart and asks what you'd like to publish. ## Notes for Cline - **Where the skill lives.** The `npx skills` installer puts the skill where Cline looks for global skills. Cline's skill support may need to be switched on in its settings. If Cline doesn't use the skill, add a rule instead. - **Rules.** Cline loads every file in a project's `.clinerules/` folder (and your global rules folder) into each task. The short OpenDocs guide makes a good rule: ```bash mkdir -p .clinerules opendocs agent > .clinerules/opendocs.md echo "- Pass --client cline to every opendocs command." >> .clinerules/opendocs.md ``` - **Name the agent on versions.** OpenDocs doesn't detect Cline on its own, so versions and the saved API key say `opendocs-cli` unless Cline passes `--client cline`, as in the rule above. - **Auto-approve.** If you let Cline run commands without asking, the skill still asks you in chat before anything public, a signature request or a theme change. - **Install it yourself:** ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a cline curl -fsSL https://opendocs.cc/install.sh | bash # no Node.js ``` Without Node.js, the skill and its bash client go to `~/.claude/skills/opendocs` (and `~/.agents/skills/opendocs` when that folder exists); point a rule at it if Cline doesn't pick it up. ## What to ask > **Ask your agent** > > "Look at src/services/billing.ts and write a doc explaining the new proration logic. Publish it to the Billing project with the tag billing." > > "For each service in src/services, write a one-page overview, publish them all with the tag architecture and give me the links." > > "Publish the v2 changelog publicly so customers can read it." Cline writes the files, publishes them in one batch and replies with each link on its own line, for example `opendocs.cc/halvard/projects/billing/proration`. Only workspace members can open them. For the public changelog it checks with you first, because anyone with the link will be able to read it, then publishes it as public. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y opendocs login --email dana@halvard.example --client cline --json opendocs login --email dana@halvard.example --code 482913 --client cline --json # The prompts above opendocs publish docs/billing-proration.md --project billing --tags billing --client cline --json opendocs publish docs/services --tags architecture --client cline --json opendocs publish CHANGELOG-v2.md --visibility public --confirm-public --client cline --json ``` Public publishing also needs the workspace's **Allow public documents** setting. Later edits to any of these files go to the same links when Cline publishes them again from this folder. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/aider # Aider Aider is a pair-programming tool for the terminal that edits files in your git repository. It doesn't run commands on its own: it suggests shell commands and runs them when you say yes. That's all OpenDocs needs, so changelogs, design notes and session summaries can become links your team can open. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Start Aider in your repository and paste the prompt. When Aider offers to add the URLs in it to the chat, say yes: that's how it reads the agent quickstart. 3. Aider suggests the commands: the installer (`npx skills add` or `install.sh`), `npm install -g @opendocs.cc/cli` and `opendocs login --email`. Say yes to run each one, and yes when it asks to add the output to the chat, so it sees what happened. 4. Paste the 6-digit code from your email into the chat. Aider suggests the `--code` command; run it. Aider has no skill support, so give it the OpenDocs instructions as a read-only file once setup is done: ```bash opendocs agent > OPENDOCS.md ``` ```text /read OPENDOCS.md ``` ## Notes for Aider - **Keep the instructions loaded.** Add the file to `.aider.conf.yml` so every session starts with it, or start Aider with `aider --read OPENDOCS.md`: ```yaml read: OPENDOCS.md ``` `opendocs agent` prints the short guide. `opendocs agent --full` prints the whole skill, which covers more but takes much more context. - **Run commands yourself when it's quicker.** `/run` (or `!`) runs a command and offers to add the output to the chat: ```text /run opendocs publish CHANGELOG-2.4.md --json ``` - **If Aider never offers to run commands**, check that shell command suggestions aren't turned off (`--no-suggest-shell-commands`). - **Name the agent on versions.** OpenDocs doesn't detect Aider on its own, so versions say `opendocs-cli`. Start Aider with the variable set to fix that: ```bash OPENDOCS_CLIENT=aider aider --read OPENDOCS.md ``` - **No Node.js?** `install.sh` puts the instructions and a bash client in `~/.claude/skills/opendocs`. Load them with `/read ~/.claude/skills/opendocs/SKILL.md`; Aider then runs `bash ~/.claude/skills/opendocs/scripts/opendocs.sh` instead of `opendocs`. ## What to ask > **Ask your agent** > > "Write a changelog for the commits since v2.3.0, grouped into features, fixes and breaking changes. Save it as CHANGELOG-2.4.md and publish it." > > "Summarize what we changed in this session as design notes, publish them to the Platform project and give me the link." > > "We decided to keep sessions in Redis. Write an ADR for it, publish it with the tag adr and send me a PDF." Aider writes the file, suggests the publish command and, once you say yes, gives you the link, for example `opendocs.cc/halvard/changelog-2-4`. Only workspace members can open it. Publishing the same file again later updates that link with a new version. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y npm install -g @opendocs.cc/cli opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json opendocs agent > OPENDOCS.md # The prompts above opendocs publish CHANGELOG-2.4.md --json opendocs publish docs/design-notes-session-store.md --project platform --json opendocs publish docs/adr/012-redis-sessions.md --tags adr --export pdf --json ``` See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/openclaw # OpenClaw OpenClaw is a personal agent you run on your own computer or server and talk to from chat apps such as WhatsApp, Telegram, Slack and Discord, or from the terminal. It runs commands on the machine its gateway runs on, so that's where OpenDocs is installed and signed in. You ask from your phone; the link comes back in the same chat. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Send the prompt to OpenClaw in any chat you use with it. 3. If your command approval settings ask, approve the skill installer (`npx skills add` or `install.sh`), `npm install -g @opendocs.cc/cli` and `opendocs login --email`. 4. Paste the 6-digit code from your email into the same chat. OpenClaw then reads the agent quickstart and asks what you'd like to publish. OpenClaw itself runs on Node.js 22 or later, so the `npx` installer works on its machine. ## Notes for OpenClaw - **Where the skill lives.** Skills shared by all your agents live in `~/.openclaw/skills` on the gateway machine; one agent's own skills live in `skills/` inside its workspace. The installer uses `~/.openclaw/skills`, or `~/.clawdbot` or `~/.moltbot` if that's what your install still uses. - **If OpenClaw doesn't see the skill**, start a new session (`/new`). Setup itself doesn't need it: the prompt has OpenClaw read the agent quickstart instead. - **Files land on the gateway machine.** PDFs from `--export` are written next to the Markdown on that machine. Ask OpenClaw to send you the file if your chat app takes attachments, or, on Pro and Team, to save it to one of your workspace's [Google Drive](google-drive.md) folders. - **Name the agent on versions.** OpenDocs doesn't detect OpenClaw on its own, so versions say `opendocs-cli`. Set `OPENDOCS_CLIENT=openclaw` in the environment the gateway runs in. - **Install it yourself** (on the gateway machine): ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a openclaw opendocs agent --install --agent openclaw # already have the CLI ``` ## What to ask > **Ask your agent** > > "Turn my notes from today's Halvard board call into minutes, publish them to the Board project and send me the link." > > "Save the approved minutes as a PDF to the Board Minutes folder in Drive." > > "Every Friday afternoon, turn this week's notes into a status update, publish it and post the link here." OpenClaw writes the Markdown on its machine, publishes it and replies with the link on its own line, for example `opendocs.cc/halvard/projects/board/board-call-2026-10-22`. Only workspace members can open it. For Drive it uses the folder names your workspace set up and asks if your words match more than one. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y npm install -g @opendocs.cc/cli opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json # The prompts above opendocs publish minutes/board-call-2026-10-22.md --project board --json opendocs integrations --json # Drive folder names opendocs save minutes/board-call-2026-10-22.md --folder "Board Minutes" --json opendocs publish status/2026-10-23.md --project board --json # each Friday ``` `opendocs save` returns the Drive link in `file.url`. Drive saving and signature requests need the Pro or Team plan and a connected integration. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [Google Drive](google-drive.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/integrations/hermes-agent # Hermes Agent Hermes Agent, from Nous Research, runs on your computer or a server and talks to you from the terminal or messaging apps such as Telegram, Discord, Slack and email. It remembers context across sessions, which suits documents you update every week: the brief keeps its link and gains a version each time. ## Set up with one prompt 1. Click **Copy prompt for agent** on [opendocs.cc](https://opendocs.cc), or copy it from the [Quickstart](../getting-started/quickstart.md). Already signed up? The **Connect your agent** card in your [dashboard](https://opendocs.cc/dashboard) has a version with your email filled in. 2. Send the prompt to Hermes in the terminal or any chat you use with it. 3. If Hermes asks you to approve commands, approve the skill installer (`npx skills add` or `install.sh`), `npm install -g @opendocs.cc/cli` and `opendocs login --email`. 4. Paste the 6-digit code from your email into the same chat. Hermes then reads the agent quickstart and asks what you'd like to publish. ## Notes for Hermes Agent - **Where the skill lives.** Hermes loads skills from `~/.hermes/skills` (or `$HERMES_HOME/skills`). If it doesn't see the new skill, start a new session. Setup itself doesn't need it: the prompt has Hermes read the agent quickstart instead. - **Install where commands run.** If Hermes runs commands in Docker, over SSH or in another remote backend, the CLI, the skill and the sign-in (`~/.config/opendocs/config.json`) all belong in that environment, not on the machine you chat from. - **Unattended servers.** Sign in once with an API key from the dashboard. The CLI reads `OPENDOCS_API_KEY` during `login` and saves it, so later commands work without the variable: ```bash OPENDOCS_API_KEY=od_live_xxxxx opendocs login --json ``` - **Name the agent on versions.** OpenDocs doesn't detect Hermes on its own, so versions say `opendocs-cli`. Set `OPENDOCS_CLIENT=hermes` in the environment Hermes runs commands in. - **Install it yourself:** ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a hermes-agent opendocs agent --install --agent hermes-agent # already have the CLI # No Node.js: the skill plus a curl + jq client curl -fsSL https://opendocs.cc/install.sh | OPENDOCS_SKILL_DIR="$HOME/.hermes/skills/opendocs" bash ``` ## What to ask > **Ask your agent** > > "Write this week's engineering brief from my notes, publish it to the Engineering project and send me the link here." > > "Add the rollout notes to last week's brief instead of making a new one." > > "Every Friday at 4pm, publish the status report and send the link to the team channel." Hermes publishes the brief and sends the link back to the chat you asked from, on its own line, for example `opendocs.cc/halvard/projects/engineering/engineering-brief`. Only workspace members can open it. When it updates the brief, the link stays the same and version history shows each week's edition and that Hermes published it. ## Under the hood ```bash # Setup npx skills add opendocs-cc/skills --skill opendocs -g -y npm install -g @opendocs.cc/cli opendocs login --email dana@halvard.example --json opendocs login --email dana@halvard.example --code 482913 --json # The prompts above opendocs publish briefs/engineering-brief.md --project engineering --json opendocs publish briefs/engineering-brief.md --json # same file again: new version opendocs history briefs/engineering-brief.md --json ``` Without Node.js, the same commands run through `bash ~/.hermes/skills/opendocs/scripts/opendocs.sh` (sign in once with its `login --email` or `login --key`). It doesn't upload local images, support `--export` on publish or save to Drive; run `export` separately. See the [Agent cookbook](../agents/cookbook.md) for every recipe. ## Related pages - [Set up your agent](overview.md) - [The OpenDocs skill](../getting-started/skill-md.md) - [What to ask your agent](../getting-started/what-to-ask.md) - [Agent cookbook](../agents/cookbook.md) --- URL: https://docs.opendocs.cc/getting-started/skill-md # The OpenDocs skill The OpenDocs skill is a `SKILL.md` file your agent loads when you ask it to publish, share or export a document. It holds the commands and the rules that go with them, such as "ask before making anything public" and "never guess a signer's email". With it installed, you say what you want in plain language and your agent knows which `opendocs` commands to run and what to tell you afterwards. You rarely need to think about it: the one prompt from the [Quickstart](quickstart.md) installs it for you. Read it any time at [opendocs.cc/skill.md](https://opendocs.cc/skill.md). ## How it gets installed | Way | What it installs | Use it when | | --- | --- | --- | | **The prompt** (**Copy prompt for agent** on opendocs.cc) | Your agent runs one of the installers below, then signs you in. | You're starting out. This is the usual path. | | `npx skills add opendocs-cc/skills --skill opendocs -g -y` | `SKILL.md` and `scripts/opendocs.sh` from [github.com/opendocs-cc/skills](https://github.com/opendocs-cc/skills), for every agent it finds on your machine. Needs Node.js 22+. | You have Node.js and want the skill in all your agents. | | `/plugin marketplace add opendocs-cc/skills`, then `/plugin install opendocs-cc@opendocs-cc` | The OpenDocs.cc plugin for Claude Code: the skill, the MCP server and `/opendocs-cc:publish` and `/opendocs-cc:export`, kept up to date by Claude Code. In Codex: `codex plugin marketplace add opendocs-cc/skills`, then `codex plugin add opendocs-cc@opendocs-cc`. | You use Claude Code or Codex. | | `curl -fsSL https://opendocs.cc/install.sh \| bash` | `SKILL.md`, `scripts/opendocs.sh` and, if missing, a checksum-verified `jq`, for every agent it finds (Claude Code, Codex, Cursor, Copilot, Gemini CLI, opencode, Cline, OpenClaw, Hermes Agent and more). | There's no Node.js on the machine. | | `opendocs agent --install [dir]` | The skill bundled with your CLI, for every agent it finds on your machine, or into the folder you name. See the [CLI reference](../cli/reference.md#opendocs-agent). | You already have the CLI, or want the skill in a specific folder or repository. | The `npx` installer may end with `✗ opendocs → PromptScript: PromptScript does not support global skill installation`. That's a known installer bug that only affects PromptScript; the skill is installed for your other agents. Each [agent page](../integrations/overview.md) lists the folder that agent reads skills from, and what to do for agents without skill support (print the instructions into a rules or instructions file instead). ## What it teaches your agent - **Signing you up.** Ask for your email, run `opendocs login --email`, ask you for the 6-digit code. Never run bare `opendocs login`, never ask you to copy API keys. Offer an anonymous 24-hour link only if you don't want an account. - **Publishing.** Write Markdown to a file, publish it, and publish the same file again to update it (same link, new version). Publish folders in one command, not a loop. Stop on a `version_conflict` and ask you. - **Keeping things organized.** Treat projects like branches in a repository: one per client, product or initiative. Check where a document will go, reuse existing projects, ask before creating a new one (unless you said to organize automatically). - **Exports.** `publish --export pdf` for a link and a file in one step. Word needs Pro or Team; Free PDFs carry a "Made with OpenDocs" footer. - **Who can see what.** Keep the default workspace visibility. Use `public` only when you asked for it. Share with specific people or a whole `@domain` instead of making a document public. - **Teams.** Confirm the email and role before sending an invitation, and ask before accepting one for you. - **Branding.** Propose a theme preset or a dark brand color and wait for your yes before changing it, because it changes every PDF and Word file in the workspace. - **Google Drive and signatures** (Pro and Team). Save only when you ask, using the folder names your workspace set up. Draft a signature request, read every signer back, offer the draft PDF, and send only after an explicit yes. - **What to tell you.** Each link on its own line, who can open it, the local path of any export, and the error message when something fails. - **Errors and limits.** What each error code means and how to recover, and to let the CLI wait out rate limits instead of adding retry loops. ## Where to read it - [opendocs.cc/skill.md](https://opendocs.cc/skill.md): the published copy. - `opendocs agent --full`: the copy bundled with your installed CLI. - `opendocs agent`: a short version for instruction files and small context windows. `--cli` and `--api` print CLI-only and API-only references. - The installed file itself, for example `~/.claude/skills/opendocs/SKILL.md`. ## Keep it up to date The skill changes with the CLI. To refresh it, run the install command again, or update the CLI and reinstall from it: ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y npm install -g @opendocs.cc/cli@latest && opendocs agent --install ``` ## When to skip it - You type `opendocs` commands yourself. See [Use the CLI yourself](cli-quickstart.md). - You're calling the REST API from your own code. See [Authentication](../api-reference/authentication.md). - Your agent can't load skills or instruction files. Paste the output of `opendocs agent` into the chat at the start of the session. ## Under the hood `npx skills` reads the discovery index at `https://opendocs.cc/.well-known/agent-skills/index.json`, which lists two files: `SKILL.md` and `scripts/opendocs.sh`. No GitHub repository is involved. `-a ` limits the install to one agent: ```bash npx skills add opendocs-cc/skills --skill opendocs -g -y -a claude-code ``` `install.sh` takes two overrides: `OPENDOCS_SKILL_DIR` (install only into that folder) and `OPENDOCS_BASE_URL`: ```bash curl -fsSL https://opendocs.cc/install.sh | OPENDOCS_SKILL_DIR="$HOME/.cursor/skills/opendocs" bash ``` `opendocs agent --install` writes only `SKILL.md`; the bash client isn't needed when the CLI is installed. With `--json` it returns `{ "installed": true, "path": "...", "version": "0.4.7" }`. `scripts/opendocs.sh` is a bash client that needs only `curl` and `jq`. It shares the CLI's config (`~/.config/opendocs/config.json`) and folder state (`.opendocs/state.json`), so installing the CLI later keeps the sign-in and the file-to-document mapping. It covers sign-in, publish, list, pull, history, share, export, claim, team invites and the theme. It doesn't upload local images, create projects from `--project`, export during publish, or run `status`, `clone`, `rollback`, `move`, `save` or `sign`; install the CLI for those. ```bash bash ~/.claude/skills/opendocs/scripts/opendocs.sh login --email dana@halvard.example bash ~/.claude/skills/opendocs/scripts/opendocs.sh publish q3-investor-update.md ``` The skill file's frontmatter `description` is what agents match your request against, which is why it lists phrases like "turn this into a shareable link" and "give me a PDF of these notes". ## Related pages - [Set up your agent](../integrations/overview.md) - [Agent quickstart](agent-quickstart.md) - [Agent cookbook](../agents/cookbook.md) - [CLI reference](../cli/reference.md) --- URL: https://docs.opendocs.cc/getting-started/agent-quickstart # Agent quickstart This page is for you, the agent. The person you're working with pasted the OpenDocs setup prompt: you installed the skill and probably signed them in. Finish the setup below, then ask them what they'd like to publish. The skill (`SKILL.md`) and the [CLI reference](../cli/reference.md) have every command; this page is the short version with the rules that matter most. Pass `--json` to every command. Output is then one JSON object on stdout, and errors are JSON on stderr with an `error` code and a `message` that says how to fix it. ## 1. Check the setup ```bash opendocs --version # 0.4.7 or later opendocs whoami --json # signed in? which workspace and project? organize preference? ``` - **No `opendocs` command:** with Node.js 20 or later, run `npm install -g @opendocs.cc/cli`. Without Node.js, use the bash client that came with the skill: `bash /scripts/opendocs.sh` (it needs `curl` and `jq`, and supports the core commands). - **Not signed in:** ask for their email, then: ```bash opendocs login --email --json # emails a 6-digit code, exits at once opendocs login --email --code --json # finishes; saves an API key ``` A new email gets an account, a workspace at `opendocs.cc/` and a Default project. On `invalid_code`, ask for the newest email; on `code_expired`, run the first command again. **Never run bare `opendocs login`**: without `--email` or `--key` it waits for input and your tool call hangs. - **Several workspaces:** if they name one, run `opendocs workspace list --json` and `opendocs workspace use `. ## 2. Say it's ready and ask what to publish Tell them which workspace they're in and that the Free plan covers 50 documents. Ask what they'd like to publish. If they're unsure, offer something from the current folder: the README, recent notes, a summary of the work you just did. ## 3. Publish ```bash opendocs publish report.md --json opendocs publish report.md --export pdf --json # also writes report.pdf next to it opendocs publish ./docs --tags "q3-review" --json # a folder or several files: one batched call opendocs publish proposal.md --project "Northwind" --json ``` - **Visibility defaults to `workspace`**: only members of their workspace can open it. That's right for "share with the team". - **Publishing the same file again updates it**: same URL, new version. The folder's `.opendocs/state.json` remembers which file is which document. Don't use `--new` unless they want a separate copy. - **Never loop `publish` once per file.** Pass the folder or all the files at once. - **Exports:** `--export pdf` works on every plan; `--export docx` needs Pro or Team. Re-running `publish --export pdf` after edits updates what changed and exports every file. - **Projects work like branches.** If the document belongs to a client, product or team, pass `--project`. Run `opendocs project list --json` first and reuse an existing project rather than creating a near-duplicate. Follow the `organize` preference from `whoami`: `ask` (ask before creating a project), `auto` (create and say so) or `off` (use the active project). ## 4. Report back - Put the full URL on its own line: the `url` field is a path such as `/halvard/q3-review`, so prefix `https://opendocs.cc`. - Say who can open it: "your workspace" (default), "only you", "the people you shared it with" or "anyone with the link". - After an export, give the file path (`export.path`). After an update, say which version it is now. Say which project it went to if it isn't the usual one. - If something failed, quote the error's `message`. It says what to do next. ## Ask before you do these | Action | Why | How | | --- | --- | --- | | Make a document public | Anyone on the internet can read it | Ask, then `--visibility public --confirm-public` | | Change the export theme | It changes every PDF and Word file in the workspace | Show the preset or color and font, ask, then `opendocs theme set ... --yes` | | Send a document for signing | Real people get an email | Create the draft, show the signers, send only after a clear yes: `opendocs sign send --yes` | | Delete a document | It can't be undone | Prefer `opendocs unpublish`. Delete only when asked, with `--yes` | | Overwrite after a `version_conflict` | Someone else published a newer version | Show it, `opendocs pull` to compare, `--force` only if they agree | | Invite someone to the workspace | It sends an email | Confirm the exact address and role | For "share it with the client", prefer `opendocs share client@example.com` over making it public. ## Errors you'll meet - `document_limit`: the Free plan's 50 documents are used. Tell them; suggest unpublishing old documents or upgrading. Don't retry. - `docx_requires_pro` or `plan_required`: Word export, a custom export footer and integrations need Pro or Team. Offer a PDF instead, or point them to [billing](https://opendocs.cc/dashboard/billing). - `rate_limited`: the CLI waits for the time the server asks and retries on its own. Don't add your own retry loop, and don't run exports in parallel. - Everything else: the [error reference](../errors.md). ## Next - [Agent cookbook](../agents/cookbook.md): recipes for folders, projects, versions, sharing, branding, Google Drive and signatures. - [CLI reference](../cli/reference.md): every command and flag. - [llms.txt](https://docs.opendocs.cc/llms.txt): every docs page as Markdown. --- URL: https://docs.opendocs.cc/agents/cookbook # Agent cookbook These are the recipes an agent follows when someone asks for something in OpenDocs, with the exact commands for CLI 0.4.7. If you're a person, you don't need this page: ask your agent, and see [What to ask your agent](../getting-started/what-to-ask.md) for ideas. If you're building an agent or tool, this is the behavior to copy. "You" below is the agent. "The person" is whoever you're working for. ## Before you start - **Install and sign in.** The CLI is `npm install -g @opendocs.cc/cli` (Node.js 20+). Without Node.js, run `curl -fsSL https://opendocs.cc/install.sh | bash` and use `bash ~/.claude/skills/opendocs/scripts/opendocs.sh` in place of `opendocs`; it covers sign-in, publish, list, pull, history, share, export, team invites and the theme, but not Drive, signatures or `--export` on publish. - **Pass `--json` on every command.** stdout is one JSON object. Errors go to stderr as `{ "error", "message", "docs_url" }` with a non-zero exit. - **`` is a post ID, a slug, or a local `.md` file this folder published.** - **Links.** API `url` fields are paths such as `/halvard/q3-investor-update`; prepend `https://opendocs.cc`. Put each link on its own line with nothing after it. - **Say who can open it**: workspace members (the default), only them (private), the people it's shared with, anyone (public), or anyone with the link for 24 hours (anonymous). - **Check before anything that reaches other people or is hard to undo**: public visibility, invitations, theme changes, signature requests, deletes. ## Sign the person up When there's no saved login (any command, `opendocs whoami --json` included, fails with `not_logged_in`), ask for their email and sign them up. It's free for up to 50 documents and needs no browser. ```bash opendocs login --email dana@halvard.example --json # → {"status": "code_sent", ...}. Ask: "Check your inbox for a code from OpenDocs and paste it here." opendocs login --email dana@halvard.example --code 482913 --json ``` A new email gets an account, a workspace at `opendocs.cc/`, a Default project and an API key named after you, saved to `~/.config/opendocs/config.json`. Codes expire after 10 minutes and allow 5 tries: on `invalid_code` ask for the newest email, on `code_expired` send a new one. Never run bare `opendocs login`; it waits for a key on stdin. If login returns `pendingInvitations`, ask before joining any of them. ## Publish without an account Only when the person doesn't want an account yet and agrees that anyone with the link can read it: ```bash opendocs publish notes.md --anonymous --json # url, claimUrl, expiresAt ``` Give them the `url` and the `claimUrl` exactly as returned, say it expires in 24 hours, and offer to sign them up. Logging in later from the same folder keeps the document (or run `opendocs claim`). Anonymous publishing allows 30 documents an hour and 100 a day per IP, 10 files per run and 512 KB per file. ## Publish a document and send a PDF "Publish the Q3 investor update to the Investors project and send me the PDF." ```bash opendocs project list --json opendocs publish q3-investor-update.md --project investors --export pdf --json ``` The result has the `url` and `export.path`, the PDF written next to the source file. Tell them both. PDF works on every plan, with the workspace's export theme; Free PDFs carry a "Made with OpenDocs" footer. Word (`--export docx`) needs Pro or Team. If the publish succeeds and the export fails, the document stays up; retry only the export: ```bash opendocs export q3-investor-update --format pdf --json ``` `opendocs export` writes a PDF unless you pass `--format docx` (Pro and Team). ## Publish a folder "Upload all the board pack docs." One command, never a loop: ```bash opendocs publish ./board-pack --tags q3-board --json opendocs publish ./board-pack --tags q3-board --export pdf --json # with PDFs ``` - Folders are recursive and skip `.obsidian`, `.trash`, `.git`, `.hg`, `.opendocs` and `node_modules`. - The CLI sends 25 documents per request and takes up to 500 files per run; each file can be up to 1 MB. - The result has `total`, `succeeded`, `failed` and `results[]` (plus `export.results[]` with each PDF's `path`). A run with some failures still exits 0: check `failed` and retry only those files. - The shared tag is how the person finds the group later: `opendocs list --tag q3-board --json`. ## Re-export a folder after edits "I've fixed the numbers, send me fresh PDFs." Run the same command again from the same folder: ```bash opendocs publish ./board-pack --export pdf --json ``` In CLI 0.4.6 this updates the files that changed (`updated[]` with `action: "updated"`), leaves the rest alone (`"unchanged"`, no new version) and writes a fresh PDF for every file in the folder. Report the new version numbers and the PDF paths. ## Keep a folder in sync The CLI records what each folder published in `.opendocs/state.json`, so publishing a file again updates the same document. To work on what's already online: ```bash opendocs clone --json # whole workspace into ./ opendocs clone board-pack --project board --json opendocs status --json # up-to-date, modified, behind, conflict, untracked opendocs pull board-pack/agenda.md -o board-pack/agenda.md # bring a "behind" file up to date opendocs publish . --json # publish every change; new files become new docs ``` On `version_conflict` (someone published since your last sync), stop. Show the person, compare with `opendocs pull --stdout`, and re-run with `--force` only if they want their copy to win. Don't commit `.opendocs/`; the CLI git-ignores it because it holds claim tokens. ## Update a document this folder didn't publish If the person names a document published elsewhere, use its slug: ```bash opendocs list --json --limit 20 # if you're not sure which one opendocs pull q3-investor-update --stdout > q3-investor-update.md # edit the file opendocs update q3-investor-update.md --post-id q3-investor-update --json ``` `update` adds a version and keeps the link. Omitted `--visibility` and `--tags` keep their current values. It has no `--export`; run `opendocs export` afterwards. Any active workspace member can update any document in the workspace, and the version history records who did. ## Put documents in the right project Projects work like branches in a repository: one per client, product or initiative. Before publishing, know where the document will go: ```bash opendocs whoami --json # organize: ask | auto | off, and folderProject opendocs project current --json # where the next publish goes, and why opendocs project list --json # names, document counts, recentTitles ``` - An existing project clearly fits: publish with `--project ` and say where it went. - A new, ongoing topic: with `organize: ask` (the default), ask once ("Want me to start a Brightwater project for this?"). With `auto`, create it and say so. With `off`, use the active project. - A folder or repository dedicated to one topic: `opendocs project link "Brightwater"` once, and every new file published from there goes to that project. - A one-off note: the active or Default project is fine. ```bash opendocs publish proposal.md --project "Brightwater" --json # a new name creates the project opendocs move old-proposal --project archive --json # the URL changes; ask first opendocs config set organize auto --json # when the person says "stop asking" ``` Default-project URLs are `opendocs.cc//`; project URLs are `opendocs.cc//projects//`. ## Switch workspace before publishing When the person names a workspace, check it's the active one: ```bash opendocs workspace list --json # match their words to name or slug opendocs workspace use halvard-board --json # only if activeSlug differs ``` Switching only changes the CLI's local config and resets the active project to that workspace's Default. If the workspace isn't listed (`not_a_member`), tell them which ones are. ## Versions and rollback "What changed in the investor update?" or "Go back to Tuesday's version." ```bash opendocs history q3-investor-update --json # newest first, who and which agent published opendocs pull q3-investor-update --version 3 --stdout # read an old version opendocs rollback q3-investor-update 3 --json # publish v3 again as a new version ``` Rollback never deletes history, so it can itself be undone. Tell them the new version number. ## Choose visibility safely ```bash opendocs publish plan.md --json # workspace (default) opendocs publish salary-bands.md --visibility private --json # only them opendocs visibility launch-faq public --confirm-public --json # anyone with the link ``` "Share with the team" means keep `workspace`. Use `public` only when the person explicitly asks for a public link, and say anyone with it can read the document. Public also needs the workspace's **Allow public documents** setting. Changing visibility, moving, sharing, unpublishing and deleting are for the document's author and the workspace's owners and admins. ## Share with specific people Prefer this to making a document public when the person wants to send it to a client, investor or contractor: ```bash opendocs share q3-investor-update.md sam@halvard.example --json # emails Sam a link opendocs share q3-investor-update.md @brightwater.example --no-notify --json opendocs share q3-investor-update.md --json # who has access opendocs share q3-investor-update.md sam@halvard.example --remove --json ``` Guests verify their email with a code and can read only that document; they don't join the workspace. ## Invite teammates "Add Sam to the workspace." Confirm the exact email and the role (`member` unless they say admin), because it sends an email: ```bash opendocs team invite sam@halvard.example --json opendocs team invite sam@halvard.example --role admin --json opendocs team list --json # members, pending invitations, auto-join domains ``` Tell them Sam has to accept the email. `team remove` and `team leave` need `--yes`, passed only after the person confirms. Free workspaces have 3 members and Pro workspaces 5; `member_limit` means an owner needs to upgrade. ## Change the export theme (ask first) The theme (preset, brand color, font, logo, footer) changes every PDF and Word file in the workspace. It's Pro and Team only, and only owners and admins can change it. Propose, wait for a yes, then apply: ```bash opendocs theme --json # current theme and canEdit opendocs theme presets --json # classic, boardroom, editorial, research, studio, # field-guide, letterpress, terminal, launch opendocs theme check "#13294B" --json # contrast check, changes nothing opendocs theme set --preset boardroom --yes --json opendocs theme set --color "#13294B" --font "IBM Plex Sans" --yes --json opendocs theme logo ./halvard-logo.png --yes --json opendocs theme set --logo-in-exports on --yes --json opendocs theme footer --company "Halvard" --tagline "Investor relations" --link-url halvard.example --yes --json opendocs export q3-investor-update --format pdf --json # preview for the person ``` The brand color must be dark: at least 4.5:1 against white, or the API refuses it with `low_contrast`. Use the deepest shade of the brand's hue. Without `--yes` outside a terminal these commands stop with `confirm_required`; `plan_required` means the workspace is on Free, `forbidden` means the person isn't an owner or admin. ## Save to Google Drive Pro and Team, once an owner or admin has connected Drive and named the folders in the dashboard's **Integrations** tab. Only save when the person asks. ```bash opendocs integrations --json # integrations[].destinations[].name, settings, dashboardUrl opendocs save q3-investor-update.md --folder "Investor updates" --json # PDF opendocs save board-minutes-oct --folder "Board Minutes" --format docx --version 3 --json ``` Use a folder name exactly as `opendocs integrations` lists it. If their words match none or several, ask. Give them `file.url` on its own line; `file.verified: true` means Drive's checksum matches what OpenDocs rendered. See [Google Drive](../integrations/google-drive.md). ## Request signatures Pro and Team, with DocuSeal connected. Signing is always two steps, never one. 1. **Draft.** Use only names and emails the person gave you or the document states; ask for anything missing. Nothing is emailed yet. ```bash opendocs sign request offer-letter.md \ --signer "Employee=Priya Natarajan " \ --signer "Company=Dana Whitfield " \ --subject "Please sign: Offer letter" \ --expires 2026-11-30 --file-to "Signed agreements" --json ``` 2. **Confirm.** Read back the summary: document and version, each signer and email with their role, the order (one after another, or all at once with `--parallel`), subject, expiry, where the signed copy is filed, and any `warnings`. Offer the exact PDF they'll receive: ```bash opendocs sign download --kind draft ``` 3. **Send** only after an explicit yes. "Looks fine?" or silence is not a yes. ```bash opendocs sign send --yes --json ``` If `confirmation.mode` is `browser`, your API key can't send (`approval_required`): give them `confirmation.approveUrl` on its own line and ask them to click Send there. If they change anything, cancel the draft (`opendocs sign cancel --yes`) and request a new one. Later: ```bash opendocs sign status --json # draft, pending, completed, declined, expired, cancelled, failed opendocs sign download # signed PDF; --kind audit for the certificate opendocs sign save --folder "Signed agreements" --json ``` Check status when asked; don't poll in a loop. A `signature` fenced block in the document marks where each role signs. See [E-signatures with DocuSeal](../integrations/docuseal.md). ## Handle errors Read `error` and quote `message` to the person; it says what to do next. | Error | What to do | | --- | --- | | `not_logged_in` | Sign them up (above). | | `invalid_code`, `code_expired`, `too_many_attempts` | Ask for the newest code, or send a new one. | | `version_conflict` | Stop and show them. `--force` only with their OK. | | `document_limit` | Free plan's 50 published documents are used. Don't retry; see below. | | `plan_required` | A custom export footer and integrations need Pro or Team (Word export returns `docx_requires_pro`). The rest of the theme works on Free. Offer the upgrade. | | `confirm_required` | You ran a command that needs `--yes`. Ask first. | | `confirm_public_required` | Public needs `--confirm-public` and their explicit OK. | | `forbidden` | Their role can't do this; an owner or admin can. | | `integration_not_connected`, `reconnect_required` | An owner or admin connects Drive or DocuSeal in the dashboard (`dashboardUrl`). | | `destination_not_found` | Pick a folder from `destinations` with the person. Never guess. | | `signer_roles_mismatch`, `invalid_signers` | Ask who signs for each role; fix the `--signer` values. | | `too_many_files`, `too_many_posts` | Split into runs of 500 files, or exports of 10. | | `export_failed` | Retry the export; the document is still up. | | `rate_limited` | See below. | The full list is in [Errors](../errors.md). ## Rate limits and big jobs Limits are per account for signed-in requests and per IP otherwise, per minute: 600 requests per IP overall, 120 publishes, 20 batch publishes (25 documents each), 120 exports, 30 batch exports (10 documents each), and at most 4 exports running at once per account. Anonymous publishing allows 30 an hour and 100 a day per IP. The CLI (0.4.6+) handles a `429` for you: it waits the `Retry-After` time and retries, up to 5 times for waits of up to 90 seconds, so a large publish slows down instead of failing. Longer waits (the hourly anonymous limit, sign-in codes) come straight back as `rate_limited`; tell the person when to try again. Don't add your own retry loops and don't run exports in parallel. One `publish --export` or `export --project` call handles a whole folder or project. If you call the API directly, honor `Retry-After` yourself. ## When the Free document limit is reached `document_limit` won't change on retry. Unpublished documents don't count toward the 50, so offer: - publishing only the files that fit (the error says how many slots are left), - unpublishing old documents with `opendocs unpublish `, after they pick which, - upgrading to Pro for unlimited documents. ## Checklist - The content is saved to a `.md` file. - `--json` on every command. - The right workspace and project, checked when it matters. - One command for a folder, with a shared tag. - No public visibility, invitation, theme change, signature request or delete without the person's explicit yes. - Each link on its own line, who can open it, and the path of any export. ## Related pages - [The OpenDocs skill](../getting-started/skill-md.md) - [CLI reference](../cli/reference.md) - [Errors](../errors.md) - [Plans and limits](../getting-started/plans-and-limits.md) - [Set up your agent](../integrations/overview.md) --- URL: https://docs.opendocs.cc/publishing/publish # Publish a document Publishing turns a Markdown file into a page at a link your team can open. Use it whenever a document your agent wrote needs to be read by someone else: a spec, a board update, release notes, a handbook. > **Ask your agent** > > "Publish the Q3 investor update to the Investors project and send me the PDF." > > "Publish everything in the `docs` folder and tag it onboarding." > > "Publish the pricing notes, but keep them private to me for now." ## What you get - **A link that doesn't change.** A document in the Default project lives at `opendocs.cc/halvard/q3-investor-update`; in a named project it's `opendocs.cc/halvard/projects/investors/q3-investor-update`. Updates keep the same link. See [Projects](./projects.md). - **Workspace visibility by default.** Members of your workspace can open it; nobody else can. Your agent can make a document private to you, share it with specific people, or (after asking you) make it public. See [Who can see a document](../visibility/overview.md). - **A title and slug from the file.** The first `# Heading` becomes the title, and the slug in the URL is made from it. - **Your images.** Images next to the Markdown file are uploaded with it, so the page shows them. - **A PDF or Word file if you asked.** It's written next to the source file: `q3-investor-update.md` gets `q3-investor-update.pdf`. PDF works on every plan; Word needs Pro or Team. See [PDF, Word and branding](./branded-exports.md). Publishing the same file again from the same folder updates the document instead of creating a copy, so "publish it again" after an edit is safe. See [Updates and versions](./update-and-version-history.md). On Free, a workspace can have 50 published documents. Updates don't count. See [Plans and limits](../getting-started/plans-and-limits.md). ## Under the hood Your agent saves the Markdown first, then runs `opendocs publish` with `--json` so it can read the result instead of parsing terminal text. ```bash opendocs publish q3-investor-update.md --project Investors --export pdf --json ``` ```json { "postId": "7f3c9a52-1d4e-4b8a-9c61-2e5f8a0b3d17", "slug": "q3-investor-update", "url": "/halvard/projects/investors/q3-investor-update", "title": "Q3 investor update", "tags": [], "versionNumber": 1, "projectSlug": "investors", "projectName": "Investors", "projectSource": "flag", "export": { "format": "pdf", "path": "q3-investor-update.pdf", "bytes": 184320, "success": true } } ``` `url` is a path on `opendocs.cc`. `projectSource` says why the document landed in that project: `flag` (`--project`), `path` (a `projects//` folder in a clone), `folder` (a linked folder) or `active` (the CLI's active project). ### Flags | Flag | Meaning | | --- | --- | | `--title ` | Override the title. Single file only. | | `--slug <slug>` | Choose the URL slug. Single file only. | | `--visibility <level>` | `private`, `workspace` (default) or `public`. | | `--confirm-public` | Required with `--visibility public`. | | `--tags <tags>` | Comma-separated tags, applied to every file. | | `--project <name>` | Project name, slug or ID instead of the active project. A new name creates the project. | | `--export <format>` | Also export to `pdf` or `docx` and save next to the source. | | `--new` | Create new documents even for files this folder already published. | | `--force` | Overwrite the live version even if someone published a newer one. See [Sync a folder](./sync-and-history.md#conflicts). | | `--anonymous` | Publish without an account: a 24-hour link. See [Share with people](../visibility/sharing-and-anonymous-links.md#anonymous-links). | | `--json` | Global. Machine-readable output. | | `--api-url <url>` | Global. Use a different API host. | The CLI sends `markdown`, `title` and `slug` (when passed), `visibility`, `workspaceId`, `projectId`, `tags`, `sourcePath` and `confirmPublic` to [`POST /api/v1/publish`](../api-reference/publish.md). ### Titles and slugs - The title is the frontmatter `title` if there is one, otherwise the first `# Heading`. `--title` overrides both. - Without `--slug`, the slug is made from the title. - A slug that's taken in the project gets a numeric suffix (`launch-plan-2`). - `tag`, `tags`, `project` and `projects` are reserved. A generated slug gets a suffix; an explicit `--slug` with one of them is refused with `reserved_slug`. ### Many files and folders Pass several files, or a folder, and the CLI publishes them in batches: ```bash opendocs publish docs/*.md --tags onboarding --json opendocs publish ./handbook --project Handbook --json ``` - Folders are read recursively for `.md` files. `.git`, `.hg`, `.obsidian`, `.opendocs`, `.trash` and `node_modules` are skipped. - Up to 500 files per run, sent to `POST /api/v1/publish/batch` in requests of 25. Each file can be up to 1 MB. - `--title` and `--slug` are refused with more than one file; each file's first heading becomes its title. `--visibility`, `--tags` and `--confirm-public` apply to every file. - A shared tag finds the group again: `opendocs list --tag onboarding`. - One command for the whole folder is better than a loop over files: it signs in once, reports one summary and keeps the rate limits happy. ### Local images Images referenced with `![alt](./charts/revenue.png)`, `<img src="...">` or reference-style links are uploaded before the document, and the Markdown is rewritten to point at the uploaded copies. - JPEG, PNG, WebP, GIF and SVG, up to 10 MB each and 30 per document. - The image must be inside the folder that holds the Markdown file (subfolders are fine). A path that leaves it, such as `../../private.png`, is skipped with a warning. - Remote image URLs are left as they are. ### Publish and export together ```bash opendocs publish board-report.md --export pdf --json opendocs publish ./investors --export pdf --json ``` The CLI publishes first, then exports each document and writes it next to its source (`investors/q3-update.md` gets `investors/q3-update.pdf`). Since CLI 0.4.6, re-running it on a folder that's already published updates the files that changed and exports every file, including the unchanged ones, so you get a fresh set of PDFs after a round of edits. If an export fails, the document is still published; the CLI prints a retry command such as `opendocs export <postId> --format pdf`. `--export docx` needs Pro or Team (`docx_requires_pro` otherwise). `opendocs update` has no `--export`; run `opendocs export` after it. ### Public publishing ```bash opendocs publish changelog.md --visibility public --confirm-public ``` Without `--confirm-public`, the CLI and the API refuse. Even then, people outside the workspace can read it only when the workspace owner has turned on public documents. See [Public documents](../visibility/public-sharing.md). :::warning Don't use `public` to share something with your team. `workspace`, the default, already does that. Use `public` only for links anyone on the internet may read. ::: ### Plan limit Before uploading anything, the CLI checks the workspace's remaining document slots and refuses a run that won't fit with `document_limit`. The API enforces the same cap. ## Related pages - [Updates and versions](./update-and-version-history.md) - [Sync a folder](./sync-and-history.md) - [Markdown that renders](./rendering-and-metadata.md) - [CLI reference](../cli/reference.md) --- URL: https://docs.opendocs.cc/publishing/projects # Projects A project groups documents that belong together inside a workspace, the way a branch keeps a body of work apart in a repo: one per client, product, team or initiative. Every workspace has a **Default** project for one-off documents. If you never create another, the workspace works as a single library. > **Ask your agent** > > "Start a project for the Northwind engagement and put the proposal in it." > > "What's in the Investors project?" > > "Move last year's board notes to Archive." ## What happens - **The URL shows the project.** Default-project documents sit right under the workspace; documents in a named project carry its slug: ```text https://opendocs.cc/halvard/onboarding-checklist https://opendocs.cc/halvard/projects/investors/q3-investor-update ``` Each project also has its own page, `opendocs.cc/halvard/projects/investors`, and tag pages are scoped the same way (`opendocs.cc/halvard/tag/finance`, `opendocs.cc/halvard/projects/investors/tag/finance`). - **Your agent keeps things organized.** Before publishing, it checks which project a document would land in and what each project holds. When you change topic, it files the document in the matching project or suggests a new one. One-off documents stay in Default. - **Moving changes the link.** A document moved to another project gets that project's URL, and the old link stops working. Move before you share. Moving never changes the content or the version history. - **Tags work inside projects.** Use a project for the body of work and tags for smaller labels in it: an Investors project with documents tagged `board`, `fundraising` and `finance`. Any member can create a project. Owners and admins can rename or delete one; a project must be empty to be deleted, and Default can't be renamed or deleted. Moving a document is for its author, owners and admins. ### How proactive your agent is The `organize` preference tells your agent how much to decide on its own. Say "create projects without asking" or "stop sorting my documents" and it changes it: ```bash opendocs config set organize ask # default: suggest new projects, ask first opendocs config set organize auto # create and pick projects without asking, then say where things went opendocs config set organize off # always use the active project ``` ## Under the hood ### Which project a new document goes to For each file it hasn't published before, the CLI picks the first of: 1. `--project <name>` on the command (created if the name is new). 2. The file's place in a cloned workspace: files under `projects/<slug>/` go to that project. 3. The folder's linked project (`opendocs project link`). 4. The CLI's active project (`opendocs project use`), Default to begin with. The publish result reports it as `projectSource`: `flag`, `path`, `folder` or `active`. ### Commands ```bash opendocs project list # projects, document counts and recent titles opendocs project current # where this folder publishes, and why opendocs project create "Northwind" --slug northwind --use opendocs project use investors # switch the active project opendocs project use default # back to Default opendocs project rename investors --name "Investor relations" --slug investor-relations opendocs project delete old-drafts --yes # empty, non-default projects only ``` `--name` is required for `rename`. Changing a project's slug changes the URL of every document in it. Link a folder to a project, so new documents published from it go there: ```bash opendocs project link "Northwind" # created if the name is new opendocs publish ./proposal # → Northwind opendocs project unlink ``` `opendocs clone --project <slug>` links the cloned folder for you. Publish to a project without switching, move a document, or work with one project: ```bash opendocs publish proposal.md --project Northwind opendocs move board-notes-2025 --project Archive # created if new opendocs list --project investors opendocs list --all-projects opendocs pull --project investors --output ./investors opendocs export --project investors -f pdf # into ./investors-pdf/ ``` `opendocs move` reports the new URL. If the slug is taken in the target project, the document gets a suffix and the CLI says so. Re-publishing a file this folder already published with `--project <other>` also moves it. `opendocs workspace use <slug>` switches workspace and resets the active project to that workspace's Default. The project endpoints are in the [Projects API](../api-reference/projects.md). ## Related pages - [Publish a document](./publish.md) - [Find, download and remove](./list-get-pull-unpublish.md) - [Sync a folder](./sync-and-history.md) - [Workspaces and teams](../visibility/workspaces-and-team-access.md) --- URL: https://docs.opendocs.cc/publishing/update-and-version-history # Updates and versions When a document changes, your agent publishes the new Markdown to the same document. The link stays the same, so everyone you sent it to sees the latest version, and every earlier version is kept. > **Ask your agent** > > "I edited the handbook, update it." > > "Who changed the pricing spec this week, and what did it say on Monday?" > > "Roll the pricing spec back to version 3." ## What happens - **Same link, new version.** Readers who open the link get the newest version. Content that hasn't changed doesn't create a version. - **Every version is kept,** with when it was published, who published it and through which agent, such as Claude Code or Cursor. - **Rolling back never deletes anything.** Restoring version 3 publishes its content again as the newest version, so a rollback can itself be undone. - **Your team can edit too.** Any active member of the workspace can update a document, change its tags or restore a version, not only its author. The history shows who made each change. Changing who can see it, moving, sharing, unpublishing and deleting are for the author, owners and admins. See [Workspaces and teams](../visibility/workspaces-and-team-access.md#who-can-do-what). - **No silent overwrites.** If a teammate or another agent published a newer version since your copy, your agent's update stops and it tells you, instead of replacing their work. See [Sync a folder](./sync-and-history.md#conflicts). ## Under the hood ### Two ways to update **Publish the file again** from the folder that first published it. This is what your agent normally does: ```bash opendocs publish handbook.md --json ``` The CLI finds the document in `.opendocs/state.json`, sends the version your copy is based on, and the API refuses with `version_conflict` if the live document has moved on. The result lists the file under `updated` with `action`: `updated`, `unchanged`, `conflict` or `failed`. See [Sync a folder](./sync-and-history.md). **`opendocs update`** works on any document you can edit, from any folder: ```bash opendocs update pricing-spec.md --post-id pricing-spec --tags pricing,q4 --json ``` | Flag | Meaning | | --- | --- | | `--post-id <id-or-slug>` | Required. The document to update. | | `--title <title>` | Override the title. | | `--visibility <level>` | `private`, `workspace` or `public`. Omit to keep the current one. | | `--confirm-public` | Required when changing to `public`. | | `--tags <tags>` | Replace the tags with this comma-separated list. Omit to keep them. | | `--json` | Global. Machine-readable output. | ```json { "postId": "4b1e7c20-8f3a-4d59-b6e2-91c0d7a3f845", "versionId": "a9d2e6f1-3c47-4b80-8e15-7f2b9c6d0e34", "versionNumber": 4, "unchanged": false, "slug": "pricing-spec", "url": "/halvard/pricing-spec", "title": "Pricing spec", "visibility": "workspace", "tags": ["pricing", "q4"] } ``` Things to know about `update`: - It uploads local images the same way `publish` does. - It doesn't check for conflicts and doesn't update `.opendocs/state.json`. For a file this folder tracks, use `publish` instead, or the next `publish` reports a conflict with your own update. - A slug in `--post-id` resolves inside the active workspace and project, so it finds a teammate's document as well as your own. Any member of the workspace can update a workspace document. - Unchanged content returns `"unchanged": true` and no new version, but a new title, visibility or tag list still applies. - Changing visibility through `update` needs the same rights as `opendocs visibility`: author, owner or admin. - There's no `--export`. Run `opendocs export <doc> -f pdf` afterwards. - It only works on published documents. See [Unpublish and delete](./list-get-pull-unpublish.md#unpublish-and-delete). ### Version history and rollback ```bash opendocs history pricing-spec.md # every version, newest first opendocs pull pricing-spec.md --version 3 --stdout opendocs rollback pricing-spec.md 3 # alias: opendocs restore ``` `<doc>` can be a post ID, a slug, or a local `.md` file this folder published. `history --json` returns each version as: ```json { "versionNumber": 5, "createdAt": "2026-10-21T09:14:03.000Z", "createdBy": "dana", "client": "claude-code", "restoredFromVersion": 3, "isCurrent": true } ``` `client` comes from the `X-OpenDocs-Client` header. The CLI detects Claude Code, Cursor, Codex, Gemini CLI and OpenCode on its own; other agents set it with the global `--client <name>` flag or `OPENDOCS_CLIENT`. `restoredFromVersion` is set on versions made by a rollback. Rollback doesn't touch your local file: run `opendocs pull pricing-spec.md -o pricing-spec.md` before editing again. The endpoints are listed under [Agent endpoints](../api-reference/agent-endpoints.md#version-history). ## Related pages - [Sync a folder](./sync-and-history.md) - [Find, download and remove](./list-get-pull-unpublish.md) - [How OpenDocs works](../getting-started/how-opendocs-works.md) --- URL: https://docs.opendocs.cc/publishing/sync-and-history # Sync a folder Your agent works from a folder of Markdown files. OpenDocs remembers which file is which document, so publishing again updates documents instead of creating copies, and you can download a whole workspace or project, edit it locally and publish the changes back. > **Ask your agent** > > "Download the Handbook project so I can edit it here." > > "What's changed in the handbook since we last published?" > > "Publish my edits to the handbook." ## What happens - **Publishing again updates.** The first publish of `notes.md` creates `opendocs.cc/halvard/notes`; the next one adds a version at the same link. A file that hasn't changed is reported as unchanged and gets no new version. - **A downloaded copy stays linked.** Files your agent downloads with `clone` are tied to their documents, so publishing the folder updates them, and new files become new documents. - **You can see what's out of step.** Your agent can list which files you changed, which changed online, and which are new. - **Clashing edits stop.** If someone published a newer version since your copy, that file isn't published; your agent tells you and asks which version to keep. ## Under the hood ### How the CLI remembers files The CLI records each published file in `.opendocs/state.json`, in the current folder or the nearest parent folder that has one. It holds the post ID, the version your copy is based on and a hash of the file. ```bash opendocs publish notes.md # v1, opendocs.cc/halvard/notes # ...edit notes.md... opendocs publish notes.md # v2, same URL ``` - `--new` creates a new document even for a file the folder already published. - `.opendocs/` gets its own `.gitignore`, because it can hold claim tokens for anonymous documents. - Re-publishing a tracked file with `--project <other>` moves the document to that project (author, owners and admins only). - `opendocs update --post-id` doesn't read or write this file. See [Updates and versions](./update-and-version-history.md#two-ways-to-update). ### Clone a workspace or project ```bash opendocs clone # the whole workspace into ./halvard/ opendocs clone handbook --project handbook cd handbook opendocs status # what changed locally or online opendocs publish . # publish every change; new files become new documents ``` | Flag | Meaning | | --- | --- | | `[dir]` | Target folder. Defaults to the workspace slug, or the project slug with `--project`. | | `--project <slug>` | Clone one project and link the folder to it. | | `--tag <tag>` | Only documents with this tag. | | `--overwrite` | Replace files that already exist in the target folder. | A workspace clone puts Default-project documents at the root and every other project under `projects/<slug>/`. New files you add under `projects/<slug>/` publish to that project. ### Status `opendocs status` compares every tracked file with the live documents and lists untracked `.md` files too: | Shown as | `status` in `--json` | Meaning | | --- | --- | --- | | up to date | `up-to-date` | Nothing changed. | | modified locally | `modified` | You edited it. `opendocs publish .` sends it. | | newer version online | `behind` | Someone published since your copy. | | changed locally and online | `conflict` | Both. Publishing it will stop with `version_conflict`. | | new (not published) | `untracked` | A new file. Publishing creates a document. | | file deleted locally | `missing-locally` | The document is still online. | | no longer online | `gone-remotely` | It was unpublished or deleted. | | anonymous | `anonymous` | A 24-hour anonymous link from this folder. | ### Conflicts Every update from a tracked file sends the version it was based on (`baseVersionNumber`). If the live document has moved past it, the API answers `409 version_conflict` with `currentVersionNumber`, and the CLI leaves that file alone and carries on with the rest. ```bash opendocs pull notes.md --stdout # read the live version opendocs pull notes.md -o notes.md # take theirs (your file is replaced) opendocs publish notes.md --force # keep yours as the newest version ``` Pulling the latest version into a tracked file brings it back in step, so the next publish goes through. `--force` skips the check; the teammate's version stays in the history either way. ### History Version history and rollback work on tracked files by name: `opendocs history notes.md`, `opendocs rollback notes.md 2`. See [Updates and versions](./update-and-version-history.md#version-history-and-rollback). ## Related pages - [Updates and versions](./update-and-version-history.md) - [Projects](./projects.md) - [Find, download and remove](./list-get-pull-unpublish.md) --- URL: https://docs.opendocs.cc/publishing/list-get-pull-unpublish # Find, download and remove documents Once documents are published, your agent can find them, bring their Markdown back into your folder, export them, change who can see them, and take them down. > **Ask your agent** > > "What have we published in the Investors project?" > > "Get me the current Markdown of the onboarding handbook." > > "Take down the old pricing page." ## What happens - **Lists follow your active project.** Your agent lists the project you're working in and tells you how many documents the other projects hold. Ask for "everything in the workspace" to see them all. - **Downloads are plain Markdown.** One document, a whole project or the whole workspace, written into your folder. To edit and publish back, see [Sync a folder](./sync-and-history.md). - **"Take it down" means unpublish.** Your agent unpublishes unless you clearly ask for deletion, and asks before deleting, because deletion can't be undone. ### Unpublish and delete | | Unpublish | Delete | | --- | --- | --- | | The link | Stops working | Stops working | | On the server | The document and every version are kept | Removed, with every version and tag | | Who still sees it | Its author and the workspace's owners and admins (lists, `get`, `pull`); everyone else gets not found | Nobody | | The URL slug | Stays reserved, so nothing else takes it | Freed for reuse | | A Free plan slot | Freed | Freed | | Undo | No command brings it back at the same link | None | To bring it back, publish the file as a new document (`--new` from the folder that published it). It gets a new link, such as `pricing-2`, because the unpublished one keeps its slug. Use unpublish when you want something offline but kept; delete when it should be gone and its URL free. Unpublishing and deleting are for the document's author, owners and admins, from the CLI, the API or the dashboard; see [Who can do what](../visibility/workspaces-and-team-access.md#who-can-do-what). ## Under the hood Commands take a document as a post ID or a slug. `pull`, `export`, `history`, `rollback`, `move` and `share` also accept a local `.md` file this folder published. A slug resolves inside the active workspace and project, so it finds teammates' documents as well as your own; a post ID works wherever you can read the document. What you can then change depends on your role (see [Who can do what](../visibility/workspaces-and-team-access.md#who-can-do-what)). ### List ```bash opendocs list # active workspace, active project opendocs list --project investors # another project opendocs list --all-projects # every project in the workspace opendocs list --all # every workspace you belong to opendocs list --tag board --page 2 --limit 50 opendocs list --json ``` `--page` and `--limit` take positive integers; `--limit` is at most 100. A project-scoped list ends with a hint such as `37 more documents in 4 other projects: guides (30), handbook (3), ...`. The JSON has the page, limit, total and each document's ID, slug, title, visibility, `isPublished`, version number, project and `workspaceId` / `workspaceSlug`. `scope` is `"all"` with `--all` and `"workspace"` otherwise; `projectSlug` is the listed project (`null` with `--all-projects` or `--all`). Project-scoped lists also carry `otherProjects` as `{ name, slug, postCount }`. Unpublished documents are listed with `isPublished: false`. ### Get ```bash opendocs get q3-investor-update --json ``` Shows the URL, post ID, slug, project, visibility, whether it's published, the version number, when it was updated, and its tags. ### Pull ```bash opendocs pull q3-investor-update # saves q3-investor-update.md opendocs pull q3-investor-update --stdout opendocs pull q3-investor-update -o drafts/q3.md opendocs pull q3-investor-update --version 2 --stdout opendocs pull --project investors -o ./investors opendocs pull --workspace -o ./halvard-backup opendocs pull --workspace --tag board --dry-run ``` | Flag | Meaning | | --- | --- | | `-o, --output <path>` | File for one document; folder for bulk pulls. | | `--stdout` | Print the Markdown. One document only. | | `--version <n>` | An earlier version. See `opendocs history`. | | `--project [slug]` | Every document in the active project, or the one named. | | `--workspace` | Every project in the active workspace. | | `--tag <tag>` | Only documents with this tag (bulk pulls). | | `--overwrite` | Replace existing files (bulk pulls). | | `--dry-run` | Show what would be written, write nothing. | A workspace pull writes Default-project documents at the output root and other projects under `projects/<slug>/`. A bulk pull stops before writing if a file exists, unless you pass `--overwrite`. Unlike `clone`, a pull doesn't link the files for re-publishing. If you wrote the document or are a member of its workspace, a pull gets the full source, [`private` blocks](./rendering-and-metadata.md#private-blocks) included. A guest it was shared with gets it without them. ### Export ```bash opendocs export q3-investor-update -f pdf opendocs export q3-investor-update -f pdf -o exports/ opendocs export intro guide api-spec -f pdf -o ./exports opendocs export --project investors -f pdf ``` The default format is `pdf`; pass `-f docx` for Word (Pro and Team). Single exports are saved as `<slug>.pdf` in the current folder unless `-o` names a file or folder; several documents (up to 10 per command) or a whole `--project` go into a folder. Filenames from the server are used only as plain names inside that folder. See [PDF, Word and branding](./branded-exports.md#export-commands) for every flag. ### Change visibility ```bash opendocs visibility q3-investor-update private opendocs visibility q3-investor-update workspace opendocs visibility changelog public --confirm-public ``` Changes who can see a document without creating a version or re-uploading anything. Going `public` without `--confirm-public` fails with `confirm_public_required` before any request is sent. See [Who can see a document](../visibility/overview.md). ### Unpublish ```bash opendocs unpublish old-pricing ``` Sets the document offline (`isPublished: false`) and keeps the record, its versions and its slug. `opendocs update` and `opendocs visibility` refuse unpublished documents, and publishing the tracked file again fails; pass `--new` to publish it as a new document. ### Delete ```bash opendocs delete old-pricing --yes ``` Removes the document, every version and its tags in one transaction, and frees the slug. There's no recycle bin. The deletion is recorded in the workspace's audit log. - Outside a terminal (agents, scripts, CI), `--yes` / `-y` is required. Without it the CLI exits with `confirm_required` and sends nothing. - At a terminal without `--yes`, you're asked to type the post ID or slug again. Anything else cancels. ### Tips for agents - Use `list --json` to find the right document, and `get` to check its URL or visibility before changing it. - Use `pull --stdout` to read the current body without writing a file. - Use `visibility` rather than `update` to change only who can see a document. - "Remove" or "take down" means `unpublish`. Delete only when asked, with `--yes`. ## Related pages - [Sync a folder](./sync-and-history.md) - [Updates and versions](./update-and-version-history.md) - [Post changes API](../api-reference/post-mutations.md) --- URL: https://docs.opendocs.cc/publishing/branded-exports # PDF, Word and branding Any document can come back as a PDF or a Word file, typeset from the same Markdown by OpenDocs's converter rather than printed from a web page. Every export uses your workspace's **export theme**: a brand color, a font and your logo on any plan, and on Pro and Team your own footer in place of "Made with OpenDocs". Files from you, your team and your agents look the same. > **Ask your agent** > > "Send me the board report as a PDF." > > "Export everything in the Investors project as PDFs." > > "Use the Boardroom preset with our logo on every export." ## What you get - **A file in your folder.** When your agent publishes and exports in one step, the PDF lands next to the Markdown (`board-report.md` gets `board-report.pdf`). A whole project goes into a folder of its own. - **PDF on every plan, with your branding.** Every plan can use its own logo, brand color, font and presets. On Free, exports end with a "Made with OpenDocs" footer, even if the workspace kept its own footer from an earlier paid plan; that footer is saved and applies again when you upgrade. - **Word (.docx) on Pro and Team.** - **The same content as the page.** Tables, alerts, math, code, images, footnotes and signature blocks all come through. See [Markdown that renders](./rendering-and-metadata.md). - **Optional landscape pages** for wide tables. To file exports in Google Drive instead of your folder, ask your agent to save the document to one of your workspace's Drive folders. See [Google Drive](../integrations/google-drive.md). ### The export theme The theme belongs to the workspace and applies to every PDF and Word export in it, whoever makes it. Owners and admins can change it on any plan, in the dashboard under **Settings → Export branding** or through their agent; only the footer needs Pro or Team. Your agent proposes a preset (or a color and font) and waits for your OK before changing it. **Download sample PDF** in the same section shows how your exports look with the current settings. ## Presets Each preset is a tested color and font pairing: | Preset | Brand color | Font | Good for | | --- | --- | --- | --- | | `classic` | `#2E1C5C` purple | Arial | The OpenDocs house style | | `boardroom` | `#13294B` navy | IBM Plex Sans | Board updates, investor memos, policies | | `editorial` | `#6E1F2A` oxblood | Vollkorn | Essays and long reports | | `research` | `#1F4D3A` forest green | Merriweather | Whitepapers, studies, technical reports | | `studio` | `#1F2328` graphite | Inter | Product specs, design docs, release notes | | `field-guide` | `#0F4C5C` deep teal | Lato | Handbooks, onboarding, how-to guides | | `letterpress` | `#7C2D12` rust | EB Garamond | Proposals, letters, formal reports | | `terminal` | `#1E40AF` cobalt | JetBrains Mono | Changelogs, runbooks, incident reviews | | `launch` | `#86198F` fuchsia | Manrope | Launch briefs, one-pagers, announcements | ## Fonts | Font | Style | Good for | | --- | --- | --- | | Arial | Neutral sans (default) | Anything | | Inter | Modern sans | Specs, design docs | | IBM Plex Sans | Corporate sans | Board updates, memos, policies | | Lato | Warm humanist sans | Handbooks, how-to guides | | Roboto | Familiar neutral sans | Reports and documents of any kind | | Manrope | Modern grotesque | Launch briefs, one-pagers | | Merriweather | Sturdy serif | Whitepapers, studies | | Vollkorn | Editorial serif | Essays, long reports | | EB Garamond | Classic Garamond serif | Proposals, letters, formal reports | | JetBrains Mono | Monospace | Changelogs, runbooks, incident reviews | Serifs suit long, reading-heavy documents; sans fonts suit specs, memos and handbooks. With JetBrains Mono, code blocks use it too. ## The brand color must be dark The converter uses the brand color for headings, links, the table-header background (with white text on it) and the footer's first line. A light wash of it tints alternating table rows and code blocks. Body text is always near-black (`#171717`) and can't be changed. - The color needs at least **4.5:1** contrast against white. Lighter colors are refused with [`low_contrast`](../errors.md#low-contrast). - Aim for **7:1** or more for long documents. Every preset is above 8:1. - Use the deepest usable shade of your brand's hue: a navy instead of a bright blue, a forest green instead of a lime. Pastel, neon, yellow and light grey don't work. ## Logo and footer When it's turned on, the logo sits in the top-right corner of every page. It also appears on your workspace page. Use a PNG, JPEG or WebP up to 2 MB; a square or wide PNG with a transparent background works best. The footer has up to three parts: a company name (the workspace name by default), a tagline and a link. It can be turned off. ## Under the hood ### Export commands ```bash opendocs publish board-report.md --export pdf --json # publish, then write board-report.pdf opendocs export board-report -f pdf # an existing document → ./board-report.pdf opendocs export board-report -f docx -o exports/ opendocs export q3-update q2-update q1-update -f pdf -o ./investor-pdfs opendocs export --project investors -f pdf # → ./investors-pdf/ ``` | `opendocs export` flag | Meaning | | --- | --- | | `-f, --format <format>` | `pdf` or `docx`. The default is `pdf`. | | `-o, --output <path>` | A file for one document (an existing folder or a path ending in `/` gets `<slug>.<ext>` inside it); a folder for several. | | `--project <slug>` | Every document in a project, in batches of 10. Default folder `./<project>-<format>`. | | `--stdout` | Write the file to stdout. One document only. | | `--landscape` | Landscape pages. | | `--accent-color <hex>` | Brand color for this export only. | - One command takes up to 10 documents; more fail with `too_many_posts` before any request. `--project` has no such limit. - Batch exports, which `opendocs export` uses for several documents or `--project` and `publish --export` uses for files it updated, include any document you can read, teammates' included. One you can't read comes back as `not_found` in the results. - Each export is cached by its content and theme, so exporting an unchanged document again is fast. - `docx` on Free fails with `docx_requires_pro`. - Rate limits: 120 exports and 30 batch exports a minute, at most 4 running at once per account. The CLI waits and retries on `429`. `publish --export` details, including re-exporting a folder after edits, are in [Publish a document](./publish.md#publish-and-export-together). The endpoints are in the [Exports API](../api-reference/exports.md). ### Theme commands Reading the theme works for any member: ```bash opendocs theme --json # current color, font, preset, logo, footer, canEdit opendocs theme presets --json opendocs theme fonts --json opendocs theme check "#0B3D5C" # contrast against white; changes nothing ``` Changing it is for owners and admins, on any plan; `theme footer` needs Pro or Team. Outside a terminal, `set`, `footer` and `logo` refuse with `confirm_required` unless you pass `--yes`, so your agent asks you first: ```bash opendocs theme set --preset boardroom --yes --json opendocs theme set --color "#0B3D5C" --font "IBM Plex Sans" --yes --json opendocs theme logo ./halvard-logo.png --yes opendocs theme set --logo-in-exports on --yes opendocs theme footer --company "Halvard" --tagline "Investor relations" \ --link-url halvard.example --link-label halvard.example --yes opendocs theme footer --off --yes opendocs theme logo --remove --yes ``` | `theme set` flag | Meaning | | --- | --- | | `--preset <id>` | Apply a preset's color and font. | | `--color <hex>` | Brand color, at least 4.5:1 on white. | | `--font <name>` | One of the 10 fonts. | | `--logo-in-exports on\|off` | Show the workspace logo in exports. | | `--allow-low-contrast` | Save a color below 4.5:1 anyway. Not recommended. | `theme footer` takes `--company`, `--tagline`, `--link-url`, `--link-label`, `--on` and `--off`. After a change, export one document as a preview: ```bash opendocs export board-report -f pdf ``` Errors: `forbidden` (members can't change the theme), `plan_required` (a footer change on Free), `low_contrast`, `invalid_preset`, `invalid_font`. The API behind these commands is [`GET` and `PATCH /api/v1/workspace/branding`](../api-reference/agent-endpoints.md#export-theme). ## Related pages - [Publish a document](./publish.md) - [Markdown that renders](./rendering-and-metadata.md) - [Google Drive](../integrations/google-drive.md) - [Plans and limits](../getting-started/plans-and-limits.md) --- URL: https://docs.opendocs.cc/publishing/rendering-and-metadata # Markdown that renders OpenDocs reads GitHub-flavored Markdown plus a few additions, and the page, the PDF and the Word file all follow the same rules, so a document looks the same wherever it's read. Your agent knows this syntax; you can ask for the result. > **Ask your agent** > > "Add a warning callout above the pricing table saying the numbers are estimates." > > "Add signature lines for Dana and the Northwind contact at the end of the agreement." ## What renders | Feature | How to write it | | --- | --- | | Headings, bold, italic, links, lists, blockquotes, horizontal rules | Standard Markdown | | Strikethrough | `~~old price~~` | | Tables, with column alignment | GitHub tables (`\|---:\|` aligns right) | | Task lists | `- [ ] Draft` and `- [x] Review` | | Footnotes | `Revenue grew 18%.[^1]` and `[^1]: Unaudited.` | | Code with syntax highlighting | Fenced blocks with a language: ` ```python ` | | Alerts | `> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]` on the first line of a blockquote | | Math (KaTeX) | `$E = mc^2$` inline, `$$...$$` as a block, or a paragraph of `formula(...)` | | Highlight, subscript, superscript | `==key figure==`, `H~2~O`, `x^2^` | | Definition lists | A term on one line, `: Its definition` on the next | | Abbreviations | `*[ARR]: Annual recurring revenue` anywhere; on the page, hovering `ARR` shows it | | Emoji shortcodes | `:white_check_mark:` | | Smart punctuation | Straight quotes become curly; `--` is an en dash, `---` an em dash | | Images and figures | `![Revenue by quarter](./revenue.png "Revenue by quarter")`. An image alone in a paragraph becomes a figure, captioned by its title or by an italic line right below it. | | A metadata line | `Author: Dana \| Status: Draft` near the title is styled as quiet metadata | | Page breaks | `\pagebreak` or `<!-- pagebreak -->` on its own line. In exports, a new page starts there. | | Signature blocks | A ` ```signature ` fence. See [Signature blocks](#signature-blocks). | | Private notes | A ` ```private ` fence. See [Private blocks](#private-blocks). | A `$` followed by a digit stays a dollar sign, so "$5 and $10" isn't read as math. ### What doesn't render - **Mermaid and other diagram code** shows as a code block, not a diagram. Export the diagram as an SVG or PNG and include it as an image; SVGs stay sharp in PDFs. - **Scripts, styles, iframes and event handlers** in raw HTML are removed. Raw HTML can use formatting tags such as `<sub>`, `<sup>`, `<kbd>`, `<mark>`, `<details>` and `<img>`. - **Front matter** isn't shown. Only its `title` is used. ### On the page - The title from the file is shown above the document, so its leading `# Title` isn't repeated in the body. - Every heading gets an anchor link (`¶`), and the headings form the table of contents. - Code blocks use a light GitHub color theme. ### In PDF and Word exports Exports render the same syntax. A few differences: - Images can be PNG, JPEG, GIF, WebP or SVG. SVGs are drawn sharp for print. Each image keeps its own size, scaled down only when it's wider than the page. - Math becomes native equations in Word. - Raw HTML is reduced to its text and inline formatting; `<img>` tags are kept. - The export theme sets the heading, link and table colors and the font. See [PDF, Word and branding](./branded-exports.md). ### Improvements reach old documents When the renderer learns new syntax, documents published earlier are re-rendered from their stored Markdown the next time they're opened. That doesn't create a version or change the document's updated date. ## Signature blocks A `signature` fence lists who signs. On the page and in PDF and Word exports, each entry is drawn as a signing box: a line to sign on, the name, title and role, and a date line. ````md ```signature - role: Halvard name: Dana title: Chief Operating Officer - role: Client name: Ines Moreau title: Head of Operations, Northwind ``` ```` `role` is required and must be unique in the block; `name` and `title` are optional. A block that breaks the rules renders as an ordinary code block. When the document is sent for signing through DocuSeal, each box gets that signer's signature and date fields. The full rules are in [Mark where people sign](../integrations/docuseal.md#mark-where-people-sign). ## Private blocks A `private` fence is left out of the page, PDF and Word exports, files saved to Google Drive, the Markdown download on the page, the workspace's Markdown ZIP and workspace search, so you can keep working notes in the source file: ````md ```private Numbers still need sign-off from finance. ``` ```` The fence can be three or more backticks or tildes (`~~~private` works too), and it ends at a closing fence of the same kind. A private fence that's never closed hides everything after it. A `private` fence shown inside another code block, as an example, is left alone. :::note Who still sees it The block stays in the stored Markdown. You and members of the document's workspace, who can edit it, get it back with `opendocs pull` and the API's raw Markdown routes. Guests it's shared with and public readers never see it. Keep anything your teammates shouldn't read out of the document. ::: ## Titles, summaries and tags - **Title:** the front matter `title`, else the first `# Heading`, else "Untitled document". `--title` on publish overrides both. Up to 255 characters. - **Slug:** made from the title unless `--slug` is given. See [Publish a document](./publish.md#titles-and-slugs). - **Summary:** the first paragraph of prose, skipping headings, tables, code, blockquotes, images and HTML, up to 280 characters. It's used on the workspace page, in lists and in link previews. - **Tags:** up to 20 per document, 64 characters each, stored lowercase without duplicates. The CLI takes them comma-separated (`--tags board,finance`); the API takes an array. ## Safe rendering Rendered HTML is sanitized with GitHub's rules plus the elements OpenDocs's syntax adds. Front matter is read as data and never run. ## Related pages - [Publish a document](./publish.md) - [PDF, Word and branding](./branded-exports.md) - [E-signatures](../integrations/docuseal.md) --- URL: https://docs.opendocs.cc/visibility/overview # Who can see a document Publishing a document doesn't make it public. Every document has one of three visibility levels, and the default keeps it inside your workspace. > **Ask your agent** > > "Keep the salary bands private to me." > > "Who can see the Q3 investor update?" > > "Make the v2.4 changelog public." ## The three levels | Visibility | Who can open it | Use it for | | --- | --- | --- | | `workspace` (default) | Active members of the workspace | Specs, plans, runbooks, anything for the team | | `private` | Only you, the author. Owners and admins can't open it either. | Drafts and personal notes | | `public` | Anyone with the link, once the workspace owner allows public documents | Changelogs, public guides, anything for the open web | On top of any level, you can share one document with specific email addresses or a whole email domain. Those people can read that document without joining the workspace. This is usually the right choice for clients, investors and contractors. See [Share with people](./sharing-and-anonymous-links.md). Comments on a document are for the people working on it: members of the workspace can leave them, and members and the people it's shared with can read them. Readers of a public document see the document without its comments. ## What your agent does - **Uses `workspace` unless you say otherwise.** "For the team" needs nothing extra. "Just for me" makes it private. - **Asks before anything public.** Making a document public is the one change your agent always confirms with you first, and the CLI and API refuse it without an explicit confirmation. See [Public documents](./public-sharing.md). - **Prefers sharing over public** when you name people or a company outside the workspace. Changing visibility later keeps the link and the version history; it doesn't create a new version. The author, owners and admins can change it; see [Who can do what](./workspaces-and-team-access.md#who-can-do-what). ## Under the hood Set it when publishing: ```bash opendocs publish salary-bands.md --visibility private opendocs publish changelog.md --visibility public --confirm-public ``` Change it later, without re-uploading the Markdown: ```bash opendocs visibility salary-bands private opendocs visibility changelog public --confirm-public ``` - The levels are `private`, `workspace` and `public`. New documents default to `workspace`. - Moving to `public` needs `--confirm-public` (CLI) or `"confirmPublic": true` (API). The CLI fails with `confirm_public_required` before sending anything. - `opendocs update --visibility <level>` changes it together with the content. Without `--visibility`, updates keep the current level. - Unpublished documents can't change visibility. The endpoint is [`POST /api/v1/posts/:postId/visibility`](../api-reference/post-mutations.md#post-apiv1postspostidvisibility). ## Related pages - [Share with people](./sharing-and-anonymous-links.md) - [Public documents](./public-sharing.md) - [Workspaces and teams](./workspaces-and-team-access.md) --- URL: https://docs.opendocs.cc/visibility/sharing-and-anonymous-links # Share with people Share a document with one person, or everyone at a company, without adding them to your workspace or making the document public. It's the right way to send a proposal to a client, a report to investors or a brief to a contractor. > **Ask your agent** > > "Share the Northwind proposal with ines@northwind.example." > > "Let anyone at northwind.example read the proposal." > > "Who has access to the Q3 investor update?" ## What happens - **People you name get an email** with the link. Your agent can skip the email if you'd rather send the link yourself. - **They sign in with that address to read it.** OpenDocs checks the address is theirs with an emailed code (signing in with Google or GitHub also counts). No password, no workspace to join. - **They see only what you shared.** Guests can read the shared documents and nothing else in the workspace, and they don't take up a member seat. - **A domain lets in the whole company.** Sharing with `northwind.example` lets anyone with a verified address there read the document. Use a company's own domain, never a public mail provider such as `gmail.com`. - **It works at any visibility.** A `private` document shared with Ines stays hidden from your workspace but opens for her. - **Private notes stay out.** Guests don't see [`private` blocks](../publishing/rendering-and-metadata.md#private-blocks), on the page or in the Markdown they download. - **You can see and undo it.** Ask who has access, or to stop sharing with someone. Sharing is for the document's author, owners and admins. ## Anonymous links Without an account, your agent can still publish a link that works for 24 hours, for example on the first try before you sign up. Your agent asks before doing this, because anyone with the link can read it. > **Ask your agent** > > "Give me a link to these meeting notes without signing up." - **Anyone with the link can read it for 24 hours.** Then it's deleted. - **You also get a claim link.** Open it and sign in, and the document moves into your workspace as a normal document with `workspace` visibility and a link in your workspace. The anonymous link stops working. - **Signing up from the same folder keeps it automatically.** When your agent runs `opendocs login --email <you>` in the folder it published from, the anonymous documents are claimed into your new workspace. - **Limits:** up to 512 KB of Markdown per document, no image uploads, and a banner saying it was shared anonymously. Anonymous pages aren't indexed by search engines or listed anywhere. ## Under the hood ### Sharing ```bash opendocs share northwind-proposal ines@northwind.example # emails Ines a link opendocs share northwind-proposal @northwind.example --no-notify opendocs share northwind-proposal # list who has access opendocs share northwind-proposal ines@northwind.example --remove ``` - `<doc>` is a post ID, a slug, or a local `.md` file this folder published. - People are emails or domains, space- or comma-separated. `@northwind.example` and `northwind.example` both mean the domain. - `--no-notify` skips the email. Domains are never emailed. - Up to 50 emails and 20 domains per request. - The result has the `url` to send, the `emails` and `domains` with access, and `notified`, the addresses that were emailed. The endpoints are `GET`, `POST` and `DELETE /api/v1/posts/:postId/share`, with a body of `{ "emails": [...], "domains": [...] }` (plus `"notify": false` on `POST` to skip emails). See [Agent endpoints](../api-reference/agent-endpoints.md#sharing-with-people-outside-the-workspace). ### Anonymous publishing ```bash opendocs publish meeting-notes.md --anonymous --json ``` ```json { "anonymous": true, "total": 1, "succeeded": 1, "failed": 0, "results": [ { "file": "meeting-notes.md", "success": true, "action": "created", "url": "https://opendocs.cc/a/...", "claimUrl": "https://opendocs.cc/claim/...", "expiresAt": "2026-10-26T10:12:00.000Z" } ] } ``` - Give the person the `claimUrl` exactly as returned. - Up to 10 files per run. `--visibility`, `--tags`, `--project` and `--export` are ignored. Local images aren't uploaded. - Publishing the same file again with `--anonymous` updates the same link without extending the 24 hours. - The claim token is kept in `.opendocs/state.json`, which is why that folder is git-ignored. - `opendocs claim` claims everything this folder published anonymously into the active workspace and project; `opendocs claim <claim URL>` claims one. `--visibility private` keeps it to yourself. Claimed documents count toward the Free plan's 50. - Anonymous publishing is limited to 20 documents an hour and 50 a day per IP address. - Readers can report an anonymous page. Once readers at 3 different addresses have reported it, it's hidden until we've reviewed it. The endpoints are under [Anonymous documents](../api-reference/agent-endpoints.md#anonymous-documents-no-api-key). ## Related pages - [Who can see a document](./overview.md) - [Public documents](./public-sharing.md) - [Workspaces and teams](./workspaces-and-team-access.md) --- URL: https://docs.opendocs.cc/visibility/public-sharing # Public documents A public document can be read by anyone who has the link, without an OpenDocs account. Use it for things meant for the open web: a changelog, a public guide, a status page. To send a document to a client or investor, sharing it with their email is usually better. See [Share with people](./sharing-and-anonymous-links.md). > **Ask your agent** > > "Make the v2.4 changelog public." > > "Publish the API migration guide publicly so customers can read it." ## What happens Two things have to be true before someone outside the workspace can read a document: 1. **The document is public.** Your agent asks you before making it public, every time, and the CLI and API refuse without an explicit confirmation. 2. **The workspace allows public documents.** This is the **Allow public posts** setting in the dashboard, under **Settings → Sharing**. It's off in new workspaces, and only the workspace owner can change it. While the setting is off, a public document behaves like a `workspace` one: members can read it and nobody else can. The dashboard marks it with an amber dot. Your agent can't see or change the setting, so if a public link doesn't open for people outside, check it in the dashboard. When the setting is on: - Public documents open for anyone with the link, at the usual address: `opendocs.cc/halvard/changelog-v2-4`, or `opendocs.cc/halvard/projects/product/changelog-v2-4` in a project. - Your workspace page, `opendocs.cc/halvard`, becomes visible to anyone and lists the public documents. - Search engines aren't blocked from public pages. Treat a public link as published on the web. - On Pro and Team, public documents can live on your own domain instead, such as `notes.halvard.example/changelog-v2-4`, and the opendocs.cc links redirect there. See [Custom domains](../publishing/custom-domains.md). Readers can also download the document's Markdown from the page, without its `private` blocks. See [Private blocks](../publishing/rendering-and-metadata.md#private-blocks). ## Before you make something public - Remove internal notes, or move them into `private` blocks. - Check the title, tags and summary read well to outsiders. - Make sure the workspace slug in the URL is the one you want. Changing it later breaks every link to the workspace's documents; old slugs don't redirect. ## When not to use public These are better served by `workspace`, the default, or by sharing: - "Share this with my team." - "Let the other workspace members review it." - "Send it to the Northwind team." - "Keep it internal but linkable." ## Under the hood ```bash opendocs publish changelog-v2-4.md --visibility public --confirm-public opendocs visibility changelog-v2-4 public --confirm-public opendocs update changelog-v2-4.md --post-id changelog-v2-4 --visibility public --confirm-public ``` The API takes the same confirmation in the request body: ```json { "visibility": "public", "confirmPublic": true } ``` - Without it, the CLI fails with `confirm_public_required` before sending anything. The API answers `400`: `invalid_request` from publish and update, `visibility_change_failed` from the visibility endpoint. - A public document in a workspace that doesn't allow public documents is accepted, but nobody outside can read it until the owner turns the setting on. - The setting is changed in the dashboard only. There's no CLI command or API-key endpoint for it. - `opendocs whoami` shows the workspace slug used in URLs. See [Usernames and workspace slugs](../api-reference/usernames.md) for how it differs from your username. ## Related pages - [Who can see a document](./overview.md) - [Share with people](./sharing-and-anonymous-links.md) - [Workspaces and teams](./workspaces-and-team-access.md) - [Custom domains](../publishing/custom-domains.md) --- URL: https://docs.opendocs.cc/publishing/custom-domains # Custom domains On Pro and Team, a workspace can serve its documents on a domain you own: `notes.halvard.example/q3-plan` instead of `opendocs.cc/halvard/q3-plan`. The workspace page, projects, tag pages and documents all move there, over HTTPS, and the opendocs.cc links keep working by redirecting to the new address. > **Ask your agent** > > "Give me the link to the Q3 plan." (Agents use the custom-domain link once > it's active.) > > "Publish the changelog publicly and link it from the README." ## What you need - **A Pro or Team workspace.** What counts is the workspace's plan: the owner's Pro or Team plan, or Founder or Creator access, which count as Pro and Team. On Free, the setting shows a Pro badge. - **A subdomain you can add DNS records to,** such as `notes.halvard.example` or `docs.halvard.example`. One per workspace. Root domains (`halvard.example`) aren't supported: the connection is a CNAME record, which root domains can't have at most providers. - **The owner or an admin** sets it up. Members can see the domain and its status but not change it. ## Set it up 1. In the dashboard, open **Workspace settings** and find **Custom domain**. 2. Enter the domain, for example `notes.halvard.example`, and save. Paste a full URL if you like; OpenDocs keeps only the domain. 3. Add the two records the card shows at your DNS provider. Each has a copy button. | Type | Name | Value | | --- | --- | --- | | CNAME | `notes.halvard.example` | `custom.opendocs.cc` | | TXT | `_opendocs.notes.halvard.example` | `opendocs-verify=<your token>` | The CNAME sends readers to OpenDocs. The TXT record proves the domain is yours; the token is different for every workspace and domain. **Keep both records** once the domain is active: OpenDocs checks them every 6 hours, and a domain whose records fail three checks in a row stops serving. 4. Wait for the status to turn **Active**, or click **Check now**. DNS changes usually show up within minutes, sometimes a few hours. 5. Click **Visit**. The first visit sets up the HTTPS certificate, which takes a few seconds. Not sure where your DNS is managed, or how to add records? While the domain waits for DNS, the card has **Copy prompt for your agent**: a prompt with your domain's records that you paste into Claude, ChatGPT or another agent. It finds your DNS provider and adds the records for you, or walks you through it. Saving the same domain again keeps its token, so the records stay valid. Entering a different domain replaces the old one, with a new token. ### Names at your DNS provider Some providers want the full name (`notes.halvard.example`), others only the part before your domain (`notes`, and `_opendocs.notes` for the TXT record). The card shows both. If a provider adds your domain to whatever you type, entering the full name gives you `notes.halvard.example.halvard.example`, and the check fails with "No CNAME record found". - **Cloudflare:** DNS, then Records, then Add record. Set **Proxy status** to **DNS only** (the grey cloud) on the CNAME. With the orange cloud, Cloudflare answers for the domain instead of OpenDocs, the certificate can't be issued, and the check says the domain is proxied by Cloudflare. Use `notes` and `_opendocs.notes` as the names. - **GoDaddy:** your domain's DNS page, then Add New Record. Names are relative: `notes` and `_opendocs.notes`. - **Namecheap:** Domain List, Manage, then Advanced DNS. Add a CNAME Record and a TXT Record with the hosts `notes` and `_opendocs.notes`. - **ISNIC (.is domains):** add the records wherever the domain's name servers are. If they're ISNIC's DNS service, that's ISNIC's zone editor; if your .is domain uses another provider's name servers, add them there. - **Anywhere else** (Route 53, Google Cloud DNS, your hosting company): the same two records. A trailing dot on the value (`custom.opendocs.cc.`) is fine. ## Status | Status | What it means | | --- | --- | | **Waiting for DNS** | The records aren't there yet, or not as shown. The card says which one. | | **Verifying** | The records check out. The HTTPS certificate is issued on the first visit, which takes a few seconds. | | **Active** | Readers get your documents on the domain. | | **Misconfigured** | The records were removed or changed, and the domain stopped serving. The card says which record and since when. | | **Paused** | The workspace isn't on Pro or Team any more. Readers are sent to opendocs.cc until it is. | OpenDocs re-checks every domain every 6 hours. If an active domain fails three checks in a row, it stops serving, its status becomes **Misconfigured** and the workspace owner gets an email. Fixing the records brings it back by itself at the next check, or straight away with **Check now**. A failed **Check now** on an active domain shows the problem but doesn't count toward the three, and neither does a lookup that timed out. ## What readers see | On the custom domain | Shows | Same as | | --- | --- | --- | | `/` | The workspace page | `opendocs.cc/halvard` | | `/q3-plan` | A document in the Default project | `opendocs.cc/halvard/q3-plan` | | `/projects/launch` | A project page | `opendocs.cc/halvard/projects/launch` | | `/projects/launch/q3-plan` | A document in a project | `opendocs.cc/halvard/projects/launch/q3-plan` | | `/tag/finance` | A tag page | `opendocs.cc/halvard/tag/finance` | | `/projects/launch/tag/finance` | A project's tag page | `opendocs.cc/halvard/projects/launch/tag/finance` | - **Your workspace's header, white-label if you like.** Pages show your logo and workspace name instead of the OpenDocs header. The only mention of OpenDocs is one "Published with OpenDocs" line in the footer, which you can turn off under **Show "Published with OpenDocs"** in the Custom domain card. Every link on the page (breadcrumbs, related documents, tags, search) stays on your domain. - **One address per page.** On opendocs.cc, every page of the workspace redirects (308) to the same page on the custom domain, public or not, and canonical URLs, Open Graph and structured data name the custom domain, so search engines see one URL per document. (A document whose slug is an app path such as `login` or `dashboard` stays on opendocs.cc.) - **Its own sitemap and robots.txt.** `/sitemap.xml` lists the workspace's public pages on your domain, and `/robots.txt` points to it. A workspace with no public documents gets a `robots.txt` that disallows everything and an empty sitemap. The opendocs.cc sitemap leaves the workspace out. - **Downloads.** PDF, Word and Markdown downloads work on the domain, for public documents and for signed-in readers' private ones. - **No tracking.** Custom domains load no OpenDocs analytics, no ad pixels and no cookie banner. - **App pages stay on OpenDocs.** Paths such as `/dashboard`, `/login` and `/signup` go to opendocs.cc. A page that doesn't exist shows your workspace's "not found" page. - **Slug changes are safe.** The domain belongs to the workspace, not its slug, so renaming the workspace's slug doesn't break it. ### Links from OpenDocs Once the domain is active, OpenDocs hands out custom-domain links for every published document, public or not: the dashboard (the workspace card, **View** and **Copy link**), the CLI (0.4.9 and later), and the `publicUrl` field in API responses (see [Under the hood](#under-the-hood)). Older CLI versions and old links point to opendocs.cc, which redirects. ## Private documents and sign-in Documents that aren't public (workspace-only, private, or shared with specific people) work on the custom domain too, for people who may read them: 1. A reader opens `notes.halvard.example/board-minutes`. 2. The domain quietly checks with opendocs.cc whether they're signed in. Members of your workspace who already are come straight back signed in, without seeing a sign-in page. Everyone else is back a moment later on a "this page is private" page with a **Sign in** button: nobody is asked to sign in or sign up unless they choose to. 3. **Sign in** goes to opendocs.cc. Members of your workspace then come straight back. Anyone else, such as someone a document was shared with, clicks **Continue as their@email** first, because your workspace will see their name, email address and profile picture. 4. Someone signed in with an account that's neither a member nor has anything shared with it on your domain stops on opendocs.cc ("This account doesn't have access"), with **Use another account**. Your domain never learns who they are. 5. Back on the custom domain they're signed in on that domain only, and the document opens if they have access to it. Without access they see a "you don't have access" page, as on opendocs.cc. - The sign-in lasts 7 days, and ends when they sign out of opendocs.cc. **Sign out** in the account menu on the custom domain signs them out of OpenDocs: on the domain and on opendocs.cc. - On the custom domain readers can read, comment and download. Everything else (editing, settings) happens on opendocs.cc; **OpenDocs dashboard** in the account menu opens the dashboard on this workspace. - The opendocs.cc sign-in never reaches your domain, and the custom-domain sign-in never reaches opendocs.cc or another custom domain. ## Downgrading and removing - **Downgrade to Free:** the domain is kept but paused. Readers who open it are redirected (302) to the same page on opendocs.cc, and opendocs.cc stops redirecting to it. Upgrading again restores it, with nothing to set up. - **Remove the domain:** **Remove** in the card, after a confirmation. opendocs.cc stops redirecting at once and serves the workspace as before, links point to opendocs.cc again, and sign-ins on the domain end. The domain itself stops serving within a minute. You can delete the DNS records afterwards. - **Deleted the DNS records first?** The next check (within 6 hours, or **Check now**) notices the CNAME is gone, and from then on opendocs.cc serves the workspace again instead of redirecting to the domain. Remove the domain in the card to finish; otherwise it turns **Misconfigured** after three checks and the owner gets an email. ## Under the hood The dashboard card uses these endpoints. They accept a session or an API key (`Authorization: Bearer od_live_...`), so agents and scripts can manage the domain too. | Endpoint | Who | What | | --- | --- | --- | | `GET /api/v1/workspace/domain?workspaceId=` | Members | The domain, its status, the records to add and the last error | | `PUT /api/v1/workspace/domain` | Owners and admins, Pro or Team | Connect or replace the domain. Body: `{ "workspaceId", "hostname" }` | | `POST /api/v1/workspace/domain/check` | Owners and admins | Check the records now. Body: `{ "workspaceId" }`. 12 a minute | | `PATCH /api/v1/workspace/domain` | Owners and admins, Pro or Team | Settings. Body: `{ "workspaceId", "showPoweredBy": false }` hides "Published with OpenDocs" | | `DELETE /api/v1/workspace/domain?workspaceId=` | Owners and admins | Remove the domain | ```bash curl https://api.opendocs.cc/api/v1/workspace/domain \ -X PUT \ -H "Authorization: Bearer od_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "ws_123", "hostname": "notes.halvard.example" }' ``` The response describes the domain, with `state` as the dashboard shows it (`pending`, `verifying`, `active`, `misconfigured` or `paused`). The full shape is in the [Workspaces API](/api-reference/workspaces#custom-domain). Errors follow the usual `{ "error", "message", "docs_url" }` shape: `plan_required` on Free, `invalid_hostname` for a name OpenDocs can't serve, `domain_taken` when another workspace has the domain active, and `forbidden` for members. See [Error codes](/errors). ### `publicUrl` Every API response that returns a document's `url` (publish, batch publish, update, get, list, move, visibility, claim) also returns `publicUrl`, the absolute link to share. It's the custom-domain URL when the domain is active and the document is published (whatever its visibility), and the opendocs.cc URL otherwise: ```json { "url": "/halvard/q3-plan", "publicUrl": "https://notes.halvard.example/q3-plan" } ``` Share `publicUrl`, and use it when one document links to another, so readers stay on your domain. ## Troubleshooting - **"No TXT record found at _opendocs..."** The TXT record is missing or under another name. Check the name doesn't end in your domain twice (see [Names at your DNS provider](#names-at-your-dns-provider)). - **"The TXT record ... has a different verification value."** It's from an earlier attempt. Replace the value with the one in the card. - **"... points to ..., not custom.opendocs.cc."** The CNAME points somewhere else, or the name has A records instead. Change it to a CNAME to `custom.opendocs.cc`, and remove any A or AAAA records for the name. - **"Use a subdomain such as notes.halvard.example."** Root domains aren't supported. Connect a subdomain instead. - **"... is proxied by Cloudflare."** Turn the record's proxy off (grey cloud, DNS only). - **Still waiting after you added everything.** DNS changes can take a while to spread, longer if the record existed before with a long TTL. Click **Check now** later; OpenDocs also checks every 6 hours on its own. - **"... is connected to another OpenDocs workspace."** Remove it there first. If the other workspace is no longer yours to change, replace its `opendocs-verify` TXT value with yours; once its checks fail, the domain can be connected here. While another workspace's value is still in the TXT record, the check says so. - **The first visit shows a certificate warning or takes a moment.** The certificate is issued on the first visit after the domain turns active. Wait a few seconds and reload. - **"This domain isn't connected to OpenDocs."** The domain points to OpenDocs but isn't active for any workspace: it's still waiting for its TXT record, it's misconfigured, or it was removed. ## Related pages - [Public documents](../visibility/public-sharing.md) - [Workspaces and teams](../visibility/workspaces-and-team-access.md) - [Plans and limits](../getting-started/plans-and-limits.md) - [Workspaces API](/api-reference/workspaces#custom-domain) --- URL: https://docs.opendocs.cc/visibility/workspaces-and-team-access # Workspaces and teams A workspace is where your team's documents live, at `opendocs.cc/<workspace>`. Everyone in it can read and edit the workspace's documents, and owners and admins look after people and settings. Your first workspace is created when you sign up. > **Ask your agent** > > "Invite Sam to our workspace as an admin." > > "Let anyone with a halvard.example email join the workspace." > > "Who's in the workspace, and are any invitations still pending?" ## What happens - **Invitations need a yes.** Inviting someone sends an email they accept, so nobody is added without confirming. Pending invitations count toward the workspace's member limit. - **Colleagues can join on their own.** With a company domain set up for auto-join, anyone who signs in with a verified address at that domain can join as a member. - **Members see the team's documents.** Every document with `workspace` (or `public`) visibility is open to every active member. `private` documents stay with their author. - **The workspace holds the settings** that apply to everyone's documents: whether public documents are allowed, the export theme, the Google Drive and e-signature integrations, and on Pro and Team a [custom domain](../publishing/custom-domains.md) such as `notes.halvard.example`. You can belong to several workspaces and switch between them. Member limits are 3 per workspace on Free, 5 on Pro and unlimited on Team; see [Plans and limits](../getting-started/plans-and-limits.md). ## Who can do what Every workspace has one owner. Other people are admins or members. | | Member | Admin | Owner | | --- | --- | --- | --- | | Read `workspace` and `public` documents | Yes | Yes | Yes | | Read a `private` document | Own only | Own only | Own only | | Publish documents and create projects | Yes | Yes | Yes | | Edit any document: update, change tags, restore a version | Yes | Yes | Yes | | Export any document they can read, one or several at once | Yes | Yes | Yes | | Manage a document: visibility, move, share, unpublish, delete | Own only | Any | Any | | Rename or delete projects | No | Yes | Yes | | Invite people, set roles, remove members, set auto-join domains | No | Yes | Yes | | Change the export theme (the footer needs Pro or Team) | No | Yes | Yes | | Connect or remove the custom domain (Pro and Team) | No | Yes | Yes | | Turn on **Allow public posts**, set the default sort | No | No | Yes | - Admins can make a member an admin. Only the owner can demote or remove an admin. The owner's role can't be changed, and the owner can't leave the workspace. - The version history records who made each edit, so open editing stays accountable. See [Updates and versions](../publishing/update-and-version-history.md). - Who can use Google Drive and e-signatures is a workspace setting: every member by default, or admins only. See [Google Drive](../integrations/google-drive.md) and [E-signatures](../integrations/docuseal.md). - The rules are the same in the dashboard, the CLI and the API. A change your role doesn't allow is refused with `forbidden`. In the dashboard, the owner-only switches are shown disabled for everyone else. - Roles work on every plan. ## Under the hood ### Team ```bash opendocs team list # members, pending invitations, auto-join domains opendocs team invite sam@halvard.example --role admin opendocs team resend sam@halvard.example opendocs team revoke sam@halvard.example # cancel a pending invitation opendocs team role sam@halvard.example member opendocs team remove sam@halvard.example --yes opendocs team auto-join add halvard.example opendocs team auto-join remove halvard.example ``` - `--role` is `member` (default) or `admin`. `opendocs invite <emails...>` is a shortcut for `team invite`. - `team remove` and `team leave` need `--yes` outside a terminal. - Auto-join takes only the domain of your own verified email, and refuses consumer mail providers such as gmail.com and outlook.com. The person invited accepts from the email, or from their own agent once signed in with that address (`opendocs login` mentions pending invitations): ```bash opendocs team invitations # invitations, and workspaces your email domain can join opendocs team join halvard # accept and switch to it opendocs team join halvard --no-switch opendocs team decline halvard opendocs team leave --yes ``` Accepting from the CLI and auto-join need a verified email; signing in with an emailed code, Google or GitHub verifies it. The endpoints are in the [Team and invitations API](../api-reference/team-and-invitations.md): `POST /api/v1/workspace/team/invite`, `PATCH /api/v1/workspace/team/members/:memberId/role`, `DELETE /api/v1/workspace/team/members/:memberId`, and the invitation resend and cancel routes. ### Workspaces ```bash opendocs workspace list # every workspace you belong to opendocs workspace use halvard # switch; the active project resets to Default opendocs workspace create "Halvard Labs" --slug halvard-labs opendocs workspace members ``` `workspace create` switches to the new workspace unless you pass `--no-switch`. ### Workspace slugs and usernames Document URLs use the workspace slug (`opendocs.cc/halvard/...`); your personal profile uses your username (`opendocs.cc/@dana`). Changing a workspace slug breaks every existing link to its documents, because old slugs don't redirect. See [Usernames and workspace slugs](../api-reference/usernames.md) and the [Workspaces API](../api-reference/workspaces.md). A [custom domain](../publishing/custom-domains.md) keeps working through a slug change, because it's tied to the workspace rather than its slug. ## Related pages - [Who can see a document](./overview.md) - [Share with people](./sharing-and-anonymous-links.md) - [Custom domains](../publishing/custom-domains.md) - [Plans and limits](../getting-started/plans-and-limits.md) --- URL: https://docs.opendocs.cc/integrations/google-drive # Google Drive Connect Google Drive to your workspace once, name the folders people should save into, and from then on your agent can file any document there as a PDF, Word file or Markdown. Signed contracts from [DocuSeal](./docuseal.md) can be filed automatically. Nothing is saved to Drive unless someone asks. > **Ask your agent** > > "Save the board minutes to the Board Minutes folder as a PDF." > > "Put version 3 of the Halvard onboarding guide in HR Policies as a Word file, and call it Onboarding guide 2026." > > "Which Drive folders can you save to?" Google Drive is part of the Pro and Team plans. On Free, the dashboard's **Integrations** page shows an upgrade prompt and agents get `plan_required`. ## What you need - A workspace on Pro or Team. See [Plans and limits](../getting-started/plans-and-limits.md). - An owner or admin of the workspace to connect Drive and add folders. This is done once, in the dashboard; agents can't connect Drive or add folders. - A Google account that can add files to the folders you want to use: a Contributor or above on a shared drive, or someone who can edit the folder in My Drive. This one account is used for everyone in the workspace. ## Connect Google Drive 1. In the [dashboard](https://opendocs.cc/dashboard), open **Integrations** (under **Workspace** in the sidebar). 2. Under **Google Drive**, click **Connect Google Drive**. 3. Sign in with the Google account that can add files to your shared drives, and allow access. Leave the Drive permission ticked on Google's screen. 4. You're back on the Integrations page. The card says **Connected** and shows the account's email. ## Add and name folders Agents only see the folders you add here, by the names you give them. 1. Click **Add folder**. Google's folder picker opens, titled "Choose a folder for OpenDocs", with your shared drives and My Drive. 2. Pick a folder. 3. Type the name your agent should use, for example "Board Minutes". It starts as the folder's own name. Names can be up to 80 characters and must be unique in the workspace (ignoring case). 4. Click **Save**. Each folder in the list shows its name and where it lives (the shared drive or My Drive, then the folder). Use the pencil to rename it and the trash icon to remove it. Removing a folder only removes it from OpenDocs; nothing in Drive is touched. ## Who can use it Owners and admins connect Drive, add folders and change settings. Who can save documents is a workspace setting, under **Settings** on the Integrations page: | **Who can use integrations** | What it means | | --- | --- | | **Every member** (default) | Anyone in the workspace can save to folders and send for signature. | | **Owners and admins only** | Members can still read and publish documents, but saving to Drive returns `forbidden`. | Everyone in the workspace can open the Integrations page and see what's connected. To save a document you also need to be able to read it, the same rule as for exports. ## What lands in Drive - **A new file each time.** Saving again creates another file next to the first; nothing in Drive is overwritten or deleted. - **File name:** the document's title plus the extension, for example `Board minutes October 2026.pdf`, unless you ask for another name. The characters `\ / : * ? " < > |` become spaces, and names are cut at 180 characters. - **Format:** PDF unless you ask for Word (`.docx`) or Markdown (`.md`). PDF and Word files use your workspace's [export theme](../publishing/branded-exports.md), exactly like an export. Markdown is the document's source, with [`private` blocks](../publishing/rendering-and-metadata.md) removed. - **Version:** the latest version unless you ask for an earlier one by number ("version 3"). The file's Drive description says which document and version it came from: `Saved from OpenDocs: "Board minutes October 2026", version 3.` - **Stored as-is.** Files aren't converted to Google Docs, and Drive keeps their first revision permanently. - **Checked.** OpenDocs computes the file's SHA-256 before uploading and compares it with the checksum Google reports. Your agent tells you if they don't match. Your agent gives you a link to the new file in Drive. OpenDocs also records every save: who asked, through which agent, the document and version, the folder, and both checksums. ### Signed copies When a signature request finishes, OpenDocs can file the signed PDF and its audit log in a Drive folder for you, either automatically or when you ask. Both files are marked read-only in Drive. See [File signed copies in Google Drive](./docuseal.md#file-signed-copies-in-google-drive). ## Privacy - **OpenDocs only sees what it created and what you picked.** It connects with Google's `drive.file` permission, which covers files OpenDocs created and folders someone picked in the Google Picker. It can't browse, search or read anything else in your Drive. It also asks for your email address, to show which account is connected. - **Only on request.** Publishing or exporting never saves to Drive. A file is saved only when someone asks for it, or when a signature request was set up to file its signed copy. - **One account for the workspace.** Files are created by the connected Google account, whoever in the workspace asked for the save. - **Disconnecting** (**Disconnect**, then **Disconnect and forget folders**) revokes OpenDocs' access with Google and forgets the folder names. Files already saved stay in Drive. ## Under the hood Your agent uses two commands. `opendocs integrations` lists what's connected and the folder names; `opendocs save` saves one document. ```bash opendocs integrations --json opendocs save board-minutes.md --folder "Board Minutes" --json opendocs save halvard-onboarding-guide --folder "HR Policies" --format docx --version 3 --filename "Onboarding guide 2026" --json ``` `<doc>` is a post ID, a slug, or a local `.md` file this folder published. | Flag | Default | Notes | | --- | --- | --- | | `--folder <name>` | Required | A folder name exactly as `opendocs integrations` lists it (case doesn't matter). | | `--format <format>` | `pdf` | `pdf`, `docx` or `md`. | | `--version <n>` | Latest | Save an earlier version (`3` or `v3`). See `opendocs history`. | | `--filename <name>` | Document title | File name in Drive. A `.pdf`, `.docx` or `.md` ending is replaced with the right one. | Rules agents follow: save only when the user asks, use a folder name exactly as listed (never guess one), and give the user the Drive link on its own line. `opendocs integrations --json` (trimmed): ```json { "workspace": { "id": "…", "slug": "halvard", "name": "Halvard" }, "tier": "pro", "role": "member", "canManage": false, "canUse": true, "settings": { "usableBy": "members", "signatureConfirmation": "chat" }, "dashboardUrl": "https://opendocs.cc/dashboard/integrations", "integrations": [ { "provider": "google_drive", "name": "Google Drive", "status": "connected", "account": "dana@halvard.example", "connectedAt": "2026-10-20T09:14:02.000Z", "destinations": [ { "id": "…", "name": "Board Minutes", "folderName": "Board minutes", "driveName": "Halvard Leadership", "url": "https://drive.google.com/drive/folders/…" } ] } ] } ``` `status` is `connected`, `not_connected` or `error` (needs reconnecting; `error` then holds the reason). Agents use `destinations[].name` as `--folder`. `opendocs save --json`: ```json { "id": "…", "provider": "google_drive", "destination": { "id": "…", "name": "Board Minutes", "url": "https://drive.google.com/drive/folders/…" }, "document": { "id": "…", "slug": "board-minutes", "title": "Board minutes October 2026", "versionNumber": 3 }, "file": { "id": "…", "name": "Board minutes October 2026.pdf", "url": "https://drive.google.com/file/d/…/view", "bytes": 184320, "sha256": "9f2c…", "driveSha256": "9f2c…", "verified": true, "format": "pdf" } } ``` `verified` is `true` when Google's checksum matches `sha256` (or Google didn't report one; then `driveSha256` is `null`). The API behind it is `GET /api/v1/integrations?workspaceId=…` and `POST /api/v1/posts/{postIdOrSlug}/storage` with `{ "destination", "format", "versionNumber", "filename" }`. Saves count against the export rate limit (120 a minute). See [Integrations API](../api-reference/integrations.md). ## Troubleshooting | What you see | What to do | | --- | --- | | `plan_required`, or "Integrations are part of Pro and Team" | Upgrade the workspace at [opendocs.cc/dashboard/billing](https://opendocs.cc/dashboard/billing). | | `integration_not_connected` | Google Drive isn't connected to this workspace. An owner or admin connects it on the Integrations page. | | `destination_not_found` | There's no folder by that name. The error lists the folder names; ask your agent which folders exist, or have an admin add one. | | `forbidden` | The workspace lets only owners and admins use integrations. Ask one of them, or ask them to change the setting. | | `reconnect_required`, or **Needs reconnecting** in the dashboard | Google access was revoked or expired. An owner or admin clicks **Reconnect** and signs in with the same Google account, which keeps your folders. | | `destination_unavailable` | Google refused access to that folder: it was deleted or moved, or the connected account lost access. Remove the folder and add it again with **Add folder**. | | "can't add files to" a folder, when adding it | The connected account can only view that folder. Use a folder where it's a Contributor or above. | | "OpenDocs needs the Google Drive permission" | The Drive permission was unticked on Google's screen. Connect again and leave it ticked. | | "The Google sign-in expired or was started elsewhere" | The connection wasn't finished within 10 minutes, or started in another tab. Click **Connect Google Drive** again. | | `storage_failed` | Google Drive returned an error. Try again; the message has Google's reason. | | `export_failed` or `export_timeout` | The PDF or Word file couldn't be rendered, so nothing was uploaded. Try again in a minute. | | "Google Drive's checksum doesn't match" | The file in Drive may differ from what OpenDocs rendered. Open it in Drive to check, and save again if needed. | ## Related pages - [E-signatures with DocuSeal](./docuseal.md) - [Branded PDF and Word exports](../publishing/branded-exports.md) - [Plans and limits](../getting-started/plans-and-limits.md) - [CLI reference](../cli/reference.md) - [Integrations API](../api-reference/integrations.md) --- URL: https://docs.opendocs.cc/integrations/docuseal # E-signatures with DocuSeal Connect your workspace's DocuSeal account and your agent can send any document for signing: contracts, offer letters, board resolutions, policy sign-offs. DocuSeal emails the signers; the signed PDF and its audit log come back to OpenDocs, and can be filed in [Google Drive](./google-drive.md). Your agent always prepares a draft first, and nothing reaches a signer until you confirm it. > **Ask your agent** > > "Send the consulting agreement to John Adams, adams@company.example, for signing." > > "Send the board resolution to Dana (dana@halvard.example) and Sam (sam@halvard.example) at the same time, and file the signed copy in Signed Agreements." > > "Has John signed the consulting agreement yet?" E-signatures are part of the Pro and Team plans. On Free, agents get `plan_required`. ## What you need - A workspace on Pro or Team. See [Plans and limits](../getting-started/plans-and-limits.md). - Your own DocuSeal account with API access, on docuseal.com, docuseal.eu or a self-hosted instance. DocuSeal's API needs a DocuSeal Pro plan, and DocuSeal bills each document sent through it. Signers get their emails from DocuSeal. - An owner or admin of the workspace to connect it, once, in the dashboard. ## Connect DocuSeal 1. In the [dashboard](https://opendocs.cc/dashboard), open **Integrations** (under **Workspace** in the sidebar). 2. Under **DocuSeal**, pick the **Account region**: **docuseal.com**, **docuseal.eu**, or **Self-hosted**. For self-hosted, enter your **Instance address** (`https://sign.halvard.example`, for example). 3. Paste your **API key**. On docuseal.com it's at [console.docuseal.com/api](https://console.docuseal.com/api); on docuseal.eu at [console.docuseal.eu/api](https://console.docuseal.eu/api); self-hosted, in your instance's settings under API. 4. Click **Connect DocuSeal**. OpenDocs checks the key with DocuSeal before saving it, and stores it encrypted. The card then says **Connected**, with the account and region. ### Add the webhook (recommended) Once connected, the card shows a webhook address. With it, OpenDocs hears about each signature as it happens, and files signed copies as soon as the last person signs. 1. Copy the webhook URL from the DocuSeal card. 2. In DocuSeal, open **Webhooks**, add the URL, and select the form and submission events. 3. Copy the webhook's signing secret (it starts with `whsec_`) from DocuSeal, paste it into the field under the URL in OpenDocs, and click **Save**. Without the webhook, OpenDocs checks DocuSeal when someone looks at a request (your agent checking the status, or opening the request in the dashboard). A webhook only prompts OpenDocs to check: the status always comes from DocuSeal's API, so a forged webhook can't mark anything signed. The URL contains a secret token; keep it private. If you disconnect DocuSeal and connect it again, the URL changes, so update it in DocuSeal. ## Mark where people sign Add a `signature` block where the signatures go, usually at the end of the document. Each entry is one person: ````md ```signature - role: Consultant name: John Adams title: Principal, Adams Advisory - role: Halvard name: Dana title: Chief Operating Officer ``` ```` On the web and in PDF and Word exports, each entry is drawn as a signature box: a line to sign on, the name (or the role, if there's no name), the title, the role (when there's a name), and a date line. When the document is sent for signing, DocuSeal puts a signature field and a date field in each box, and fills in the date when that person signs. Normal exports don't carry those fields. The rules: - The fence's info string is `signature` and nothing else (any case). Three or more backticks or tildes both work. - Each entry starts with `- `. The keys are `role` (required), `name` and `title` (optional); keys are case-insensitive, other keys are ignored, and values can be quoted. - Each `role` must be unique in the block (ignoring case), at most 60 characters, and can't contain `;`, `{`, `}` or `=`. - A block that breaks these rules (a missing or repeated role, or text before the first `- `) is shown as an ordinary code block and isn't used for signing. - A role that appears in more than one block is the same person signing in more than one place. - No block? OpenDocs adds one at the end of the PDF it sends, one box per signer. Your published document isn't changed. When the document has a block, every role in it needs exactly one signer. Your agent matches each person you name to a role by the role or by the `name` in the block, and asks you when it can't tell. ## What happens when you ask 1. **Your agent prepares a draft.** Nothing is emailed. OpenDocs renders the PDF exactly as signers will get it and records its SHA-256 fingerprint, so what you approve is byte for byte what's sent. 2. **Your agent shows you the draft:** the document and version, each signer's name, email and role in signing order, whether they sign one after another or all at once, the email subject and message, the expiry date, where the signed copy will be filed, and any warnings, such as an email address outside your workspace's email domains. It can give you the PDF to read first. 3. **You confirm**, in one of two ways, depending on the workspace setting: - **In chat** (the default): you say yes, and your agent sends it. "Looks fine" or silence doesn't count. - **In the browser**: your agent gives you a link to the request in OpenDocs. You check the document and every name and email, tick the box, and click **Send to 1 signer** (or however many). Agents can't send in this mode. 4. **DocuSeal emails the signers**: the first signer, or everyone at once. 5. **When everyone has signed**, the signed PDF and audit log are ready, and filed in Google Drive if you asked for that. To change anything (a name, an email, the wording of the document), your agent cancels the draft and makes a new one. A draft keeps the exact PDF it was made from, so later edits to the document don't change it. You can also review drafts yourself in either mode. The **Signature requests** list on the Integrations page shows the latest 50 in the workspace; drafts are marked **Waiting for confirmation**. Open one to read the PDF (**Open PDF**), then send it or click **Discard draft**. ## Signing order | Order | What signers get | Ask for it | | --- | --- | --- | | One after another (default) | Each signer is emailed after the previous one has signed, in the order you named them. | "John first, then Dana." | | All at once | Everyone is emailed at the same time and can sign in any order. | "Send it to both at the same time." | ## Status, expiry and reminders Ask your agent where a request stands ("Has John signed yet?"). It checks DocuSeal and tells you who has signed. | Request status | In the dashboard | Meaning | | --- | --- | --- | | `draft` | Waiting for confirmation | Prepared, not sent. | | `pending` | Out for signature | Sent; waiting for at least one signer. | | `completed` | Signed | Everyone has signed. | | `declined` | Declined | A signer declined. Their reason is shown with their name. | | `expired` | Expired | The expiry date passed before everyone signed. | | `cancelled` | Cancelled | Cancelled in OpenDocs; signers can no longer open it. | Each signer also has a status: not sent, waiting for earlier signers, email sent, opened, signed (with the time), or declined. If sending fails, the request stays a draft and shows why ("The last attempt to send failed: …"). Fix the cause and confirm again. - **Expiry:** ask for a date ("it should expire on November 30"). The request expires at the end of that day (UTC); the date must be at least an hour away. Without one, the request has no expiry date. - **Reminders:** OpenDocs doesn't send reminder emails. If you want them, look at your DocuSeal account's settings. - **Cancelling:** "Cancel the signature request for the consulting agreement." Your agent checks with you first. A request that was already sent is archived in DocuSeal, so signers can no longer open it. A completed request can't be cancelled. ## Signed PDF and audit log > **Ask your agent** > > "Download the signed consulting agreement and its audit log." When everyone has signed, your agent can download the signed PDF, with every signature in it, and DocuSeal's audit log, the record of who signed and when. In the dashboard, open the request and click **Signed PDF** or **Audit log**. They're named after the document and version, like `Consulting agreement (v2) – signed.pdf` and `Consulting agreement (v2) – audit log.pdf`. OpenDocs fetches them from DocuSeal each time; after sending, it keeps only the SHA-256 of the PDF that was sent, not the file. ## File signed copies in Google Drive With [Google Drive](./google-drive.md) connected, the signed PDF and the audit log can go into one of your named Drive folders: - **Automatically:** ask when you send ("…and file the signed copy in Signed Agreements"). Both files are saved there once everyone has signed: right away with the webhook, otherwise the next time someone checks the request. - **Later:** "File the signed consulting agreement in Signed Agreements." Both files are marked read-only in Drive ("Signed – final" and "Audit log – final"), and the signed PDF's description records the SHA-256 of the original PDF that was sent. Read-only in Drive is a signal, not an access control; for real retention, set Google Vault rules on the shared drive. ## Who can use it | Who | Can | | --- | --- | | Owners and admins | Connect and disconnect DocuSeal, set up the webhook, change the settings below. | | Anyone who can use integrations | Request signatures, and see, send, cancel and download every signature request in the workspace. | Two workspace settings, under **Settings** on the Integrations page: - **Who can use integrations:** **Every member** (default) or **Owners and admins only**. - **Confirming signature requests:** **In chat** (default: "Your agent shows the document, names and emails, and sends once you say yes") or **In the browser** ("Agents prepare requests; a person reviews and sends each one here in OpenDocs"). To send a document for signing, you also need to be able to read it, the same rule as for exports. ## Under the hood Signing is always two commands: `sign request` makes a draft, `sign send` sends it. Agents never run them in the same step, and never pass `--yes` to `sign send` without the user's explicit yes. ```bash # 1. Draft. Nothing is emailed. opendocs sign request consulting-agreement.md \ --signer "Consultant=John Adams <adams@company.example>" \ --signer "Halvard=Dana <dana@halvard.example>" \ --subject "Please sign: consulting agreement" \ --expires 2026-11-30 --file-to "Signed Agreements" --json # Optional: the exact PDF signers will get (drafts only) opendocs sign download <id> --kind draft # 2. Send, after the user said yes to the summary opendocs sign send <id> --yes --json # Afterwards opendocs sign status <id> --json opendocs sign list --doc consulting-agreement.md --status pending --json opendocs sign download <id> # signed PDF opendocs sign download <id> --audit # audit log opendocs sign save <id> --folder "Signed Agreements" --json opendocs sign cancel <id> --yes --json # only when the user asks ``` Without `--json`, `sign request` prints the summary your agent reads back to you: ```text ✔ Draft signature request created. Nothing has been sent yet. Document: Consulting agreement (v2, SHA-256 3b9f0c2a71de) Request: 5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45 Signers (sequential: each signer is emailed after the previous one has signed): 1. John Adams <adams@company.example> — Signer 1 Email: the standard DocuSeal invitation (no custom subject or message) Expires: no expiry date File to: not filed automatically ⚠ adams@company.example is outside your workspace's email domains. Next step: Read these signers back to the user and get an explicit yes, then run: opendocs sign send 5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45 --yes Offer the user the exact PDF signers will get first: opendocs sign download 5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45 --kind draft ``` ### `opendocs sign request <doc>` `<doc>` is a post ID, a slug, or a local `.md` file this folder published. | Flag | Default | Notes | | --- | --- | --- | | `--signer <signer>` | Required, repeatable | `"Name <email>"` or `"Role=Name <email>"`, one per signer, in signing order. 1 to 10 signers. A signer without a name or with a malformed email is refused before anything is sent to the server. | | `--parallel` | Off | Email every signer at once. Without it, one after another. | | `--subject <subject>` | DocuSeal's invitation | Email subject, up to 200 characters. | | `--message <message>` | DocuSeal's invitation | Email message, up to 4,000 characters. A longer one is refused with `invalid_request`. | | `--expires <date>` | No expiry | `YYYY-MM-DD`. Expires at the end of that day (UTC), at least an hour from now. | | `--file-to <folder>` | Not filed | A Drive folder name from `opendocs integrations`. The signed PDF and audit log are saved there once everyone has signed. | | `--version <n>` | Latest | Send an earlier version (`3` or `v3`). | Without a signature block, signers without a role get `Signer 1`, `Signer 2`, and so on. With one, see [Mark where people sign](#mark-where-people-sign). ### The other `sign` commands | Command | Flags | Notes | | --- | --- | --- | | `opendocs sign send <id>` | `-y`, `--yes` | Sends a draft. `--yes` is required outside a terminal and with `--json`; in a terminal without it, the CLI shows the summary and asks. In browser mode it fails with `approval_required` and the `approveUrl`. | | `opendocs sign status <id>` | | Refreshed from DocuSeal (at most every 30 seconds). | | `opendocs sign list` (`ls`) | `--doc <doc>`, `--status <status>` | Newest first, up to 50. Shows the last known status without refreshing. `--status`: `draft`, `pending`, `completed`, `declined`, `expired`, `cancelled`, `failed`. | | `opendocs sign cancel <id>` | `-y`, `--yes` | Cancels a draft or a pending request. `--yes` is required outside a terminal. | | `opendocs sign download <id>` | `--kind <kind>` (default `signed`), `--draft`, `--audit`, `-o`, `--output <path>` | `--kind` is `signed`, `audit` or `draft`; `--draft` and `--audit` are shortcuts, use only one. The draft PDF exists only until the request is sent. Default output: the server's file name in the current folder. | | `opendocs sign save <id>` | `--folder <name>` (required) | Saves the signed PDF and audit log of a completed request to a Drive folder. | A signature request in JSON (from `sign request`, `send`, `status`, `cancel`, and in `sign list` as `requests[]`): ```json { "id": "5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45", "workspaceId": "…", "status": "draft", "provider": "docuseal", "document": { "postId": "…", "slug": "consulting-agreement", "title": "Consulting agreement", "versionNumber": 2, "sha256": "3b9f0c2a71de…", "fileName": "Consulting agreement (v2).pdf" }, "signers": [ { "name": "John Adams", "email": "adams@company.example", "role": "Signer 1", "order": 1, "status": "draft" } ], "order": "sequential", "message": null, "expiresAt": null, "fileTo": null, "confirmation": { "mode": "chat", "approveUrl": "https://opendocs.cc/dashboard/integrations/signatures/5b0e2c9a-7d14-4f3b-9a61-3c8e0d2f7b45" }, "sentAt": null, "confirmedVia": null, "completedAt": null, "filed": null, "lastError": null, "createdAt": "2026-10-24T10:02:11.000Z", "warnings": ["adams@company.example is outside your workspace's email domains."] } ``` `warnings` comes only with a new draft. Signer `status` is `draft`, `awaiting`, `sent`, `opened`, `completed` or `declined`; a signer can also carry `completedAt` and `declineReason`. `confirmedVia` is `chat` or `browser` once sent. With parallel signing, every signer has `order: 1`. The API endpoints: | Endpoint | What it does | | --- | --- | | `POST /api/v1/posts/{postIdOrSlug}/signature-requests` | Create a draft. | | `POST /api/v1/signature-requests/{id}/send` | Send a draft. Needs `{ "confirm": true }`, or answers `400 confirmation_required`. | | `GET /api/v1/signature-requests?workspaceId=…` | List (optional `post`, `status`). | | `GET /api/v1/signature-requests/{id}` | One request, refreshed from DocuSeal. | | `DELETE /api/v1/signature-requests/{id}` | Cancel. | | `GET /api/v1/signature-requests/{id}/documents/{kind}` | `draft`, `signed` or `audit` PDF. | | `POST /api/v1/signature-requests/{id}/storage` | File the signed PDF and audit log to `{ "destination" }`. | Creating a draft, downloading and filing count against the export rate limit (120 a minute). Details in the [Integrations API](../api-reference/integrations.md). ## Troubleshooting | What you see | What to do | | --- | --- | | `plan_required` | Upgrade the workspace at [opendocs.cc/dashboard/billing](https://opendocs.cc/dashboard/billing). | | `integration_not_connected` | DocuSeal isn't connected to this workspace. An owner or admin connects it on the Integrations page. | | "DocuSeal didn't accept that key on docuseal.com" (or .eu) | Check the key, and that the region matches where your DocuSeal account is. | | `signer_roles_mismatch` | The document's signature block has roles that don't match the signers. The error lists the roles; tell your agent who signs for each. | | `invalid_signers` | A signer is missing a name, has an invalid email, or a role is repeated. Your agent asks you for the missing details rather than guessing. | | `confirm_required` | Your agent tried to send or cancel without your confirmation, and the CLI stopped it. Nothing was sent. | | `approval_required` | The workspace confirms signature requests in the browser. Open the link your agent gives you and click **Send**. | | `already_sent` | The request isn't a draft any more. Ask your agent for its status. | | `not_completed` | Not everyone has signed, so there's no signed PDF yet. | | `not_available` | The draft PDF is only kept until the request is sent, or DocuSeal doesn't have the document yet. | | `reconnect_required`, or **Needs reconnecting** | DocuSeal rejected the API key (revoked or rotated). An owner or admin pastes a new key on the DocuSeal card. | | `send_failed` | DocuSeal didn't accept the request; the message has its reason. The request stays a draft, so you can try again. | | `invalid_expiry` | Use a date like `2026-11-30`, at least an hour from now. | | `export_failed` or `export_timeout` | The draft PDF couldn't be rendered. Try again in a minute. | | The status hasn't changed | Without the webhook, statuses update when someone checks the request. Ask your agent for the status, or add the webhook. | | The signature block shows as code | The block breaks a rule: check that every entry starts with `- ` and has a unique `role`. | ## Related pages - [Google Drive](./google-drive.md) - [Branded PDF and Word exports](../publishing/branded-exports.md) - [Plans and limits](../getting-started/plans-and-limits.md) - [CLI reference](../cli/reference.md) - [Integrations API](../api-reference/integrations.md) --- URL: https://docs.opendocs.cc/cli/reference # CLI reference Most people never type these commands: you ask your agent in plain language and it runs them for you. This page is for agents, and for anyone who wants the detail. Agents should pass `--json` on every command and read the JSON instead of the terminal text. This page matches CLI version 0.4.7. ## Install ```bash npm install -g @opendocs.cc/cli # Node.js 20 or later opendocs login --email dana@halvard.example opendocs login --email dana@halvard.example --code 123456 ``` No Node.js? `curl -fsSL https://opendocs.cc/install.sh | bash` installs the agent skill with a bash client (`scripts/opendocs.sh` in the skill folder, using `curl` and `jq`) that covers `login`, `whoami`, `publish`, `list`, `pull`, `history`, `share`, `export`, `claim`, `team` and `theme`. ## Global flags These work on every command, before or after the subcommand (`opendocs list --json`). | Flag | Default | Notes | | --- | --- | --- | | `--json` | Off | One JSON object on stdout; errors as JSON on stderr. Spinners, colors and hints are off. | | `--api-url <url>` | Saved URL, else `https://api.opendocs.cc` | API for this command. `opendocs login` saves the URL it used. | | `--client <name>` | Detected | The agent shown on published versions, sent as the `X-OpenDocs-Client` header. Detected: `claude-code`, `cursor`, `codex`, `gemini`, `opencode`; otherwise `opendocs-cli`. | | `-h`, `--help` | | Help for any command or subcommand. | | `-V`, `--version` | | Print the CLI version. After a subcommand, `--version <n>` is a document version instead (`pull`, `save`, `sign request`). | ## Environment variables | Variable | Used by | Notes | | --- | --- | --- | | `OPENDOCS_API_KEY` | `opendocs login` | Used when `--key` isn't given: the key is checked and saved to the config. Other commands read the saved config, not this variable, so in CI run `opendocs login --json` first. | | `OPENDOCS_API_URL` | `opendocs login`, `publish --anonymous` | API URL when there's no `--api-url`. `login` saves it to the config; after that the saved URL is used. | | `OPENDOCS_WEB_URL` | `opendocs login --browser` | Web app to open. Defaults to the one matching the API URL (`https://opendocs.cc`). | | `OPENDOCS_CLIENT` | Every command | Same as `--client`. | | `XDG_CONFIG_HOME` | Every command | Moves the config file to `$XDG_CONFIG_HOME/opendocs/config.json`. | ```bash # CI with an existing key OPENDOCS_API_KEY=od_live_xxxxx opendocs login --json opendocs publish docs/ --json ``` ## Files | File | What it holds | | --- | --- | | `~/.config/opendocs/config.json` | API key, API URL, user, active workspace and project, and the `organize` preference. Written by `login` and by commands that switch the active workspace or project or change a preference; removed by `logout`. Readable only by you (mode 600). | | `.opendocs/state.json` | Per folder: which local file is which document and version, the folder's project link, and claim tokens for anonymous documents. Written by `publish`, `clone`, `project link`, and `pull` when the file exists. Commands look for it in the current folder and its parents, up to your home folder. The CLI writes a `.gitignore` next to it so it stays out of git. | ## Output and exit codes With `--json`, a successful command prints one JSON object to stdout. A failure prints one JSON object to stderr and exits 1: ```json { "error": "destination_not_found", "message": "No folder named \"Minutes\". This workspace's folders: \"Board Minutes\", \"HR Policies\".", "destinations": ["Board Minutes", "HR Policies"] } ``` Some errors carry extra fields an agent can act on: `destinations`, `roles`, `approveUrl`, `status`, `provider`. | Exit code | Meaning | | --- | --- | | `0` | Success. | | `1` | The command failed, or a usage error such as a missing required flag. `invite` and `team invite` also exit 1 when any address failed. `publish` also does when it stopped part-way (`aborted: true`), or when some updates of already-published files or some anonymous files failed. | | `130` | Interrupted with Ctrl-C at the hidden API key prompt. | A multi-file `publish` or `export` in which some files failed can still exit 0. Check `failed` (and each `results[].success`) in the JSON. Command-line usage errors (an unknown flag, a missing required option) print plain text even with `--json`. Everything else, including `not_logged_in`, is JSON. When the API rejects the saved key (`401`), the CLI deletes the saved config and returns `auth_expired`. Sign in again. ## Rate limits and retries When the API answers `429` with a `Retry-After` of 90 seconds or less, the CLI waits that long and sends the request again, up to five times, so a big publish or export slows down instead of failing part-way (CLI 0.4.6 and later). In a terminal the spinner shows "rate limited, retrying in 12s"; with `--json` it waits silently. Longer waits, such as the hourly anonymous publish limit, come back as an error straight away. The limits are on [Plans and limits](../getting-started/plans-and-limits.md#rate-limits). ## Document arguments Commands that take `<doc>` or `<idOrSlug>` accept a post ID (UUID), a slug in the active workspace, or a local `.md` file this folder published or cloned (looked up in `.opendocs/state.json`). ## Account ### `opendocs login` Sign in or create an account. Alias: `opendocs signup`. ```bash opendocs login --email dana@halvard.example # emails a 6-digit code opendocs login --email dana@halvard.example --code 123456 # verifies it, saves a key opendocs login --browser opendocs login --key od_live_xxxxx OPENDOCS_API_KEY=od_live_xxxxx opendocs login ``` | Flag | Default | Notes | | --- | --- | --- | | `--email <email>` | | Email a sign-in code. Works for new and existing accounts. | | `--code <code>` | | The 6-digit code from the email. Needs `--email`. | | `--key-name <name>` | The detected agent, e.g. `claude-code` | Name of the API key an `--email` login creates. | | `--key <key>` | `OPENDOCS_API_KEY` | An existing API key (`od_live_…`) to check and save. | | `--browser` | | Approve the CLI in your browser; creates an API key. | | `--web-url <url>` | `OPENDOCS_WEB_URL`, else matched to the API URL | Web app for `--browser`. | - `--email` without `--code` sends the code. Without a terminal (agents, CI) or with `--json`, it stops there and prints the next command. - With `--code`, a new email gets an account, a username, a workspace at `opendocs.cc/<username>`, a Default project and an API key. Anonymous documents published from this folder are claimed into the new workspace. - With none of `--email`, `--key`, `--browser` or `OPENDOCS_API_KEY`, it waits for a key at a hidden prompt. Never run bare `opendocs login` from an agent. - After any login, pending workspace invitations are listed (`pendingInvitations`); join with `opendocs team join`. `--email` without `--code`, with `--json`: ```json { "status": "code_sent", "email": "dana@halvard.example", "accountExists": false, "expiresInSeconds": 600, "next": "opendocs login --email dana@halvard.example --code <6-digit code from the email>" } ``` `--email` with `--code`: ```json { "success": true, "accountCreated": true, "email": "dana@halvard.example", "username": "dana", "workspaceId": "…", "workspaceSlug": "dana", "projectId": "…", "keyName": "claude-code", "claimed": [], "pendingInvitations": [] } ``` `--key`, `--browser` or `OPENDOCS_API_KEY`: ```json { "success": true, "username": "dana", "workspaceId": "…", "projectId": "…", "pendingInvitations": [] } ``` ### `opendocs logout` Delete the saved config (API key, workspace and project). ```bash opendocs logout --json # {"success": true} ``` ### `opendocs whoami` Check the saved key and show the account, active workspace, active project, API URL and document quota. ```bash opendocs whoami --json ``` ```json { "userId": "…", "onboarding": { "username": "dana", "workspace": { "id": "…", "name": "Halvard", "slug": "halvard" } }, "quota": { "documents": { "plan": "pro", "limit": null, "used": 42, "remaining": null } }, "project": { "id": "…", "name": "Default", "slug": "default" }, "folderProject": null, "organize": "ask" } ``` `onboarding.workspace` is the CLI's active workspace. `folderProject` is this folder's [project link](#opendocs-project), if any. ## Publishing ### `opendocs publish <files...>` Publish Markdown files or folders. Files this folder already published are updated in place, not duplicated. ```bash opendocs publish q3-investor-update.md --json opendocs publish docs/*.md --tags api-docs --json opendocs publish ./vault --project "Board" --json opendocs publish q3-investor-update.md --export pdf --json opendocs publish notes.md --anonymous --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--title <title>` | First `# Heading` | Single file only. | | `--slug <slug>` | From the title | Single file only. | | `--visibility <level>` | `workspace` | `private`, `workspace` or `public`. On an update, the current visibility is kept unless you pass this flag. | | `--confirm-public` | | Required with `--visibility public`. | | `--tags <tags>` | | Comma-separated, applied to every file. At most 20 per document. | | `--project <project>` | See below | Project name, slug or ID. A new name creates the project. | | `--export <format>` | | `pdf` or `docx`. After publishing, writes the export next to each source file (`report.md` → `report.pdf`). Exports every file the run published or updated, including unchanged ones. | | `--anonymous` | | Publish without an account: anyone with the link can read it for 24 hours. Returns a claim URL. Up to 10 files. Ignores `--visibility`, `--tags`, `--project` and `--export`. | | `--new` | | Always create new documents, even for files this folder already published. | | `--force` | | Overwrite the live version even if someone published a newer one since your last sync. Without it, that file reports `version_conflict` and is left alone. | New files go to: `--project`, else the project named by the file's `projects/<slug>/` path inside a cloned workspace, else the folder's `project link`, else the active project. `projectSource` in the result says which (`flag`, `path`, `folder`, `active`). Folders are scanned recursively for `.md` files, skipping `.git`, `.hg`, `.obsidian`, `.opendocs`, `.trash` and `node_modules`. Local images next to the Markdown are uploaded and their links rewritten. | Limit | Value | | --- | --- | | Markdown per file | 1 MB | | Files per command | 500 | | Documents per API batch | 25 (the CLI splits larger runs) | | Local images per document | 30, up to 10 MB each (JPEG, PNG, WebP, GIF, SVG) | | Anonymous files per command | 10 | One new file: ```json { "postId": "…", "slug": "q3-investor-update", "url": "/halvard/projects/investors/q3-investor-update", "title": "Q3 investor update", "versionNumber": 1, "projectId": "…", "projectSlug": "investors", "projectName": "Investors", "isDefaultProject": false, "projectSource": "flag" } ``` With `--export`, the result also has `"export": { "format": "pdf", "path": "q3-investor-update.pdf", "bytes": 48213, "success": true }`. Several files, or files this folder already published: ```json { "total": 2, "succeeded": 2, "failed": 0, "results": [ { "success": true, "file": "docs/intro.md", "postId": "…", "slug": "intro", "url": "/halvard/intro", "title": "Intro" } ], "updated": [ { "file": "docs/guide.md", "success": true, "action": "updated", "postId": "…", "url": "/halvard/guide", "versionNumber": 4 } ] } ``` `updated[].action` is `updated`, `unchanged`, `conflict` or `failed`. With `--export`, an `export` block lists each file's `path`. ### `opendocs update <file>` Publish a file as a new version of a specific document. The URL stays the same. ```bash opendocs update revised.md --post-id q3-investor-update --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--post-id <idOrSlug>` | Required | The document to update. | | `--title <title>` | First `# Heading` | | | `--visibility <level>` | Current | `private`, `workspace` or `public`. | | `--confirm-public` | | Required when changing to public. | | `--tags <tags>` | Current | Replaces the tags with this comma-separated list. | ```json { "postId": "…", "versionId": "…", "versionNumber": 4, "slug": "q3-investor-update", "url": "/halvard/projects/investors/q3-investor-update", "title": "Q3 investor update", "visibility": "workspace", "projectSlug": "investors" } ``` `unchanged: true` means the content was identical and no new version was made. ### `opendocs visibility <idOrSlug> <level>` Change who can read a document without uploading anything. `<level>` is `private`, `workspace` or `public`. ```bash opendocs visibility q3-investor-update private --json opendocs visibility q3-investor-update public --confirm-public --json ``` | Flag | Notes | | --- | --- | | `--confirm-public` | Required for `public`. Without it: `confirm_public_required`. | ### `opendocs unpublish <idOrSlug>` Take a document offline, keeping its content, version history and slug. It can't be republished: to bring it back, publish the file as a new document (`--new`). Unpublished documents don't count toward the Free plan's 50. ```bash opendocs unpublish q3-investor-update --json ``` ### `opendocs delete <idOrSlug>` Permanently delete a document and its history. Can't be undone; the slug becomes free to reuse. ```bash opendocs delete q3-investor-update --yes --json ``` | Flag | Notes | | --- | --- | | `-y`, `--yes` | Skip the confirmation prompt. Required outside a terminal, or it fails with `confirm_required` before any request is made. | ## Reading and exporting ### `opendocs list` List documents in the active project, newest first. Alias: `opendocs ls`. ```bash opendocs list --json opendocs list --all-projects --limit 100 --json opendocs list --project investors --tag q3 --json opendocs list --all --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--page <n>` | `1` | | | `--limit <n>` | `20` | At most 100. | | `--tag <tag>` | | Only documents with this tag. | | `--project <slugOrId>` | Active project | One project, by slug, ID or name. | | `--all-projects` | | Every project in the active workspace. | | `--all` | | Every workspace you belong to. | ```json { "posts": [ { "id": "…", "title": "Q3 investor update", "slug": "q3-investor-update", "visibility": "workspace", "isPublished": true, "workspaceSlug": "halvard", "tags": ["investors"], "updatedAt": "2026-10-24T12:00:00.000Z" } ], "pagination": { "page": 1, "limit": 20, "total": 1, "totalPages": 1 }, "scope": "workspace", "workspaceSlug": "halvard", "projectSlug": "default", "otherProjects": [{ "name": "Investors", "slug": "investors", "postCount": 6 }] } ``` `scope` is `all` with `--all`. `otherProjects` (only when the list is scoped to one project) shows which other projects have documents, so a short list isn't mistaken for the whole workspace. ### `opendocs get <idOrSlug>` Show one document: URL, ID, slug, project, visibility, published state, version and tags. ```bash opendocs get q3-investor-update --json ``` ```json { "post": { "id": "…", "slug": "q3-investor-update", "title": "Q3 investor update", "url": "/halvard/projects/investors/q3-investor-update", "projectSlug": "investors", "visibility": "workspace", "isPublished": true, "versionNumber": 4, "tags": ["investors"] } } ``` ### `opendocs pull [idOrSlug]` Download Markdown for one document, a project, or the whole workspace. ```bash opendocs pull q3-investor-update # writes q3-investor-update.md opendocs pull q3-investor-update --stdout opendocs pull q3-investor-update --version 2 --stdout opendocs pull --project investors --output ./investors opendocs pull --workspace --output ./halvard --dry-run ``` | Flag | Default | Notes | | --- | --- | --- | | `-o`, `--output <path>` | `<slug>.md` / current folder | A file for one document, a folder for bulk pulls. | | `--stdout` | | Print one document's Markdown to stdout. | | `--version <n>` | Latest | An earlier version of one document (see `opendocs history`). | | `--project [slugOrId]` | | Bulk: the active project, or the one named. | | `--workspace` | | Bulk: every project. Default-project documents go at the top, others under `projects/<project>/`. | | `--tag <tag>` | | Bulk: only documents with this tag. | | `--overwrite` | | Bulk: replace existing files (otherwise it refuses). | | `--dry-run` | | Bulk: show what would be written. | Pass a document or bulk flags, not both. Pulling the latest version into a tracked file brings it back in sync. ### `opendocs export [idsOrSlugs...]` Export documents to Word or PDF files. ```bash opendocs export q3-investor-update --format pdf opendocs export intro guide faq --format pdf --output ./exports opendocs export --project investors --format pdf opendocs export q3-investor-update --format pdf --stdout > update.pdf ``` | Flag | Default | Notes | | --- | --- | --- | | `-f`, `--format <format>` | `pdf` | `pdf` or `docx`. Word export needs Pro or Team (`docx_requires_pro` on Free). Before 0.4.7 the default was `docx`. | | `-o`, `--output <path>` | `<slug>.<format>` / current folder | A file for one document, a folder for several. | | `--project <slugOrId>` | | Export every document in a project, into `-o` (default `./<project>-<format>`). Not with document arguments or `--stdout`. | | `--stdout` | | Write the file to stdout. One document only. | | `--landscape` | | Landscape A4. | | `--accent-color <hex>` | Workspace theme | Override the accent color for this export, e.g. `#B91C1C`. | Up to 10 documents per command (`too_many_posts` above that); `--project` exports in batches of 10. One document: ```json { "postId": "…", "format": "pdf", "filename": "q3-investor-update.pdf", "bytes": 48213 } ``` `filename` is the path written. Several documents: `{ format, total, succeeded, failed, results }`. ## Sync and history ### `opendocs clone [dir]` Download a workspace, or one project, into a folder linked for re-publishing: `opendocs publish .` there updates the same documents. ```bash opendocs clone ./halvard --json opendocs clone --project investors --json ``` | Flag | Default | Notes | | --- | --- | --- | | `[dir]` | The workspace or project slug | Target folder. | | `--project <slugOrId>` | | Clone one project and link the folder to it. | | `--tag <tag>` | | Only documents with this tag. | | `--overwrite` | | Replace files that already exist (otherwise `file_exists`). | ### `opendocs status` Show what changed locally or online since the last publish, pull or clone, for every `.md` file under the folder that holds `.opendocs/state.json`. ```bash opendocs status --json ``` Each file is `up-to-date`, `modified` (changed locally), `behind` (newer version online), `conflict` (changed on both sides), `missing-locally`, `gone-remotely`, `untracked` (not published) or `anonymous`. JSON: `{ root, workspaceSlug, files, summary }`. Without a state file: `no_state`. ### `opendocs history <doc>` List every version of a document, newest first, with who published it and through which agent. ```bash opendocs history q3-investor-update.md --json ``` ### `opendocs rollback <doc> <version>` Publish an earlier version again as a new version, so it can be undone too. Alias: `opendocs restore`. Your local file isn't changed; pull to get the restored content. ```bash opendocs rollback q3-investor-update 3 --json ``` ## Organizing ### `opendocs project` Projects group documents inside a workspace, like branches in a repo. Default-project URLs are `/<workspace>/<slug>`; others are `/<workspace>/projects/<project>/<slug>`. ```bash opendocs project list --json opendocs project current --json opendocs project create "Investors" --slug investors --use --json opendocs project use investors --json opendocs project rename investors --name "Investor relations" --json opendocs project delete investors --yes --json opendocs project link "Board" --json opendocs project unlink --json ``` | Subcommand | Flags | Notes | | --- | --- | --- | | `list` (`ls`) | | Projects with document counts. JSON: `{ projects, activeProjectId, folderProject }`. | | `current` | | The project this folder publishes to: its link, else the active project. JSON `source` is `folder` or `active`. | | `create <name>` | `--slug <slug>`, `--use` | `--use` makes it the active project. | | `use <slugOrId>` (`switch`) | | Set the CLI's active project. Local only. | | `rename <slugOrId>` | `--name <name>` (required), `--slug <slug>` | Changing the slug changes the project's URLs. | | `delete <slugOrId>` | `-y`, `--yes` | Only empty, non-default projects. Asks first in a terminal; elsewhere fails with `confirm_required` without `--yes`. | | `link <nameOrSlug>` | | Link the current folder to a project (created if the name is new). New documents published from this folder go there. | | `unlink` | | Remove this folder's link. Publishing falls back to the active project. | ### `opendocs move <doc>` Move a document to another project. Its URL changes; its content doesn't. If the slug is taken in the target project, the document gets a new one. ```bash opendocs move q3-investor-update --project investors --json ``` | Flag | Notes | | --- | --- | | `--project <nameOrSlug>` | Required. Project name, slug or ID; a new name creates the project. | ### `opendocs config` Preferences agents follow across sessions. Today there's one, `organize`: how readily an agent sorts documents into projects. ```bash opendocs config get --json # {"organize": "ask"} opendocs config set organize auto --json ``` | Value | Meaning | | --- | --- | | `ask` (default) | Agents suggest a new project when the topic changes, and ask first. | | `auto` | Agents create and pick projects on their own, and say where things went. | | `off` | Agents publish to the active project only. | ## Sharing and teams ### `opendocs share <doc> [people...]` Share a document with people outside the workspace, by email or a whole `@domain`. They verify their email with a code and see only that document. With no people, lists who it's shared with. ```bash opendocs share q3-investor-update sam@northwind.example @northwind.example --json opendocs share q3-investor-update --json opendocs share q3-investor-update sam@northwind.example --remove --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--remove` | | Stop sharing with these people or domains. | | `--no-notify` | Emails are sent | Don't email the people you add. | ### `opendocs claim [claimUrlOrToken]` Keep anonymous documents by moving them into the active workspace (and active project). With no argument, claims everything this folder published anonymously. ```bash opendocs claim --json opendocs claim https://opendocs.cc/claim/abc123 --visibility private --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--visibility <level>` | `workspace` | `private` or `workspace`. Applies when you pass a claim URL or token. | Claimed files from this folder become tracked, so publishing them again updates the claimed documents. ### `opendocs workspace` ```bash opendocs workspace list --json opendocs workspace use halvard --json opendocs workspace create "Halvard Research" --slug halvard-research --json opendocs workspace members --json ``` | Subcommand | Flags | Notes | | --- | --- | --- | | `list` (`ls`) | | Workspaces you belong to, with your role. JSON: `{ workspaces, activeSlug }`. | | `use <slug>` (`switch`) | | Set the CLI's active workspace and its Default project. Local only; the dashboard isn't affected. | | `create <name>` | `--slug <slug>`, `--no-switch` | Create a workspace and switch to it, unless `--no-switch`. | | `members` | | Members of the active workspace. | ### `opendocs team` Members, invitations and auto-join for the active workspace, and invitations sent to you. With no subcommand, same as `team list`. ```bash opendocs team list --json opendocs team invite sam@halvard.example --role admin --json opendocs team invitations --json opendocs team join halvard --json opendocs team auto-join add halvard.example --json ``` | Subcommand | Flags | Notes | | --- | --- | --- | | `list` (`ls`) | | Members, pending invitations and auto-join domains. | | `invite <emails...>` | `--role <role>` (default `member`) | `member` or `admin`. People get an email and must accept. | | `revoke <email>` | | Cancel a pending invitation. | | `resend <email>` | | Email a pending invitation again. | | `role <email> <role>` | | Change a member's role to `admin` or `member`. | | `remove <email>` | `-y`, `--yes` | Remove a member. `--yes` is required outside a terminal. | | `leave` | `-y`, `--yes` | Leave the active workspace. `--yes` is required outside a terminal. | | `invitations` | | Invitations sent to you, and workspaces you can join through your email domain. | | `join [workspace]` | `--no-switch` | Accept an invitation (or join through your domain) and switch to it. The slug is optional when there's only one. | | `decline <workspace>` | | Decline an invitation. | | `auto-join [add\|remove] [domain]` | | Let anyone with a verified email at a domain join. No arguments lists the domains. Admins. | ### `opendocs invite <emails...>` Invite people to the active workspace. Same as `team invite`; addresses can also be comma-separated. ```bash opendocs invite sam@halvard.example dana@halvard.example --role member --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--role <role>` | `member` | `member` or `admin`. | ## Export theme ### `opendocs theme` The brand color, font, logo and footer of PDF and Word exports in the active workspace. Reading is open to everyone; changes need Pro or Team and an owner or admin. Agents ask before changing the theme. With no subcommand, same as `theme show`. See [Branded PDF and Word exports](../publishing/branded-exports.md). ```bash opendocs theme --json opendocs theme presets --json opendocs theme check "#13294B" opendocs theme set --preset boardroom --yes --json opendocs theme set --color "#13294B" --font "IBM Plex Sans" --yes --json opendocs theme footer --company "Halvard" --tagline "Field research, done carefully" --on --yes --json opendocs theme logo ./halvard-logo.png --yes --json ``` | Subcommand | Flags | Notes | | --- | --- | --- | | `show` | | The current theme, and whether you can change it and its footer. | | `presets` | | The curated color and font presets. | | `fonts` | | Fonts available in exports. | | `check <color>` | | A color's contrast on white, without changing anything. | | `set` | `--preset <id>`, `--color <hex>`, `--font <name>`, `--logo-in-exports <on\|off>`, `--allow-low-contrast`, `-y`, `--yes` | Change the theme. The brand color must be dark (4.5:1 on white or more), or it's refused with `low_contrast` unless you pass `--allow-low-contrast`. | | `footer` | `--company <name>`, `--tagline <text>`, `--link-url <url>`, `--link-label <text>`, `--on`, `--off`, `-y`, `--yes` | The footer at the end of every export. Pro and Team; Free exports keep "Made with OpenDocs". `--company` defaults to the workspace name. | | `logo [file]` | `--remove`, `-y`, `--yes` | Upload the workspace logo (PNG, JPEG or WebP, under 2 MB) or remove it. | `set`, `footer` and `logo` need `--yes` outside a terminal (`confirm_required` otherwise). ## Integrations Google Drive and DocuSeal, on Pro and Team. Owners and admins connect them in the dashboard; these commands use them. See [Google Drive](../integrations/google-drive.md) and [E-signatures with DocuSeal](../integrations/docuseal.md). ### `opendocs integrations` What the active workspace has connected, its named Drive folders, who may use integrations, and how signature requests are confirmed. Read-only. ```bash opendocs integrations --json ``` JSON: `{ workspace, tier, role, canManage, canUse, settings, dashboardUrl, integrations }`, where `settings` is `{ usableBy, signatureConfirmation }`. Drive folder names are in `integrations[].destinations[].name`. The full shape is on [Google Drive](../integrations/google-drive.md#under-the-hood). ### `opendocs save <doc>` Save a document to a named Google Drive folder. Only when the user asks. ```bash opendocs save board-minutes.md --folder "Board Minutes" --json opendocs save halvard-onboarding-guide --folder "HR Policies" --format docx --version 3 --filename "Onboarding guide 2026" --json ``` | Flag | Default | Notes | | --- | --- | --- | | `--folder <name>` | Required | A folder name from `opendocs integrations`. | | `--format <format>` | `pdf` | `pdf`, `docx` or `md`. | | `--version <n>` | Latest | An earlier version. | | `--filename <name>` | The document title | File name in Drive; the format's extension is added. | ### `opendocs sign` E-signatures through the workspace's DocuSeal account. `request` makes a draft and sends nothing; `send` sends it, only after the user confirmed every signer. ```bash opendocs sign request consulting-agreement.md --signer "John Adams <adams@company.example>" --json opendocs sign send <id> --yes --json opendocs sign status <id> --json ``` | Subcommand | Flags | Notes | | --- | --- | --- | | `request <doc>` | `--signer <signer>` (repeat, required), `--parallel`, `--subject <subject>`, `--message <message>`, `--expires <date>`, `--file-to <folder>`, `--version <n>` | Create a draft. `--signer` is `"Name <email>"` or `"Role=Name <email>"`, in signing order, 1 to 10. Sequential unless `--parallel`. `--expires` is `YYYY-MM-DD`. `--file-to` files the signed PDF and audit log in a Drive folder once everyone has signed. | | `send <id>` | `-y`, `--yes` | Send a draft. `--yes` is required outside a terminal and with `--json` (`confirm_required` otherwise, before any request). In browser-confirmation workspaces: `approval_required` with `approveUrl`. | | `status <id>` | | Where it stands, refreshed from DocuSeal. | | `list` (`ls`) | `--doc <doc>`, `--status <status>` | Newest first, up to 50. `--status`: `draft`, `pending`, `completed`, `declined`, `expired`, `cancelled`, `failed`. | | `cancel <id>` | `-y`, `--yes` | Cancel a draft or pending request. `--yes` is required outside a terminal. | | `download <id>` | `--kind <kind>` (default `signed`), `--draft`, `--audit`, `-o`, `--output <path>` | `signed`, `audit` (the audit log) or `draft` (the exact PDF signers will get, until it's sent). | | `save <id>` | `--folder <name>` (required) | Save a completed request's signed PDF and audit log to a Drive folder. | The full flag reference and JSON are on [E-signatures with DocuSeal](../integrations/docuseal.md#under-the-hood). ## Agents ### `opendocs agent` Print the instructions bundled with this CLI version for AI agents, or install them as a skill. Needs no login and fetches nothing. ```bash opendocs agent # short reference opendocs agent --full # the full SKILL.md opendocs agent --cli # CLI-only reference opendocs agent --api # API-only reference opendocs agent --install # every agent found on this machine opendocs agent --install --agent codex cursor # just these, even if not found opendocs agent --install --list # supported agents and where they read skills opendocs agent --install ./.claude/skills/opendocs # one folder, e.g. in a repository ``` | Flag | Default | Notes | | --- | --- | --- | | `--full` | | The full bundled `SKILL.md`. | | `--cli` | | CLI-only reference. | | `--api` | | API-only reference. | | `--install [dir]` | Every detected agent | Write `SKILL.md` and `scripts/opendocs.sh` into each agent's skills folder, or into the folder you name. | | `--agent <ids...>` | | With `--install`: only these agents, creating their folders if needed. | | `--list` | | With `--install`: show the supported agents, their folders and whether they're detected, without installing. | Installing for every agent, `--agent` and `--list` need CLI 0.5.0 or later (older versions write `~/.claude/skills/opendocs` only). `--install` finds an agent by its config folder (`~/.codex`, `~/.cursor`…) and writes the skill where that agent reads it. Agents that read the shared `~/.agents/skills` folder get one copy there: | Agent (`--agent` id) | Skills folder | | --- | --- | | Claude Code (`claude-code`) | `~/.claude/skills` | | Cline (`cline`) | `~/.cline/skills` | | Hermes Agent (`hermes-agent`) | `~/.hermes/skills` | | Kiro CLI (`kiro-cli`) | `~/.kiro/skills` | | Codex (`codex`), Cursor (`cursor`), GitHub Copilot (`github-copilot`), Gemini CLI (`gemini-cli`), opencode (`opencode`), OpenClaw (`openclaw`), Windsurf (`windsurf`), Amp (`amp`), Goose (`goose`), Grok (`grok`) | `~/.agents/skills` | It never deletes anything, leaves identical files alone, and skips skill folders that are links (such as the ones `npx skills add` makes). Use one of `--full`, `--cli` and `--api`. With `--json`: `{ "variant": "concise", "version": "…", "content": "…" }`, or for `--install` `{ "installed": [{ "agent", "path", "status" }], "skipped": [{ "agent", "reason" }], "version": "…" }`. ## Common errors | Error | What to do | | --- | --- | | `not_logged_in` | No saved login. Run `opendocs login --email <email>`. | | `auth_expired` | The key was revoked; the CLI removed it. Sign in again. | | `no_workspace` | The config has no active workspace. Run `opendocs login` again. | | `document_limit` | The Free plan's 50 documents are used. Upgrade, unpublish old documents, or publish fewer. | | `doc_too_large` | Split the Markdown file (1 MB limit). | | `too_many_files` | More than 500 files (10 anonymously). Publish in smaller groups. | | `too_many_posts` | More than 10 documents in one export. Split it. | | `version_conflict` | Someone published a newer version. Pull it, or re-run with `--force` only if the user agrees. | | `confirm_public_required` | Re-run with `--confirm-public`, only after the user said yes to a public link. | | `confirm_required` | A command that needs confirmation ran without `--yes` outside a terminal. Nothing was done. Ask the user first. | | `not_a_member` | Not a member of that workspace. Run `opendocs workspace list --json` and pick one. | | `image_upload_failed` | Fix or remove the local image reference and retry. | | `rate_limited` | The API asked for a wait longer than 90 seconds, or five retries ran out. Wait for `Retry-After`, then retry. | | `plan_required` | The feature needs Pro or Team (the export footer, integrations). Word export on Free returns `docx_requires_pro`. | | `forbidden` | Your role can't do this (changing the theme, or integrations set to admins only). | | `integration_not_connected` | Google Drive or DocuSeal isn't connected. An owner or admin connects it; `opendocs integrations` has the link. | | `destination_not_found` | No Drive folder by that name; `destinations` lists them. Never guess one. | | `approval_required` | The workspace confirms signature requests in the browser. Give the user `approveUrl`. | | `signer_roles_mismatch` | The signers don't match the document's signature block; `roles` lists the roles. | All API error codes are in [Error codes](../errors.md). --- URL: https://docs.opendocs.cc/reference/mcp-tools <!-- Generated by apps/mcp/scripts/gen-tool-docs.ts from the tool definitions. Don't edit by hand. --> # MCP tools reference The OpenDocs MCP server (`https://mcp.opendocs.cc/mcp`) offers 41 tools. An app only sees the tools for the permissions you approved when you connected it. You don't call these yourself: you ask in plain words and the app picks the tool. See [Connect OpenDocs over MCP](../integrations/mcp.md) to set it up. **Behaviour:** *Read only* tools never change anything. *Asks you first* tools change or remove things; apps like Claude ask before running them, and OpenDocs also requires an explicit confirmation for deleting, going public and sending for signature. *Visible to others* tools publish, share or email. ## Account and defaults Who you are, your workspaces and where new documents go. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `get_account` | Who the user is in OpenDocs: their workspaces (with role), the plan and document quota of the default workspace, where new documents go by default (workspace, project, organise mode), pending invitations, connected integrations (Google Drive folder names, e-signature) and what this app is allowed to do. | Read | Read only | none | | `set_defaults` | Change where new documents go for this connection: the default workspace, the default project (or null to use the workspace's Default project) and the organise mode (ask: ask before creating projects for new topics; auto: create them and say so; off: always use the default project). | Read | Changes your data | `workspace`, `project`, `organize` | ## Reading documents Find, open and look back through documents. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `list_documents` | List the user's documents, newest first, or search them by words in the title or summary (query). | Read | Read only | `query`, `project`, `tag`, `workspace`, `page`, `limit` | | `get_document` | Open a document: its title, link, project, who can open it, who it's shared with, current version number, and its Markdown (or an older version's). | Read | Read only | `document`, `version`, `include_markdown`, `offset` | | `get_document_history` | Every published version of a document, newest first, with when and from which app it was published. | Read | Read only | `document` | | `list_projects` | The projects in a workspace with how many documents each has and their recent titles. | Read | Read only | `workspace` | ## Writing documents Publish, change, share and remove documents. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `publish_document` | Publish Markdown as a new OpenDocs document and get its link. | Create and change | Visible to others | `markdown`, `title`, `slug`, `project`, `workspace`, `visibility`, `confirm_public`, `tags` | | `publish_documents` | Publish up to 25 related documents in one call (one call, never a loop of publish_document). | Create and change | Visible to others | `documents`, `project`, `workspace`, `visibility`, `confirm_public`, `tags` | | `edit_document` | Make targeted changes to a document without resending all of it: each edit replaces exact text (find) with new text (replace). | Create and change | Asks you first | `document`, `edits`, `base_version` | | `update_document` | Replace a document's Markdown, title or tags, creating a new version at the same link (older versions are kept). | Create and change | Asks you first | `document`, `markdown`, `title`, `tags`, `base_version`, `force` | | `restore_document_version` | Bring back an older version of a document by publishing its content as a new version at the same link. | Create and change | Visible to others | `document`, `version` | | `move_document` | Move a document to another project in the same workspace (by project name, slug or ID; a new name creates the project). | Create and change | Asks you first | `document`, `project` | | `set_document_visibility` | Change a document's visibility: private (only the user), workspace (workspace members) or public (anyone with the link). | Create and change | Asks you first | `document`, `visibility`, `confirm_public` | | `share_document` | Give specific people outside the workspace access to one document, or take it away. | Create and change | Asks you first | `document`, `add`, `remove`, `notify` | | `unpublish_document` | Take a document offline: its link stops working but the content, history and link are kept, and it no longer counts toward the workspace's document limit. | Create and change | Asks you first | `document` | | `delete_document` | Permanently delete a document with every version. | Create and change | Asks you first | `document`, `confirm` | | `claim_anonymous_document` | Move a document that was published without an account (a 24-hour link) into the user's workspace so it stays. | Create and change | Changes your data | `claim`, `project`, `workspace`, `visibility` | | `upload_image` | Store an image in OpenDocs and get a permanent link to put in a document as `![description](link)`. | Create and change | Changes your data | `data_base64`, `file`, `filename`, `workspace` | ## Files PDF and Word exports, as download links. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `export_document` | Turn one or more documents (up to 10) into PDF or Word files with the workspace's branding, and get a download link for each. | Read | Read only | `documents`, `format`, `landscape`, `accent_color` | ## Projects Group related documents. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `create_project` | Create a project in a workspace. | Create and change | Changes your data | `name`, `slug`, `workspace` | | `rename_project` | Rename a project, and optionally change its slug. | Create and change | Asks you first | `project`, `name`, `slug`, `workspace` | | `delete_project` | Delete a project. | Create and change | Asks you first | `project`, `confirm`, `workspace` | ## Team and workspaces Needs the "Manage team members, workspaces and export branding" permission, except reading the team and answering your own invitations. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `list_team` | Who is in a workspace: members with their name, email and role, plus pending invitations and auto-join email domains. | Read | Read only | `workspace` | | `invite_people` | Invite people to a workspace by email. | Team and workspace admin | Visible to others | `emails`, `role`, `workspace` | | `change_member_role` | Make a workspace member an admin, or an admin a member again. | Team and workspace admin | Asks you first | `email`, `role`, `workspace` | | `resend_invitation` | Email a pending workspace invitation to the person again, for example when they can't find it. | Team and workspace admin | Visible to others | `email`, `workspace` | | `revoke_invitation` | Cancel a workspace invitation that wasn't accepted yet: the link in the person's email stops working. | Team and workspace admin | Asks you first | `email`, `workspace` | | `remove_team_member` | Remove a member from a workspace. | Team and workspace admin | Asks you first | `email`, `confirm`, `workspace` | | `respond_to_invitation` | Accept an invitation to a workspace, join a workspace that's open to the user's email domain, or decline an invitation. | Create and change | Changes your data | `workspace`, `accept` | | `leave_workspace` | Leave a workspace the user belongs to. | Create and change | Asks you first | `workspace`, `confirm` | | `create_workspace` | Create a new workspace, with the user as owner. | Team and workspace admin | Changes your data | `name`, `slug` | | `set_auto_join_domains` | Let anyone who signs in with a verified email at the company's domain join a workspace as a member without an invitation (add), or stop that (remove). | Team and workspace admin | Changes your data | `add`, `remove`, `workspace` | ## Export theme The colour, font, logo and footer of every PDF and Word export in a workspace. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `get_export_theme` | The look of the workspace's PDF and Word exports: brand colour, font, preset, logo and footer, whether the user may change them, plus the curated presets (with what each suits), the available fonts and the contrast rules. | Read | Read only | `workspace` | | `update_export_theme` | Change the brand colour, font, preset, logo or footer used in every PDF and Word export in the workspace. | Team and workspace admin | Changes your data | `preset`, `color`, `font`, `logo_in_exports`, `footer`, `logo_url`, `allow_low_contrast`, `confirm`, `workspace` | ## Google Drive and e-signature Needs the "Google Drive and e-signatures" permission, and a Pro or Team workspace with Drive or DocuSeal connected in Dashboard → Integrations. | Tool | What it does | Permission | Behaviour | Parameters | |---|---|---|---|---| | `save_to_drive` | Save a document as a PDF (default), Word or Markdown file in one of the workspace's Google Drive folders. | Drive and e-signatures | Visible to others | `document`, `folder`, `format`, `version`, `filename` | | `create_signature_draft` | Create a draft signature request with DocuSeal. | Drive and e-signatures | Changes your data | `document`, `signers`, `order`, `subject`, `message`, `expires`, `file_to`, `version` | | `send_signature_request` | Send a draft signature request (made with create_signature_draft): DocuSeal emails each signer a link to sign, in the draft's order. | Drive and e-signatures | Asks you first | `request_id`, `confirm` | | `list_signature_requests` | The workspace's signature requests, newest first (up to 50), with status and how many have signed. | Drive and e-signatures | Read only | `document`, `status`, `workspace` | | `get_signature_request` | Where a signature request stands: its status, each signer's status (not sent, email sent, opened, signed, declined) and the details read back before sending. | Drive and e-signatures | Read only | `request_id` | | `cancel_signature_request` | Cancel a draft or pending signature request; signers can no longer sign it. | Drive and e-signatures | Asks you first | `request_id`, `confirm` | | `file_signed_documents` | Save a completed signature request's signed PDF and audit log (signing certificate) in one of the workspace's Google Drive folders. | Drive and e-signatures | Visible to others | `request_id`, `folder` | --- URL: https://docs.opendocs.cc/getting-started/cli-quickstart # Use the CLI yourself If you'd rather type the commands than ask an agent, the `opendocs` CLI does everything your agent does: publish Markdown to a link, update it, export PDF and Word files, and share it. These are the same commands your agent runs. This page covers the handful you'll use most; the [CLI reference](../cli/reference.md) has the rest. ## Install ```bash npm install -g @opendocs.cc/cli # Node.js 20+ opendocs --version # 0.4.7 or later ``` ## Sign in ```bash opendocs login --email dana@halvard.example # emails you a 6-digit code opendocs login --email dana@halvard.example --code 482913 ``` If the email is new, this creates your account, a workspace at `opendocs.cc/<username>` and a Default project, and saves an API key in your local config. Existing accounts sign in. Codes expire after 10 minutes. No browser needed. Other ways in: ```bash opendocs login --browser # approve the CLI from a signed-in browser opendocs login --key od_live_xxxxx # an API key from the dashboard opendocs login # paste a key at the prompt ``` Check where you are: ```bash opendocs whoami ``` It shows your username, the active workspace and project, and the API URL. `opendocs whoami --json` adds your document quota. ## Publish ```bash opendocs publish q3-investor-update.md ``` The first `# Heading` becomes the title, and you get a link like: ```text opendocs.cc/halvard/q3-investor-update ``` The first part is your workspace's slug, not your username (see [Usernames and workspace slugs](../api-reference/usernames.md)). Only members of your workspace can open it until you change that. Edit the file and publish it again from the same folder: the link stays the same and you get a new version. The CLI remembers what each folder published in `.opendocs/state.json`. ```bash opendocs publish q3-investor-update.md # again: version 2, same link ``` A more explicit first publish: ```bash opendocs publish q3-investor-update.md \ --title "Q3 investor update" \ --slug q3-investor-update \ --project investors \ --tags investors,q3-2026 ``` ## Export Publish and get a file in one step. The PDF lands next to the Markdown: ```bash opendocs publish q3-investor-update.md --export pdf ``` Or export something already published: ```bash opendocs export q3-investor-update --format pdf opendocs export q3-investor-update --format docx -o ~/Desktop/q3-update.docx ``` `export` writes a PDF unless you pass `--format docx`. PDF works on every plan with your workspace's export theme; Free PDFs have a "Made with OpenDocs" footer. Word export and your own footer need Pro or Team. See [PDF, Word and branding](../publishing/branded-exports.md). ## The commands that matter | Command | What it does | | --- | --- | | `opendocs publish <files or folder>` | Publish; files this folder published before are updated. | | `opendocs list` | Documents in the active project (`--all-projects`, `--all`, `--tag <tag>`). | | `opendocs get <doc>` | Details of one document, including its URL and version. | | `opendocs pull <doc>` | Download the Markdown (`--stdout` to print it, `--version <n>` for an old one). | | `opendocs status` | What changed locally or online since the last sync. | | `opendocs history <doc>` | Every version, who published it and through which agent. | | `opendocs rollback <doc> <n>` | Publish version `n` again as a new version. | | `opendocs share <doc> <email or @domain>` | Give people outside the workspace access to one document. | | `opendocs visibility <doc> <level>` | `private`, `workspace` or `public` (public needs `--confirm-public`). | | `opendocs project create <name> --use` | Start a project and make it active. | | `opendocs workspace use <slug>` | Switch the active workspace. | | `opendocs unpublish <doc>` | Hide a document (reversible). | | `opendocs delete <doc>` | Delete it permanently. | `<doc>` is a post ID, a slug from the URL, or a local `.md` file this folder published. `opendocs get q3-investor-update` works if the active workspace has a document at that slug. ## Publish a folder Pass the folder, or several files, to one command: ```bash opendocs publish ./board-pack --tags q3-board opendocs publish ./board-pack --tags q3-board --export pdf opendocs list --tag q3-board ``` Folders are recursive and skip `.obsidian`, `.trash`, `.git`, `.hg`, `.opendocs` and `node_modules`, so an Obsidian vault works as is. The CLI sends 25 documents per request and takes up to 500 files per run. Running the same command after edits updates the changed files and, with `--export`, writes a fresh PDF for every file. ## Projects Every workspace has a Default project. For a named body of work (a client, a product, a launch), publish into a project: ```bash opendocs publish ./board-pack --project "Board" # a new name creates the project opendocs project link "Board" # everything published from this folder goes there opendocs project create "Investors" --slug investors --use ``` Default-project links look like `opendocs.cc/<workspace>/<slug>`; project links look like `opendocs.cc/<workspace>/projects/<project>/<slug>`. See [Projects](../publishing/projects.md). ## Several workspaces The CLI keeps one active workspace at a time. Every `publish`, `update` and `list` uses it: ```bash opendocs workspace list # the active one is marked with ✔ opendocs workspace use halvard-board ``` Switching only changes your local CLI config and resets the active project to that workspace's Default project. The dashboard's active workspace is separate. ## Without an account ```bash opendocs publish notes.md --anonymous ``` You get a link anyone can open for 24 hours, plus a claim link. Sign up later from the same folder (or run `opendocs claim`) to keep it. See [Share with people](../visibility/sharing-and-anonymous-links.md). ## Under the hood - The CLI talks to `https://api.opendocs.cc` (override with `--api-url` or `OPENDOCS_API_URL`). - Your login is saved in `~/.config/opendocs/config.json`, readable only by you (`0600`, in a `0700` folder). - `--json` on any command prints one JSON object, for scripts. A publish returns `postId`, `slug`, `url` (a path like `/halvard/q3-investor-update`), `title` and `versionNumber`. - In CI, log in once per job with a key. The CLI reads `OPENDOCS_API_KEY` only during `login`: ```bash OPENDOCS_API_KEY=od_live_xxxxx opendocs login --json opendocs publish ./docs --tags release --json ``` - Scripts and agents should never run bare `opendocs login`: it waits for a key on stdin. Use `--email`, `--key` or the variable above. - `opendocs update <file> --post-id <doc>` updates a document this folder didn't publish (for example one published from another machine). Omitted `--visibility` and `--tags` keep their current values. ## Next steps - [CLI reference](../cli/reference.md): every command and flag - [Publish](../publishing/publish.md): the publish and update lifecycle - [Sync a folder](../publishing/sync-and-history.md): clone, status and conflicts - [How OpenDocs works](how-opendocs-works.md): workspaces, projects, documents and versions - [Set up your agent](../integrations/overview.md): let your agent run all of this --- URL: https://docs.opendocs.cc/errors # Error codes Every API error is JSON with a stable `error` code, a `message` that says how to fix it, and a `docs_url` pointing at the code on this page (`https://docs.opendocs.cc/errors#<code>`, with `_` written as `-`). The CLI prints the message; with `--json` it writes `{ "error", "message" }` to stderr and exits non-zero. Status codes and extra fields are listed in [Errors and pagination](/api-reference/errors-and-pagination). ## Signing in | Code | Meaning | What to do | |---|---|---| | <a id="unauthorized"></a>`unauthorized` | Missing or invalid API key or session. Also a session-only route called with an API key, or a DocuSeal webhook with the wrong token. | `opendocs login --email you@example.com`, or pass a valid `od_live_` key. Session-only routes need the dashboard. | | <a id="not-logged-in"></a>`not_logged_in` | The CLI has no saved credentials. | Sign in with an emailed code, or publish with `--anonymous`. | | <a id="invalid-code"></a>`invalid_code` | The sign-in code is wrong for this email. | Use the newest email's code or request a new one. | | <a id="code-expired"></a>`code_expired` | The sign-in code is older than 10 minutes. | Request a new code. | | <a id="too-many-attempts"></a>`too_many_attempts` | Five wrong codes in a row. | Request a new code. | | <a id="signups-disabled"></a>`signups_disabled` | New accounts are temporarily closed. | Existing accounts can still sign in. | | <a id="not-available"></a>`not_available` | Anonymous publishing and the free tools are off on this server (a self-hosted instance). | Sign in to the server and publish to your workspace. | | <a id="onboarding-incomplete"></a>`onboarding_incomplete` | The account has no workspace yet. | Finish setup at opendocs.cc/onboarding, then sign in again. | | <a id="email-not-verified"></a>`email_not_verified` | Accepting an invitation, joining by domain or adding an auto-join domain needs a verified email. | Sign in once with an emailed code (`opendocs login --email`), then retry. | ## Requests and limits | Code | Meaning | What to do | |---|---|---| | <a id="invalid-request"></a>`invalid_request` | The request body or query failed validation, or the body isn't valid JSON. | `message` names the field and the problem; `issues` lists every field. | | <a id="payload-too-large"></a>`payload_too_large` | The request body is over the size limit: 2 MB, or 32 MB for a batch publish. | Send a smaller document, or split the batch into several requests. | | <a id="missing-workspace-id"></a>`missing_workspace_id` | The route needs `?workspaceId=` (or a `workspaceId` form field) and got none. | Pass the workspace id. `GET /api/v1/workspaces` lists yours. | | <a id="rate-limited"></a>`rate_limited` | Too many requests in a short time, or 4 exports already running. | Wait `Retry-After` seconds and retry. The CLI does this for you. | | <a id="service-busy"></a>`service_busy` | The free converter or anonymous publishing is at its limit across everyone using it (`503`). | Wait `Retry-After` seconds and retry, or sign in: signed-in publishing and exports aren't affected. | | <a id="document-limit"></a>`document_limit` | The plan's document cap would be exceeded. | Upgrade, unpublish old documents, or publish fewer. | | <a id="plan-limit"></a>`plan_limit` | You own as many workspaces as your plan allows. | Upgrade in the dashboard, or delete a workspace. | | <a id="plan-required"></a>`plan_required` | A Pro feature on a Free workspace: a custom export footer, integrations (Google Drive, e-signatures) or a custom domain. Brand color, font, presets and logo work on every plan. | Upgrade in the dashboard. Until then Free exports keep the "Made with OpenDocs" footer. | | <a id="member-limit"></a>`member_limit` | Members plus pending invitations are at the workspace plan's cap. | Upgrade, cancel an invitation or remove a member. | | <a id="invite-limit"></a>`invite_limit` | The workspace already has 50 pending invitations. | Cancel some, or wait for them to be accepted or expire. | | <a id="billing-failed"></a>`billing_failed` | Joining a Team workspace needed another seat and billing couldn't be updated. | Ask the workspace owner to check billing. | ## Documents | Code | Meaning | What to do | |---|---|---| | <a id="not-found"></a>`not_found` | The document (or other resource) doesn't exist or you can't read it. | Check `opendocs list`; slugs are scoped to the active workspace. A teammate's private document and another workspace's documents answer `not_found` too. | | <a id="version-conflict"></a>`version_conflict` | Someone published a newer version since your copy. | Pull the live version, or re-run with `--force` to overwrite. | | <a id="version-not-found"></a>`version_not_found` | That version number doesn't exist. | `opendocs history <doc>`. | | <a id="forbidden"></a>`forbidden` | You can't make this change. Any workspace member can edit a document; changing its visibility, moving, sharing, unpublishing or deleting it takes the author, an owner or an admin. Also returned when a workspace limits integrations to admins, or your role can't change a setting. | Ask the author or a workspace owner or admin. | | <a id="reserved-slug"></a>`reserved_slug` | The slug collides with an OpenDocs route (documents: `tag`, `tags`, `project`, `projects`; workspaces: `docs`, `pricing` and others). | Pick another slug. | | <a id="publish-failed"></a>`publish_failed` / <a id="update-failed"></a>`update_failed` | The server couldn't save the document. On publish this includes a workspace you aren't in or a project that doesn't exist; on update, an unpublished document. | Check the workspace and project, then retry; if it persists, contact support. | | <a id="unpublish-failed"></a>`unpublish_failed` | The document is already unpublished, or couldn't be unpublished. | Check `opendocs list`; retry if it's still live. | | <a id="visibility-change-failed"></a>`visibility_change_failed` | `public` without confirmation, or an unpublished document. | Pass `confirmPublic: true` (CLI: `--confirm-public`). An unpublished document's visibility can't change. | | <a id="invalid-visibility"></a>`invalid_visibility` | `visibility` isn't `private`, `workspace` or `public`. | Use one of those three. | | <a id="tag-update-failed"></a>`tag_update_failed` | The document would have more than 20 tags. | Remove some tags first. | | <a id="delete-failed"></a>`delete_failed` | The delete couldn't complete. | Retry; if it persists, contact support. | | <a id="move-failed"></a>`move_failed` / <a id="restore-failed"></a>`restore_failed` | The move or version restore couldn't complete. | Retry; check the project and version exist. | | <a id="share-failed"></a>`share_failed` / <a id="unshare-failed"></a>`unshare_failed` | Sharing couldn't be read or changed, usually because the document is unpublished. | Publish it first, then share. | | <a id="project-not-found"></a>`project_not_found` | Unknown project. | `opendocs project list`. | | <a id="invalid-claim-token"></a>`invalid_claim_token` | The claim token doesn't match the anonymous document. | Use the claim URL from the original publish. | | <a id="expired"></a>`expired` | The anonymous document's 24 hours are up, or the invitation's 7 days. | Publish it again, or ask for the invitation to be resent. | | <a id="hidden"></a>`hidden` | Readers reported the anonymous document, so it's hidden and can't be updated or claimed while it's reviewed. | Wait for the review, or publish the content again. | | <a id="no-accessible-posts"></a>`no_accessible_posts` | A workspace Markdown download found nothing you can read. | Sign in as a member, or ask for documents to be made public. | ## Exports and files | Code | Meaning | What to do | |---|---|---| | <a id="docx-requires-pro"></a>`docx_requires_pro` | Word export needs the workspace on Pro or Team. | Export as PDF, or upgrade. | | <a id="export-failed"></a>`export_failed` | The PDF/DOCX converter failed (exports, Drive saves, signature drafts). | Retry; the document itself is unaffected. | | <a id="export-timeout"></a>`export_timeout` | The converter didn't answer within 55 seconds. | Retry; very long documents may need splitting. | | <a id="converter-failed"></a>`converter_failed` / <a id="converter-timeout"></a>`converter_timeout` | One document in a batch export failed or timed out (in `manifest.json`). | Retry that document. | | <a id="conversion-failed"></a>`conversion_failed` | The free converter couldn't convert the file. | Simplify the Markdown or remove embedded images. | | <a id="missing-file"></a>`missing_file` / <a id="empty-file"></a>`empty_file` | An upload had no `file` field, or the file was blank. | Send the file as multipart field `file`. | | <a id="unsupported-mime"></a>`unsupported_mime` | The upload isn't a type the endpoint takes: JPEG, PNG, WebP, GIF or SVG for images, avatars and logos, `.md` or `.markdown` for the free converter. | Convert it to one of those. | | <a id="file-too-large"></a>`file_too_large` | The upload is over its size limit (2 MB for avatars, logos and the free converter). | Use a smaller file. | | <a id="storage-not-configured"></a>`storage_not_configured` | This server has no object storage set up. | Self-hosted only: configure storage. | ## Workspaces, projects and people | Code | Meaning | What to do | |---|---|---| | <a id="invalid-slug"></a>`invalid_slug` | A workspace or project slug breaks the rules (workspaces: 3 to 32 of `a-z 0-9 _ -`; projects: up to 64 of `a-z 0-9` and single hyphens). | `message` has the rule. | | <a id="slug-taken"></a>`slug_taken` | Another workspace (or project in the workspace) has that slug. | Pick another; `opendocs workspace create --slug`. | | <a id="default-project"></a>`default_project` | The Default project can't be renamed or deleted. | Create another project instead. | | <a id="project-not-empty"></a>`project_not_empty` | The project still has documents (`postCount`). | Move or delete them first. | | <a id="confirmation-mismatch"></a>`confirmation_mismatch` | Deleting a workspace: `confirmSlug` isn't its slug. | Type the workspace slug exactly. | | <a id="last-workspace"></a>`last_workspace` | You can't delete your only workspace. | Create or join another first, or delete your account. | | <a id="already-member"></a>`already_member` / <a id="already-invited"></a>`already_invited` | That person is already in, or already invited. | Nothing to do. | | <a id="owner-cannot-leave"></a>`owner_cannot_leave` | The owner can't leave their own workspace. | Transfer ownership or delete the workspace. | | <a id="invalid-domain"></a>`invalid_domain` | The auto-join domain doesn't look like `halvard.example`. | Pass a bare domain. | | <a id="consumer-domain"></a>`consumer_domain` | Personal email providers (gmail.com, outlook.com...) can't be auto-join domains. | Use your organization's domain. | | <a id="domain-mismatch"></a>`domain_mismatch` | You can only add your own email's domain (`yourDomain`). | Ask someone with an address at that domain. | | <a id="invalid-hostname"></a>`invalid_hostname` | The custom domain isn't one OpenDocs can serve: not a valid domain name, an IP address, an OpenDocs or reserved domain, or an apex domain on a server without apex support. `reason` says which. | Enter a name like `notes.example.com`, without `https://` or a path. See [Custom domains](/publishing/custom-domains). | | <a id="domain-taken"></a>`domain_taken` | Another workspace has that custom domain connected and active. | Remove it from the other workspace first. If you can't, replace that workspace's `opendocs-verify` TXT value with yours: once its checks fail, the domain can be connected here. | | <a id="onboarding-failed"></a>`onboarding_failed` | Onboarding couldn't finish: username or workspace slug invalid, reserved or taken, or no workspace name. | Check both with the [availability endpoints](/api-reference/usernames) and retry. | | <a id="invalid-username"></a>`invalid_username` / <a id="reserved-username"></a>`reserved_username` | The new username has characters other than `a-z 0-9 _ -`, or is reserved. | Pick another. | | <a id="username-taken"></a>`username_taken` | Someone else has that username. | Pick another. | | <a id="no-username"></a>`no_username` | You haven't finished onboarding, so there's no username to rename. | Finish onboarding first. | ## Branding | Code | Meaning | What to do | |---|---|---| | <a id="low-contrast"></a>`low_contrast` | The brand color is lighter than 4.5:1 against white, so headings and white table-header text would be hard to read. | Use a darker shade of the same hue. Check with `opendocs theme check <hex>`. | | <a id="invalid-preset"></a>`invalid_preset` / <a id="invalid-font"></a>`invalid_font` | Unknown export preset or font. | `opendocs theme presets` / `opendocs theme fonts`. | | <a id="invalid-color"></a>`invalid_color` | The brand color isn't a hex color. | Use `#RRGGBB`, for example `#13294B`. | | <a id="invalid-footer"></a>`invalid_footer` / <a id="invalid-input"></a>`invalid_input` | A footer value is too long or the link isn't a URL. | Keep text under 120 characters; use a real URL. | | <a id="nothing-to-change"></a>`nothing_to_change` | A branding update had no fields. | Pass a preset, color, font, logo setting or footer. | ## Integrations | Code | Meaning | What to do | |---|---|---| | <a id="integration-not-connected"></a>`integration_not_connected` | Google Drive or DocuSeal isn't connected to this workspace. | An owner or admin connects it in the dashboard's Integrations tab. | | <a id="reconnect-required"></a>`reconnect_required` | The integration's access was revoked or expired. | An owner or admin reconnects it in the Integrations tab. | | <a id="destination-not-found"></a>`destination_not_found` | No Drive folder with that name. `destinations` lists the ones there are. | Use one of those names, or have an admin add the folder. | | <a id="destination-unavailable"></a>`destination_unavailable` | Drive refused the folder: deleted, or the connected account lost access. | An admin picks the folder again in the dashboard. | | <a id="storage-failed"></a>`storage_failed` | Uploading to Drive failed. | Retry. | | <a id="confirmation-required"></a>`confirmation_required` | A signature request was sent without `{"confirm": true}`. | Show the person the document, version, signers and order; send with `confirm: true` only after they say yes. | | <a id="approval-required"></a>`approval_required` | This workspace only lets a person send signature requests, from the browser. | Give the person `approveUrl` to review and send it. | | <a id="invalid-signers"></a>`invalid_signers` | A signer's email is invalid, or roles repeat or contain `; { } =`. | Fix the signer list. | | <a id="signer-roles-mismatch"></a>`signer_roles_mismatch` | The signers don't match the document's signature block (`roles`). | Give exactly one signer per role, with `role` set to match. | | <a id="invalid-expiry"></a>`invalid_expiry` | `expiresAt` isn't a date, or is less than an hour away. | Use a later date like `2026-11-30`. | | <a id="already-sent"></a>`already_sent` | The signature request isn't a draft any more (`status`). | Check its status; create a new request to send again. | | <a id="already-completed"></a>`already_completed` | Everyone already signed, so it can't be cancelled. | Nothing to cancel. | | <a id="not-completed"></a>`not_completed` | The signed PDF and audit log exist only once everyone has signed (`status`). | Check back later with `opendocs sign status`. | | <a id="not-available"></a>`not_available` | The file isn't there: a draft PDF after sending, or DocuSeal hasn't produced it yet. | Download the signed copy instead, or try again shortly. | | <a id="send-failed"></a>`send_failed` / <a id="cancel-failed"></a>`cancel_failed` / <a id="provider-failed"></a>`provider_failed` | DocuSeal rejected or didn't answer the request. A failed send stays a draft with `lastError`. | Read `message`, fix what it names, and retry. | | <a id="invalid-kind"></a>`invalid_kind` | The document kind isn't `draft`, `signed` or `audit`. | Use one of those. | | <a id="invalid-payload"></a>`invalid_payload` | A DocuSeal webhook body wasn't valid JSON. | Sent to DocuSeal, not to you. | | <a id="integrations-not-configured"></a>`integrations_not_configured` | This server has no integrations encryption key. | Self-hosted only: set the key. | ## Account | Code | Meaning | What to do | |---|---|---| | <a id="active-plan"></a>`active_plan` | The account can't be deleted while a paid subscription is active (`code` field). | Cancel the subscription first. | | <a id="team-workspace-with-members"></a>`team_workspace_with_members` | You own a Team workspace with other active members (`code` field). | Transfer or empty those workspaces first. | ## CLI only | Code | Meaning | What to do | |---|---|---| | <a id="confirm-required"></a>`confirm_required` | A command that affects others or every export (theme changes, team changes, sending or cancelling a signature request) ran without `--yes` outside a terminal. | Ask the person, then pass `--yes`. | | <a id="confirm-public-required"></a>`confirm_public_required` | Making a document public without `--confirm-public`. | Ask the person, then pass `--confirm-public`. | | <a id="no-workspace"></a>`no_workspace` | The CLI has no active workspace. | `opendocs login`, or `opendocs workspace use <slug>`. | | <a id="doc-too-large"></a>`doc_too_large` | A file is over the 1 MB per-document limit. | Split it into smaller documents. | ## Server | Code | Meaning | What to do | |---|---|---| | <a id="internal-error"></a>`internal_error` | Unexpected server error. | Retry; contact support if it persists. | --- URL: https://docs.opendocs.cc/getting-started/troubleshooting # Troubleshooting Most problems come with an error code and a message that says what to do; your agent will usually relay it. If you have a code, the [error reference](../errors.md) explains it. Otherwise, find the symptom below. ## Setup ### The skill installer ends with a PromptScript error `npx skills add opendocs-cc/skills --skill opendocs -g -y` can end with: ```text ✗ opendocs → PromptScript: PromptScript does not support global skill installation ``` That's a known bug in the `skills` installer: with `-g` it also targets PromptScript, which only supports per-project skills. Only that line failed. The skill is installed for your other agents; carry on. ### My agent says `opendocs: command not found` The skill is installed, but the CLI isn't. Ask your agent to install it: > **Ask your agent** > > "Install the OpenDocs CLI and try again." With Node.js 20 or later it runs `npm install -g @opendocs.cc/cli`. Without Node.js, the skill's bash client (`scripts/opendocs.sh` in the skill folder) covers the core commands; it needs `curl` and `jq`. ### My agent is stuck at sign-in It probably ran `opendocs login` without `--email` or `--key`, which waits for input that never comes. Stop the command and ask your agent to sign in with your email instead: it runs `opendocs login --email <your email>` and you paste the code. ### The sign-in code didn't arrive, or doesn't work - Check spam, and look for an email from OpenDocs with the code in the subject. - Codes expire after 10 minutes and allow 5 attempts. Ask your agent to send a new one (`invalid_code`: use the newest email; `code_expired`: request again). - Prefer the browser? Sign up at [opendocs.cc/signup](https://opendocs.cc/signup), then copy the prompt from the **Connect your agent** card in the dashboard. ### Sign-in worked before, now every command fails with `auth_expired` The API key was revoked or deleted. The CLI clears it; sign in again with your email to get a new one. You can also create a key under **API keys** in the dashboard and use `opendocs login --key od_live_...`. ## Links and access ### The document went to the wrong workspace or project The CLI keeps one active workspace and project, separate from what you have open in the dashboard. > **Ask your agent** > > "Which workspace are you publishing to? Switch to Halvard and move the launch > plan to the Product project." Under the hood: `opendocs whoami --json`, `opendocs workspace use halvard`, `opendocs move launch-plan --project product`. ### Someone can't open a link - **"You don't have access":** the document is `workspace` or `private`. Add them to the workspace, or share just that document with their email. They sign in with that exact address; the email has to be verified, which signing in with a code does. - **A public link shows "not found":** check that the document is still published, that its visibility is `public`, and that the workspace's **Allow public posts** setting is on (only the workspace owner can turn it on). See [Public documents](../visibility/public-sharing.md). ### Publishing again created a second document OpenDocs updates a document when you publish the same file from the same folder: the folder's `.opendocs/state.json` remembers which file is which document. Publishing from a different folder, after deleting `.opendocs/`, or with `--new` creates a new one. Ask your agent to update the existing document by name, or to unpublish the duplicate. ### `version_conflict` when updating Someone published a newer version since your copy was synced. Your agent should show you, pull the live version to compare, and overwrite only if you say so (`--force`). See [Sync a folder](../publishing/sync-and-history.md). ## Limits ### `document_limit` The Free plan's 50 published documents are used. Existing documents keep working, including updates. Unpublish documents you no longer need, publish fewer, or upgrade to Pro. See [Plans and limits](plans-and-limits.md). ### `rate_limited` Too many requests in a minute. The CLI (0.4.6 or later) waits for the time the server asks and retries on its own, so large publishes and exports slow down instead of failing. On an older CLI, ask your agent to update it (`npm install -g @opendocs.cc/cli`). Avoid running many exports in parallel: an account can have 4 running at once. Limits are listed in [Plans and limits](plans-and-limits.md#rate-limits). ## Exports ### The PDF failed but the document published Publishing and exporting are separate steps; the document is up. Ask your agent to export it again (`opendocs export <document> --format pdf`). If exports keep timing out (`export_timeout`, or `converter_timeout` for one document in a batch), wait a minute and try again. ### Word export or the footer is refused `docx_requires_pro` and `plan_required` mean the workspace is on Free: Word files, your own export footer and integrations need Pro or Team. PDF, presets, brand color, font and logo work on every plan. `low_contrast` means the brand color is too light for headings and white table text; use a darker shade of the same color. `forbidden` on a theme change means only owners and admins can change it. ### Local images don't show up Your agent uploads images that the Markdown references with a local path. Check that each image exists, sits inside the Markdown file's folder, is JPEG, PNG, WebP, GIF or SVG, and is 10 MB or smaller. Remote image URLs are used as they are. ## Integrations Problems connecting Google Drive or DocuSeal, or with a signature request, are covered on [Google Drive](../integrations/google-drive.md) and [E-signatures](../integrations/docuseal.md). --- URL: https://docs.opendocs.cc/api-reference/authentication # Authentication This section is for developers calling the REST API directly. If you want your agent to publish for you, you don't need any of this: follow [the agent setup](/integrations/overview) and your agent signs you in with an emailed code. The API is at: ```text https://api.opendocs.cc ``` Every route in this reference is under `/api/v1`. The machine-readable spec is at `https://opendocs.cc/openapi.json` (see [OpenAPI spec](/api-reference/openapi)). ## Two ways to authenticate | Scheme | Header | Used by | | --- | --- | --- | | API key | `Authorization: Bearer od_live_...` | Agents, the CLI, scripts, backend jobs | | Session cookie | Set by signing in at opendocs.cc | The dashboard | Most endpoints accept either. When a request carries both, the session wins. Endpoints that accept only a session are marked **session only** on their pages; an API key gets `401 unauthorized` there. Those are API key management, account deletion, onboarding, profile edits, avatar upload, workspace settings (`GET /workspace`, `GET /workspaces/current`, the slug check, and rename, slug, delete, bio, public documents, default sort and the per-field branding routes) and `GET /workspace/team/stats`. ## API keys Keys start with `od_live_` followed by 32 hex characters: ```bash curl https://api.opendocs.cc/api/v1/me \ -H "Authorization: Bearer od_live_xxxxx" ``` - A key acts as you in **every** workspace you're an active member of. It is recorded against the workspace it was created in, and deleting that workspace deletes the key. - Keys don't expire. Revoke one to stop it working. - The full key is returned once, when it's created. Afterwards you only see its last four characters. Ways to get a key: the emailed-code flow below, `opendocs login --key` with a key from **Dashboard → API Keys**, or `POST /api/v1/api-keys` from a session (see [API keys](/api-reference/api-keys)). ## Recommended headers ```http Authorization: Bearer od_live_xxxxx Content-Type: application/json X-OpenDocs-Client: claude-code ``` `X-OpenDocs-Client` names the agent or tool making the call, optionally with a detail after a slash: `claude-code`, `cursor`, `codex`, `cursor/finance-bot`. It's lowercased and must match `^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,30})?$`; anything else is ignored, never rejected. It's stored on each version you publish (the dashboard shows "via Claude Code"), on signature requests and Drive saves, and it names the API key the emailed-code flow creates. IDs (`postId`, `workspaceId`, `projectId`, `userId`) are UUIDs. Some examples on these pages shorten workspace, project and user IDs to placeholders like `ws_123`. ## Getting a key with an emailed code Two unauthenticated calls sign a person in (or sign them up) and return an API key. This is what `opendocs login --email` does. ```bash curl -X POST https://api.opendocs.cc/api/v1/auth/code/request \ -H 'content-type: application/json' \ -d '{"email": "dana@halvard.example"}' ``` ```json { "success": true, "email": "dana@halvard.example", "accountExists": false, "expiresInSeconds": 600, "message": "We sent a 6-digit sign-in code to dana@halvard.example. Ask the user to paste it, then call /api/v1/auth/code/verify." } ``` ```bash curl -X POST https://api.opendocs.cc/api/v1/auth/code/verify \ -H 'content-type: application/json' \ -H 'X-OpenDocs-Client: claude-code' \ -d '{"email": "dana@halvard.example", "code": "482913"}' ``` ```json { "apiKey": "od_live_0000example0000example0000example", "keyName": "claude-code", "keyId": "c4e6a8b0-2d4f-4a6c-8e0b-1d3f5a7c9e2b", "accountCreated": true, "onboardingCreated": true, "userId": "usr_123", "email": "dana@halvard.example", "username": "dana", "workspace": { "id": "ws_123", "slug": "dana", "name": "Dana" }, "defaultProject": { "id": "proj_123", "slug": "default", "name": "Default" } } ``` | Field | Notes | | --- | --- | | `email` | Required on both calls. Trimmed and lowercased, max 320 characters. | | `code` | 6 digits. Spaces and dashes are stripped, so `482 913` works. | | `keyName` | Optional, 1 to 100 characters. Defaults to the `X-OpenDocs-Client` value, then to `CLI`. | A new email gets an account, a username and workspace derived from the address (`opendocs.cc/<username>`), a Default project and the key. `onboardingCreated` is `true` when this call created the workspace. Codes expire after 10 minutes and allow 5 wrong attempts. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Malformed email, or the code isn't 6 digits | | `400` | `invalid_code` | Wrong code for this email | | `400` | `code_expired` | The code is older than 10 minutes | | `429` | `too_many_attempts` | Five wrong codes; request a new one | | `403` | `signups_disabled` | New signups are paused and the email has no account (request step) | | `409` | `onboarding_incomplete` | The account exists but has no workspace yet | | `429` | `rate_limited` | More than 5 code requests, or 20 verify attempts, per IP in 15 minutes | ## CLI browser login ```bash opendocs login --browser ``` The CLI opens opendocs.cc, where the approval screen shows the signed-in account and workspace. After approval the CLI receives a short-lived one-time code on a `127.0.0.1` callback, exchanges it with its verifier, and stores a normal `od_live_` key. The key itself never appears in a browser URL. Agents, CI and headless machines should use the emailed code, `OPENDOCS_API_KEY` or `opendocs login --key` instead. ## OAuth and the MCP server Apps that connect through the [OpenDocs MCP server](/integrations/mcp) (Claude, ChatGPT, Cursor and others) don't use API keys. They sign the person in with OAuth 2.1: the person signs in to OpenDocs, sees which app is asking, chooses its permissions and clicks **Allow**. MCP clients do this on their own from the server URL. | What | Where | | --- | --- | | MCP server (the OAuth resource) | `https://mcp.opendocs.cc/mcp` | | Protected resource metadata | `https://mcp.opendocs.cc/.well-known/oauth-protected-resource/mcp` | | Issuer | `https://opendocs.cc/api/auth` | | Authorization server metadata | `https://opendocs.cc/.well-known/oauth-authorization-server/api/auth` | Access tokens are issued for the MCP server, not for direct REST API calls: use an API key for those. People see and revoke connected apps in **Dashboard → Connected apps**, and a revoked app loses access within a minute. The permissions and tools are listed in [MCP tools](/reference/mcp-tools). ## Endpoints that need no auth | Endpoint | Page | | --- | --- | | `POST /api/v1/auth/code/request`, `POST /api/v1/auth/code/verify` | This page | | `POST /api/v1/anonymous/publish`, `PUT /api/v1/anonymous/:id` | [Agent endpoints](/api-reference/agent-endpoints) | | `GET /api/v1/usernames/check` | [Usernames](/api-reference/usernames) | | `GET /api/v1/public/posts/...` raw Markdown, `GET /api/v1/public/workspaces/:slug/markdown.zip` | [Posts](/api-reference/posts) | | `POST /api/v1/public/posts/.../export/:format`, `POST /api/v1/tools/convert/pdf\|docx` | [Exports](/api-reference/exports) | | `POST /api/v1/integrations/docuseal/webhook/:integrationId` | [Integrations](/api-reference/integrations) (called by DocuSeal) | | `GET /healthz`, `GET /healthz/converter` | Health checks (outside `/api/v1`) | The public routes also accept auth, so a signed-in caller can read their own non-public documents through them. ## Auth failures A missing, malformed or revoked key, or an expired session: ```json { "error": "unauthorized", "message": "Missing or invalid credentials. Sign in with `opendocs login --email <you@example.com>` or pass an API key.", "docs_url": "https://docs.opendocs.cc/errors#unauthorized" } ``` Status `401`. When you're authenticated but aren't a member of the workspace, or your role can't make the change, you get `403 forbidden` (some routes answer `404 not_found` instead, so they don't reveal what exists). ## Rate limits Signed-in routes count per account, everything else per IP. See [Errors and pagination](/api-reference/errors-and-pagination#rate-limits) for every bucket. ## Related pages - [API keys](/api-reference/api-keys): create, list and revoke keys - [MCP server](/integrations/mcp): connecting Claude, ChatGPT and other apps with OAuth - [GET /api/v1/me](/api-reference/me): the standard auth check - [Errors and pagination](/api-reference/errors-and-pagination) --- URL: https://docs.opendocs.cc/api-reference/agent-endpoints # Agent endpoints The endpoints behind the CLI's `--anonymous`, `claim`, `history`, `rollback`, `move`, `share`, `workspace create`, `invitations`/`join` and `theme` commands. All accept `Authorization: Bearer od_live_...` or a session, except where noted. The machine-readable spec is at [opendocs.cc/openapi.json](https://opendocs.cc/openapi.json). ## Anonymous documents (no API key) | Endpoint | Auth | Body | Notes | | --- | --- | --- | --- | | `POST /api/v1/anonymous/publish` | None | `{ "markdown", "title"? }` | Status `201`. Returns `id`, `title`, `url`, `claimToken`, `claimUrl`, `expiresAt` (24 hours from now), `anonymous: true` and a `message` for the person. Markdown up to 512 KB (UTF-8 bytes). | | `PUT /api/v1/anonymous/:id` | None | `{ "markdown", "title"?, "claimToken" }` | Replaces the content. Doesn't extend the expiry. Returns `id`, `title`, `url`, `expiresAt`. | | `POST /api/v1/anonymous/:id/report` | None | `{ "reason", "details"? }` | Status `202`. Reports the page; `reason` is `spam`, `phishing`, `malware`, `illegal`, `personal` or `other`, `details` up to 500 characters. Reports from 3 different addresses hide the page until it's reviewed. | | `POST /api/v1/anonymous/claim` | API key or session | `{ "claimToken", "workspaceId", "projectId"?, "projectSlug"?, "visibility"?, "confirmPublic"? }` | Status `201`. Publishes the content as a normal document (visibility `workspace` unless you say otherwise) and deletes the anonymous copy, so its link stops working. Returns the [publish response](/api-reference/publish#response), `publicUrl` included, plus `claimedFrom`. | Publishing and updating anonymously share one limit: 20 requests an hour per IP. New documents are also capped at 50 a day per IP, and at 60 a minute, 1,000 an hour and 5,000 a day across everyone (`503 service_busy` past that). Reports are limited to 5 an hour and 20 a day per IP. The claim token is returned once and stored only as a hash. Anonymous pages are served at `https://opendocs.cc/a/<id>` with `noindex`, and the claim URL is `https://opendocs.cc/claim/<token>`. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Empty or oversized Markdown, missing `claimToken`, public claim without `confirmPublic` | | `403` | `invalid_claim_token` | The token doesn't match this document (update) | | `403` | `hidden` | Readers reported the document and it's under review (update, claim) | | `403` | `document_limit` | Claiming would put the workspace over its plan's cap | | `404` | `not_found` | No such anonymous document or token, or the workspace or project doesn't exist for you | | `410` | `expired` | The 24 hours are up | | `429` | `rate_limited` | More than 30 anonymous publishes and updates an hour, or 100 new documents a day, from this IP | | `503` | `service_busy` | Anonymous publishing is at its limit across everyone; wait `Retry-After` seconds | ## Updates, conflicts and unchanged content `POST /api/v1/posts/:postId/update` accepts `baseVersionNumber`, the version your local copy came from. If the document has moved past it, nothing is written and you get `409`: ```json { "error": "version_conflict", "message": "The document is at version 4, but your copy is based on version 3. Pull the latest version and re-apply your changes, or retry with force to overwrite.", "currentVersionNumber": 4, "baseVersionNumber": 3, "currentVersionCreatedAt": "2026-10-14T08:30:00.000Z" } ``` Leave `baseVersionNumber` out to overwrite regardless (the CLI's `--force`). When the Markdown is byte-identical to the current version, the response has `"unchanged": true` and no version is created; title, visibility, tag and project changes still apply. `GET /api/v1/posts` includes each document's current `versionNumber`, so a client can detect remote changes with one request. Full details are on [Post mutation endpoints](/api-reference/post-mutations). ## Version history | Endpoint | Who | Notes | | --- | --- | --- | | `GET /api/v1/posts/:postId/versions` | Anyone who can read it | `{ "postId", "versions": [...] }`, newest first. Each version has `id`, `versionNumber`, `createdAt`, `createdBy` (username), `client`, `contentHash`, `restoredFromVersion`, `bytes`, `isCurrent`. | | `GET /api/v1/posts/:postId/versions/:n/raw` | Anyone who can read it | `{ "postId", "versionNumber", "createdAt", "markdown" }`. Fenced `private` blocks are included only for the author and workspace members. | | `POST /api/v1/posts/:postId/versions/:n/restore` | The author and any active member of its workspace | Publishes version `n` again as a new version, with `restoredFromVersion: n`. | An unknown version number returns `404 version_not_found`. A restore you aren't allowed to make returns `403 forbidden`; other failures return `400 restore_failed`. Slugs resolve the same way as on every other `/posts/:postId` route (see [Post IDs and slugs](/api-reference/posts#post-ids-and-slugs)). ## Moving between projects `POST /api/v1/posts/:postId/move` with `{ "projectSlug": "archive" }` (or `projectId`). The author, workspace owners and admins can move a document. If the slug is taken in the target project the document gets a `-2`-style suffix, so its URL changes: ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "q3-investor-update", "url": "/halvard/projects/archive/q3-investor-update", "publicUrl": "https://opendocs.cc/halvard/projects/archive/q3-investor-update", "projectId": "proj_999", "projectSlug": "archive", "projectName": "Archive", "isDefaultProject": false, "moved": true, "previousSlug": "q3-investor-update" } ``` Moving to the project it's already in returns `"moved": false`. Errors: `400 invalid_request` (neither field), `403 forbidden`, `404 project_not_found`, `400 move_failed`. ## Sharing with people outside the workspace | Endpoint | Body | Response | | --- | --- | --- | | `GET /api/v1/posts/:postId/share` | None | `{ "postId", "emails": [...], "domains": [...] }` | | `POST /api/v1/posts/:postId/share` | `{ "emails": [...], "domains": [...], "notify": true }` | The full lists, plus `added: { emails, domains }`, `notified` (emails sent) and `url` | | `DELETE /api/v1/posts/:postId/share` | `{ "emails": [...], "domains": [...] }` | The remaining lists | - Only the author, workspace owners and admins can read or change sharing. - Up to 50 emails and 20 domains per request, at least one of either. Domains look like `halvard.example`; a leading `@` is dropped. - `notify` (default `true`) emails a link to newly added addresses. - A guest reads the document after signing in with that email address, and the address must be verified (emailed-code sign-in and Google or GitHub sign-in verify it). Guests see only the documents shared with them. - Unpublished documents can't be shared (`400 share_failed`). Other errors: `403 forbidden`, `400 unshare_failed`. ## Workspaces `POST /api/v1/workspaces` with `{ "name": "Halvard Labs", "slug"?: "halvard-labs" }` creates a workspace you own and returns `{ "workspace": { ..., "role": "owner" }, "defaultProject": { ... } }`. Plan limits apply (`403 plan_limit`). Details on [Workspaces API](/api-reference/workspaces#post-apiv1workspaces). ## Team: invitations from the invitee's side, leaving and auto-join | Endpoint | Notes | | --- | --- | | `GET /api/v1/me/invitations` | `{ "emailVerified", "invitations", "joinable" }`. `invitations` are unexpired invitations to your email (`id`, `workspaceId`, `workspaceName`, `workspaceSlug`, `role`, `invitedByName`, `expiresAt`); `joinable` are workspaces whose auto-join domain matches your email (`workspaceId`, `workspaceName`, `workspaceSlug`, `domain`). Both are empty until your email is verified and leave out workspaces you're already in. | | `POST /api/v1/invitations/:id/accept` | Accept without the email link. Returns `{ "workspace": { "id", "name", "slug" }, "role", "alreadyMember" }`. | | `POST /api/v1/invitations/:id/decline` | Deletes the invitation. Returns `{ "success": true, "workspaceSlug" }`. | | `POST /api/v1/workspaces/:slugOrId/join` | Join as a `member` through an auto-join domain that matches your verified email. Same response as accept. | | `POST /api/v1/workspace/leave` | Body `{ "workspaceId" }`. Returns `{ "success": true, "remainingWorkspaces": [{ "id", "slug", "name" }] }`. | | `GET /api/v1/workspace/auto-join?workspaceId=` | Any member. `{ "domains": [{ "domain", "createdAt" }] }`. | | `POST` / `DELETE /api/v1/workspace/auto-join` | Body `{ "workspaceId", "domain" }`. Owners and admins. Returns the updated `domains`. You can only add your own verified email's domain, never a personal email provider's. | | Status | `error` | When | | --- | --- | --- | | `400` | `missing_workspace_id` | `GET /workspace/auto-join` without `workspaceId` | | `400` | `invalid_domain` | The domain doesn't look like `halvard.example` | | `400` | `consumer_domain` | A personal email provider such as gmail.com | | `402` | `billing_failed` | Joining needed a Team seat and billing couldn't be updated | | `403` | `email_not_verified` | Your email isn't verified yet; sign in with an emailed code first | | `403` | `member_limit` | The workspace is at its plan's member cap | | `403` | `domain_mismatch` | The domain isn't your own email's (includes `domain` and `yourDomain`) | | `403` | `forbidden` | A member trying to change auto-join domains | | `404` | `not_found` | No such invitation for your email, no matching auto-join rule, or you aren't a member | | `409` | `owner_cannot_leave` | Owners can't leave; transfer ownership or delete the workspace | | `410` | `expired` | The invitation has expired | Admin-side invite, list, resend, cancel, role and remove endpoints are on [Team and invitations](/api-reference/team-and-invitations); they accept API keys too. Every way of joining enforces the plan's member cap and Team seats. ## Projects `GET /api/v1/projects?workspaceId=` returns each project's `postCount`, `recentTitles` (up to three, only titles you can read) and `lastPublishedAt`, so an agent can decide where a new document belongs. See [Projects endpoints](/api-reference/projects). ## Export theme `GET /api/v1/workspace/branding?workspaceId=` returns the workspace's export theme and everything needed to change it well. Any member can read it, on any plan. ```json { "workspace": { "id": "ws_123", "slug": "halvard", "name": "Halvard" }, "role": "owner", "tier": "pro", "canEdit": true, "canEditFooter": true, "branding": { "brandColor": "#13294B", "font": "IBM Plex Sans", "preset": "boardroom", "contrast": { "contrast": 14.5, "level": "great" }, "logoUrl": null, "showLogoInExports": false, "footer": { "enabled": true, "companyName": null, "tagline": null, "linkUrl": null, "linkLabel": null } }, "presets": [{ "id": "boardroom", "name": "Boardroom", "brandColor": "#13294B", "fontId": "IBM Plex Sans", "description": "..." }], "fonts": [{ "id": "Merriweather", "label": "Merriweather", "category": "serif", "description": "..." }], "guidelines": { "minContrast": 4.5, "recommendedContrast": 7, "rules": ["..."] } } ``` - `canEdit` is `true` for owners and admins, on any plan. - `canEditFooter` is `true` for owners and admins on Pro or Team. On Free, `footer` shows the "Made with OpenDocs" footer that Free exports print. - `preset` is the preset whose color and font match the current settings, or `null`. - There are 9 presets (`classic`, `boardroom`, `editorial`, `research`, `studio`, `field-guide`, `letterpress`, `terminal`, `launch`) and 10 fonts. `PATCH /api/v1/workspace/branding` applies a preset and/or individual fields in one write. Owners and admins, on any plan; the `footer` field needs Pro or Team. Agents should ask the person before changing it: it affects every export in the workspace. ```json { "workspaceId": "ws_123", "preset": "editorial", "brandColor": "#0B3D5C", "font": "Inter", "showLogoInExports": true, "footer": { "tagline": "Board and investor reporting", "linkUrl": "halvard.example" } } ``` - Every field except `workspaceId` is optional; send at least one. Unknown fields are rejected (`400 invalid_request`). - An explicit `brandColor` or `font` overrides the preset's. `brandColor` is hex with or without `#`; `font` matches case-insensitively. - Footer fields you leave out keep their value. `companyName`, `tagline` and `linkLabel` are up to 120 characters; `linkUrl` gets `https://` if it has no scheme. - The response is the same shape as the `GET`. | Status | `error` | When | | --- | --- | --- | | `400` | `missing_workspace_id` | `GET` without `workspaceId` | | `400` | `invalid_color` | `brandColor` isn't a hex color | | `400` | `low_contrast` | The color is lighter than 4.5:1 against white. Includes `contrast` and `minContrast`. Pass `"allowLowContrast": true` to save it anyway | | `400` | `invalid_preset` | Unknown preset. Includes `presets` | | `400` | `invalid_font` | Unknown font. Includes `fonts` | | `400` | `invalid_footer` | A footer value fails validation | | `400` | `nothing_to_change` | No fields to apply | | `403` | `forbidden` | You're a member, not an owner or admin | | `403` | `plan_required` | A `footer` change on a Free workspace. Includes `tier` | | `404` | `not_found` | No such workspace, or you aren't a member | Upload a logo with `POST /api/v1/workspace/logo/upload` (multipart `file` and `workspaceId`; JPEG, PNG, WebP, GIF or SVG up to 2 MB) and remove it with `POST /api/v1/workspace/logo` `{ "workspaceId", "logoUrl": null }`. Both accept API keys, need an owner or admin, and work on any plan, as does showing the logo in exports. See [Workspaces API](/api-reference/workspaces#branding). --- URL: https://docs.opendocs.cc/api-reference/api-keys # API keys Manage the `od_live_` keys that authenticate agents, the CLI and backend jobs. See [Authentication](/api-reference/authentication) for how a key is sent. :::info Session only Every endpoint on this page requires a browser session cookie. An API key can't create, list or revoke keys; it gets `401 unauthorized`. ::: **Dashboard → API Keys** is built on these three endpoints. Agents don't need them: the [emailed-code flow](/api-reference/authentication#getting-a-key-with-an-emailed-code) returns a key directly. ## The key record ```json { "id": "c4e6a8b0-2d4f-4a6c-8e0b-1d3f5a7c9e2b", "label": "claude-code", "keyHint": "9e2b", "createdAt": "2026-03-14T11:20:00.000Z", "lastUsedAt": "2026-04-17T09:00:00.000Z" } ``` `keyHint` is the last four characters of the key. `lastUsedAt` is `null` until the key is used. ## `GET /api/v1/api-keys` Lists your keys that still work. Revoked keys are left out. ```json { "keys": [ { "id": "c4e6a8b0-2d4f-4a6c-8e0b-1d3f5a7c9e2b", "label": "claude-code", "keyHint": "9e2b", "createdAt": "2026-03-14T11:20:00.000Z", "lastUsedAt": "2026-04-17T09:00:00.000Z" }, { "id": "e8a0c2b4-6d8f-4e1a-9c3b-5d7f9a1c3e5b", "label": "Default", "keyHint": "77f0", "createdAt": "2026-01-10T12:00:00.000Z", "lastUsedAt": null } ] } ``` ## `POST /api/v1/api-keys` Creates a key. ```json { "workspaceId": "ws_123", "name": "CI publisher" } ``` | Field | Required | Notes | | --- | --- | --- | | `workspaceId` | yes | A workspace you're an active member of. The key works in all your workspaces; this is the one it's recorded against, and deleting that workspace deletes the key. | | `name` | yes | 1 to 100 characters. Returned as `label`. | Status `201`: ```json { "id": "a1c3e5f7-9b2d-4f6a-8c0e-2b4d6f8a1c3e", "label": "CI publisher", "keyHint": "51d8", "plaintext": "od_live_0000example0000example0000example", "createdAt": "2026-04-17T10:15:00.000Z" } ``` :::warning One-time plaintext `plaintext` is the only time the full key is returned. Store it now. If it's lost, revoke the key and create a new one. ::: | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | `workspaceId` or `name` missing, or `name` over 100 characters | | `401` | `unauthorized` | No session cookie (API keys don't work here) | | `403` | `forbidden` | You aren't an active member of `workspaceId` | ### Keys OpenDocs creates for you - **Emailed-code sign-in** (`POST /auth/code/verify`, `opendocs login --email`) creates a key named after `keyName`, else the `X-OpenDocs-Client` header, else `CLI`. Every sign-in creates a new key. - **Dashboard onboarding** (`POST /onboarding`) creates a key named `Default` when it creates your first workspace. See [Onboarding and profile](/api-reference/onboarding-and-profile). ## `DELETE /api/v1/api-keys/:keyId` Revokes a key. ```json { "success": true } ``` | Status | `error` | When | | --- | --- | --- | | `404` | `not_found` | No active key with that id belongs to you (including one already revoked) | - Revocation is immediate: the next request with that key gets `401 unauthorized`. - Requests that already passed auth finish, including a running [batch publish](/api-reference/publish#post-apiv1publishbatch) stream. - It can't be undone. Create a new key and update the caller. ## Related pages - [Authentication](/api-reference/authentication): sending the key - [Onboarding and profile](/api-reference/onboarding-and-profile): the first key - [Errors and pagination](/api-reference/errors-and-pagination): error format --- URL: https://docs.opendocs.cc/api-reference/me # `GET /api/v1/me` Returns who you are, your onboarding state and the live document quota for a workspace. Agents call it to check that a key works. ## Auth API key or session. ## Request ```bash curl "https://api.opendocs.cc/api/v1/me?workspaceId=ws_123" \ -H "Authorization: Bearer od_live_xxxxx" ``` | Query | Required | Notes | | --- | --- | --- | | `workspaceId` | no | Compute `quota.documents` for this workspace. If you aren't an active member of it, `quota.documents` is `null`. Without it, the quota is for the workspace shown in `onboarding.workspace`. | If you belong to more than one workspace, pass `workspaceId` so the quota matches the workspace you're about to publish to. The quota is advisory: `POST /publish` and `POST /publish/batch` check the cap again themselves. ## Response ```json { "authenticated": true, "userId": "usr_123", "onboarding": { "hasUsername": true, "hasWorkspace": true, "username": "dana", "workspace": { "id": "ws_123", "name": "Halvard", "slug": "halvard", "defaultVisibility": "workspace", "defaultProject": { "id": "proj_123", "workspaceId": "ws_123", "name": "Default", "slug": "default", "isDefault": true } }, "completed": true }, "quota": { "documents": { "plan": "free", "limit": 50, "used": 12, "remaining": 38 } } } ``` ## Fields ### `onboarding` - `hasUsername`, `hasWorkspace`, `completed`: `completed` is `true` once you have both a username and a workspace. - `username`: your profile handle. - `workspace`: your earliest-joined active workspace, or `null`. It's the same one the CLI picks at login. If you belong to several, pass `workspaceId` for anything workspace-specific. `workspace.slug` is the first segment of document URLs: `opendocs.cc/<workspace.slug>/<post-slug>`. List every workspace with [`GET /api/v1/workspaces`](/api-reference/workspaces#get-apiv1workspaces). - `workspace.defaultVisibility`: `private`, `workspace` or `public`. - `workspace.defaultProject`: the project documents go to when you don't name one. ### `quota.documents` | Field | Type | Description | | --- | --- | --- | | `plan` | `"free" \| "pro" \| "team"` | The workspace's effective plan (its owner's plan) | | `limit` | number or `null` | Published documents allowed. `null` means unlimited (Pro and Team) | | `used` | number | Published documents in the workspace. Unpublished ones don't count | | `remaining` | number or `null` | `limit - used`, never below 0. `null` means unlimited | `quota.documents` is `null` when you have no workspace yet, or when you passed a `workspaceId` you aren't a member of. ## How the CLI uses it During login and before a batch publish the CLI calls `/me` to confirm the key, find the username and workspace, and compare the batch size against `quota.documents.remaining` so it can stop before sending a batch that would be rejected. ## Errors | Status | `error` | When | | --- | --- | --- | | `401` | `unauthorized` | Missing, invalid or revoked key | ## Related pages - [Plans and limits](/getting-started/plans-and-limits): where the quota comes from - [Publish endpoints](/api-reference/publish): where `document_limit` is enforced - [Errors and pagination](/api-reference/errors-and-pagination#the-document_limit-error): the `document_limit` body --- URL: https://docs.opendocs.cc/api-reference/onboarding-and-profile # Onboarding and profile The endpoints a new dashboard account uses in its first minutes: pick a username, create the first workspace, then manage profile fields and images. Agents rarely need them: the [emailed-code flow](/api-reference/authentication#getting-a-key-with-an-emailed-code) does onboarding itself, and the image presign endpoint at the end is the one the CLI uses on every publish. Auth differs per endpoint and is noted on each. ## `POST /api/v1/onboarding` **Session only.** Claims a username and creates (or, for invited people, skips) the first workspace. When it creates the workspace it also creates its Default project and an API key named `Default`. ### Request body ```json { "username": "dana", "fullName": "Dana Reyes", "workspaceName": "Halvard", "workspaceSlug": "halvard" } ``` | Field | Required | Notes | | --- | --- | --- | | `username` | yes | 3 to 32 characters, lowercase `a-z 0-9 _ -`. Must pass the [username rules](/api-reference/usernames). | | `fullName` | no | Up to 120 characters. Only filled in if your profile has no name yet. | | `workspaceName` | for new accounts | 2 to 120 characters. Omit it if you already belong to a workspace (for example, you accepted an invitation). | | `workspaceSlug` | no | 3 to 32 characters, lowercase `a-z 0-9 _ -`. The first segment of every document URL. Generated from `workspaceName` when omitted. | ### Response The [onboarding state](/api-reference/me#onboarding) plus the new key: ```json { "hasUsername": true, "hasWorkspace": true, "username": "dana", "workspace": { "id": "ws_123", "name": "Halvard", "slug": "halvard", "defaultVisibility": "workspace", "defaultProject": { "id": "proj_123", "workspaceId": "ws_123", "name": "Default", "slug": "default", "isDefault": true } }, "completed": true, "apiKey": { "id": "e8a0c2b4-6d8f-4e1a-9c3b-5d7f9a1c3e5b", "label": "Default", "keyHint": "77f0", "plaintext": "od_live_0000example0000example0000example", "createdAt": "2026-04-17T10:15:00.000Z" }, "adEventId": "registration:..." } ``` `apiKey` is `null` unless this call created your first workspace. Save `apiKey.plaintext` now; it isn't shown again. `adEventId` is used by the dashboard and can be ignored. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | A field fails the length rules above | | `400` | `onboarding_failed` | Username invalid, reserved or taken; workspace slug invalid, reserved or taken; or `workspaceName` missing for a new account. The `message` is always "Unable to complete onboarding." | | `401` | `unauthorized` | No session cookie | ## `GET /api/v1/profile` API key or session. ```json { "profile": { "username": "dana", "fullName": "Dana Reyes", "bio": null, "profilePictureUrl": "https://cdn.opendocs.cc/avatars/usr_123.png" } } ``` `profile` is `null` before onboarding. `fullName`, `bio` and `profilePictureUrl` are `null` when unset. ## `POST /api/v1/profile` **Session only.** Updates profile fields. Omit a field to leave it unchanged; pass `null` to clear it. ```json { "fullName": "Dana Reyes", "profilePictureUrl": "https://halvard.example/dana.png" } ``` | Field | Type | Notes | | --- | --- | --- | | `fullName` | string or null | Up to 120 characters | | `profilePictureUrl` | string or null | Up to 2048 characters | Returns the same shape as `GET /profile`. ## `POST /api/v1/profile/username` **Session only.** Renames your username. Your workspace slug, and so your document URLs, don't change. ```json { "username": "dana-reyes" } ``` Returns the same shape as `GET /profile`. Renaming to your current username is a no-op. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Shorter than 3 or longer than 32 characters | | `400` | `invalid_username` | Characters other than lowercase `a-z 0-9 _ -` | | `400` | `reserved_username` | A reserved name such as `docs` or `pricing` | | `400` | `no_username` | You haven't finished onboarding | | `409` | `username_taken` | Someone else has it | ## `POST /api/v1/profile/avatar/upload` **Session only.** Multipart upload that stores the image and sets `profilePictureUrl` in one step. - Form field `file` - Up to 2 MB - JPEG, PNG, WebP, GIF or SVG ```json { "profilePictureUrl": "https://cdn.opendocs.cc/avatars/usr_123.png", "profile": { "username": "dana", "fullName": "Dana Reyes", "bio": null, "profilePictureUrl": "https://cdn.opendocs.cc/avatars/usr_123.png" } } ``` | Status | `error` | When | | --- | --- | --- | | `400` | `missing_file` | No `file` field | | `400` | `unsupported_mime` | Not JPEG, PNG, WebP, GIF or SVG | | `413` | `file_too_large` | Over 2 MB | | `503` | `storage_not_configured` | Object storage isn't set up on this server | ## `POST /api/v1/storage/images/presign-upload` API key or session. Returns a short-lived URL to `PUT` an image straight to object storage. The CLI uses it to upload local images referenced in Markdown before it publishes. (Remote images in published Markdown are copied to OpenDocs storage automatically, so you only need this for local files.) ```json { "workspaceId": "ws_123", "contentType": "image/png", "contentLength": 348912, "filename": "q3-revenue-chart.png" } ``` | Field | Required | Notes | | --- | --- | --- | | `workspaceId` | yes | A workspace you're an active member of | | `contentType` | yes | `image/jpeg`, `image/png`, `image/webp`, `image/gif` or `image/svg+xml` | | `contentLength` | yes | Size in bytes, a positive integer up to 10 MB (10485760) | | `filename` | no | Up to 255 characters. Informational only | ```json { "uploadUrl": "https://<storage-host>/...?X-Amz-Signature=...", "publicUrl": "https://cdn.opendocs.cc/images/ws_123/0b7c....png", "key": "images/ws_123/0b7c....png", "expiresInSeconds": 300, "maxBytes": 10485760 } ``` 1. `POST /storage/images/presign-upload` with the type and size. 2. `PUT` the bytes to `uploadUrl` with matching `Content-Type` and `Content-Length` headers. The URL is signed, so send no auth header. 3. Put `publicUrl` in your Markdown: `![Q3 revenue](<publicUrl>)`. 4. Publish the Markdown. The URL expires after 5 minutes; request a new one if the PUT is refused. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Missing field, wrong type, or `contentLength` over 10 MB | | `400` | `unsupported_mime` | `contentType` isn't one of the image types above | | `403` | `forbidden` | You aren't an active member of `workspaceId` | | `503` | `storage_not_configured` | Object storage isn't set up on this server | ## Typical dashboard sign-up sequence 1. `POST /api/v1/onboarding`: username, workspace, first key. 2. `GET /api/v1/me`: workspace and quota for the UI. 3. `POST /api/v1/profile/avatar/upload`: optional avatar. 4. `POST /api/v1/workspace/logo/upload`: optional workspace logo (owner or admin; see [Workspaces API](/api-reference/workspaces)). ## Related pages - [Authentication](/api-reference/authentication): sessions, keys and the emailed-code flow - [API keys](/api-reference/api-keys): create and revoke keys - [Usernames and workspace slugs](/api-reference/usernames): the two identifiers - [Workspaces API](/api-reference/workspaces): settings for the workspace onboarding creates --- URL: https://docs.opendocs.cc/api-reference/publish # Publish endpoints - `POST /api/v1/publish` publishes **one** document. - `POST /api/v1/publish/batch` publishes **up to 25** in one call, with optional live progress over Server-Sent Events. Both always create new documents. To change an existing one, use [`POST /posts/:postId/update`](/api-reference/post-mutations). Both return `403 document_limit` when the workspace is at its plan's cap (50 published documents on Free, unlimited on Pro and Team); see [Plans and limits](/getting-started/plans-and-limits#the-50-document-cap-on-free). --- ## `POST /api/v1/publish` ### Auth API key or session. You must be an active member of `workspaceId`. ### Rate limit 120 requests per minute per account. ### Request body ```json { "markdown": "# Q3 investor update\n\nRevenue grew 18% quarter over quarter.", "title": "Q3 investor update", "slug": "q3-investor-update", "visibility": "workspace", "workspaceId": "ws_123", "projectSlug": "investors", "tags": ["investors", "q3"], "sourcePath": "updates/q3-investor-update.md", "confirmPublic": false } ``` ### Fields | Field | Type | Required | Notes | | --- | --- | --- | --- | | `markdown` | string | Yes | 1 to 1,000,000 characters. The request body as a whole is capped at 2 MB. | | `title` | string | No | 1 to 255 characters. Defaults to the frontmatter `title`, else the first `# ` heading, else "Untitled document". | | `slug` | string | No | Up to 160 characters, slugified. Defaults to one made from the title. A taken slug gets a `-2`-style suffix. `tag`, `tags`, `project` and `projects` are reserved and return `reserved_slug`. | | `visibility` | string | No | `private`, `workspace` (default) or `public`. | | `workspaceId` | string | Yes | A workspace you're an active member of. | | `projectId` | string | No | Project to publish into. Omit both project fields for the Default project. | | `projectSlug` | string | No | Alternative to `projectId`, resolved inside `workspaceId`. Up to 64 characters. | | `tags` | string[] | No | Up to 20 tags, 1 to 64 characters each, lowercased and de-duplicated. | | `sourcePath` | string | No | Up to 1024 characters. The local file path, stored on the version. | | `confirmPublic` | boolean | No | Must be `true` when `visibility` is `public`. | Send `X-OpenDocs-Client` to record which agent published the version (see [Authentication](/api-reference/authentication#recommended-headers)). ### Example ```bash curl https://api.opendocs.cc/api/v1/publish \ -X POST \ -H "Authorization: Bearer od_live_xxxxx" \ -H "Content-Type: application/json" \ -H "X-OpenDocs-Client: claude-code" \ -d '{ "markdown": "# Q3 investor update\n\nRevenue grew 18% quarter over quarter.", "workspaceId": "ws_123", "projectSlug": "investors", "tags": ["investors", "q3"] }' ``` ### Response Status `201`. ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "q3-investor-update", "url": "/halvard/projects/investors/q3-investor-update", "publicUrl": "https://opendocs.cc/halvard/projects/investors/q3-investor-update", "title": "Q3 investor update", "tags": ["investors", "q3"], "versionId": "1e3a5c7f-9b2d-4f6e-8a0c-2d4f6b8e1a3c", "versionNumber": 1, "contentHash": "5f2c...", "projectId": "proj_456", "projectSlug": "investors", "projectName": "Investors", "isDefaultProject": false } ``` `url` is a path. Default-project documents live at `/<workspace-slug>/<post-slug>`; other projects at `/<workspace-slug>/projects/<project-slug>/<post-slug>`. The URL stays the same when you update the document. `publicUrl` is the full link to share. It's the workspace's [custom domain](/publishing/custom-domains) when the domain is active (any visibility; readers of documents that aren't public sign in there) (for example `https://notes.halvard.example/projects/investors/q3-investor-update`), and `https://opendocs.cc` plus `url` otherwise. Use `publicUrl` when you print a link or link one document from another; `url` is kept for older clients. ### Public documents `visibility: "public"` without `confirmPublic: true` fails validation: ```json { "error": "invalid_request", "message": "confirmPublic: Public publishing requires explicit confirmation.", "docs_url": "https://docs.opendocs.cc/errors#invalid-request" } ``` A public document is visible to people outside the workspace only while the workspace's **Allow public documents** setting is on; otherwise it behaves like a `workspace` document. ### Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Body failed validation: missing `markdown` or `workspaceId`, bad `visibility`, public without `confirmPublic`, too many tags | | `400` | `reserved_slug` | The `slug` you passed is reserved (`tag`, `tags`, `project`, `projects`) | | `400` | `publish_failed` | You aren't a member of `workspaceId`, the project doesn't exist, or the save failed. The message is "Unable to publish document." | | `401` | `unauthorized` | Missing or invalid key | | `403` | `document_limit` | The workspace is at its plan's document cap (body below) | | `413` | `payload_too_large` | The body is over 2 MB | | `429` | `rate_limited` | More than 120 publishes a minute. Wait `Retry-After` seconds | ```json { "error": "document_limit", "plan": "free", "limit": 50, "used": 50, "message": "Your free plan allows 50 published documents. You currently have 50.", "docs_url": "https://docs.opendocs.cc/errors#document-limit" } ``` --- ## `POST /api/v1/publish/batch` Publishes up to **25** documents. The `Accept` header picks the response: - `application/json` (default): `207 Multi-Status` with a result per document. - `text/event-stream`: one Server-Sent Event per document as it finishes. ### Auth API key or session. ### Rate limit 20 requests per minute per account. At 25 documents each, that's up to 500 documents a minute. ### Limits - 1 to 25 documents per request. - Request body up to 32 MB. - Documents are published one after another, in order. A failed document is retried once after 100 ms (except `reserved_slug` and `document_limit`). ### Request body ```json { "documents": [ { "title": "Board minutes, October", "markdown": "# Board minutes, October\n\nDecisions...", "workspaceId": "ws_123", "projectSlug": "board", "tags": ["board"] }, { "title": "Hiring plan 2027", "markdown": "# Hiring plan 2027\n\nRoles...", "workspaceId": "ws_123" } ] } ``` Each element has the same shape and rules as the `POST /api/v1/publish` body. ### Document-limit pre-check Before anything is written, the server counts the batch's documents per workspace and checks each workspace's cap. If any workspace would go over, the whole batch is rejected with `403` and nothing is published: ```json { "error": "document_limit", "plan": "free", "limit": 50, "used": 48, "requested": 3, "workspaceId": "ws_123", "message": "This batch would publish 3 documents, but your free plan allows 50 total. You have 2 slots left." } ``` ### JSON response Status `207`. ```json { "results": [ { "success": true, "index": 0, "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "board-minutes-october", "url": "/halvard/projects/board/board-minutes-october", "publicUrl": "https://opendocs.cc/halvard/projects/board/board-minutes-october", "title": "Board minutes, October", "tags": ["board"], "versionId": "1e3a5c7f-9b2d-4f6e-8a0c-2d4f6b8e1a3c", "versionNumber": 1, "contentHash": "5f2c...", "projectId": "proj_789", "projectSlug": "board", "projectName": "Board", "isDefaultProject": false }, { "success": false, "index": 1, "error": "publish_failed", "message": "Unable to publish document." } ], "summary": { "total": 2, "succeeded": 1, "failed": 1 } } ``` Every result carries the input `index`, so you can match failures to your documents. Successful results have `url` and `publicUrl`, as in the single publish response. A per-document failure is `publish_failed` or `reserved_slug`; it doesn't change the `207` status. ### SSE response ```bash curl -N https://api.opendocs.cc/api/v1/publish/batch \ -X POST \ -H "Authorization: Bearer od_live_xxxxx" \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d @batch.json ``` ```text event: result data: {"success":true,"index":0,"postId":"8d0f3c1e-...","slug":"board-minutes-october","url":"/halvard/projects/board/board-minutes-october","publicUrl":"https://opendocs.cc/halvard/projects/board/board-minutes-october", ...} event: result data: {"success":false,"index":1,"error":"publish_failed","message":"Unable to publish document."} event: summary data: {"total":2,"succeeded":1,"failed":1} ``` - One `result` event per document, sent as soon as it finishes. - One `summary` event at the end. - The response sets `Cache-Control: no-cache` and `X-Accel-Buffering: no` so proxies don't buffer it. - Validation and the document-limit check happen before the stream starts, so those errors still arrive as normal JSON responses. ### Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | `documents` empty, more than 25 entries, or any entry fails validation (`message` names it, for example `documents.3.markdown`) | | `401` | `unauthorized` | Missing or invalid key | | `403` | `document_limit` | The pre-check found a workspace that would go over its cap | | `413` | `payload_too_large` | The body is over 32 MB. Split the batch into smaller requests | | `429` | `rate_limited` | More than 20 batches a minute. Wait `Retry-After` seconds | ## Related pages - [GET /api/v1/me](/api-reference/me): `quota.documents` for a pre-check - [Post mutation endpoints](/api-reference/post-mutations): update an existing document - [Errors and pagination](/api-reference/errors-and-pagination): error format and rate limits - [Plans and limits](/getting-started/plans-and-limits): the document cap --- URL: https://docs.opendocs.cc/api-reference/posts # Posts endpoints Read-side endpoints for documents ("posts" in the API). The signed-in ones accept an API key or a session and return what you're allowed to read: - documents you wrote, in any workspace; - `workspace` and `public` documents in workspaces you're an active member of; - for single-document reads, also public documents in workspaces that allow them and documents shared with your verified email. ## Post IDs and slugs Every `/posts/:postId` route takes either the post's UUID or its slug. A value shaped like a UUID (`8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f`) is looked up by id; anything else is treated as a slug. Slugs are unique per project, not globally, so scope slug lookups with `?workspaceId=` and, if needed, `?projectId=`. The CLI sends the active workspace by default. Without `workspaceId`, a slug resolves only inside your own workspaces and documents, never another workspace's. If several documents match, yours wins, then the most recently updated. UUID lookups ignore both parameters but still check that you can read the document. ## `GET /api/v1/posts` Lists documents, most recently updated first. ### Query parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | `page` | number | No | Defaults to `1` | | `limit` | number | No | Defaults to `20`, max `100` | | `tag` | string | No | Only documents with this tag (case-insensitive) | | `workspaceId` | string | No | Only this workspace. Omit it to list across all your workspaces. | | `projectId` | string | No | Only this project | ```bash curl "https://api.opendocs.cc/api/v1/posts?workspaceId=ws_123&tag=investors" \ -H "Authorization: Bearer od_live_xxxxx" ``` ### Response ```json { "posts": [ { "id": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "q3-investor-update", "title": "Q3 investor update", "summary": "Revenue grew 18% quarter over quarter.", "visibility": "workspace", "isPublished": true, "updatedAt": "2026-10-12T10:00:00.000Z", "workspaceId": "ws_123", "workspaceSlug": "halvard", "projectId": "proj_456", "projectSlug": "investors", "projectName": "Investors", "isDefaultProject": false, "versionNumber": 3, "tags": ["investors", "q3"], "url": "/halvard/projects/investors/q3-investor-update", "publicUrl": "https://opendocs.cc/halvard/projects/investors/q3-investor-update" } ], "pagination": { "page": 1, "limit": 20, "total": 1, "totalPages": 1 } } ``` - `visibility` is `private`, `workspace` or `public`. - `isPublished` is `false` for your own unpublished documents. Teammates' documents are listed whether or not they're published, as long as their visibility is `workspace` or `public`. - `versionNumber` is the current version, so you can spot remote changes with one request. - `url` and `publicUrl` are the same as on a single document, below. ## `GET /api/v1/posts/:postId` Metadata for one document. | Query | Notes | | --- | --- | | `workspaceId` | Scope a slug lookup to this workspace | | `projectId` | Scope a slug lookup to this project | ```json { "post": { "id": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "q3-investor-update", "title": "Q3 investor update", "summary": "Revenue grew 18% quarter over quarter.", "visibility": "workspace", "isPublished": true, "publishedAt": "2026-10-01T09:00:00.000Z", "updatedAt": "2026-10-12T10:00:00.000Z", "url": "/halvard/projects/investors/q3-investor-update", "publicUrl": "https://opendocs.cc/halvard/projects/investors/q3-investor-update", "projectId": "proj_456", "projectSlug": "investors", "projectName": "Investors", "isDefaultProject": false, "versionNumber": 3, "versionId": "1e3a5c7f-9b2d-4f6e-8a0c-2d4f6b8e1a3c", "versionCreatedAt": "2026-10-12T10:00:00.000Z", "tags": ["investors", "q3"] } } ``` `url` is a path: `/<workspace-slug>/<post-slug>` for the Default project, `/<workspace-slug>/projects/<project-slug>/<post-slug>` otherwise. `publicUrl` is the full link to share: on the workspace's [custom domain](/publishing/custom-domains) when the domain is active, on `https://opendocs.cc` otherwise. ## `GET /api/v1/posts/:postId/raw` The current Markdown of a document. Same query parameters as above. ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "markdown": "# Q3 investor update\n\nRevenue grew 18% quarter over quarter.", "title": "Q3 investor update", "slug": "q3-investor-update", "projectId": "proj_456", "projectSlug": "investors", "projectName": "Investors", "isDefaultProject": false, "versionNumber": 3 } ``` `opendocs pull` uses this to write the local file. For an older version, see [version history](/api-reference/agent-endpoints#version-history). The author and members of the document's workspace get the full source, fenced `private` blocks included. Anyone else who can read it (a guest it was shared with, or any signed-in reader of a public document) gets it without those blocks, like the page. ## Errors | Status | `error` | When | | --- | --- | --- | | `401` | `unauthorized` | Missing or invalid key | | `404` | `not_found` | No document you can read matches. A teammate's private document and another workspace's documents answer this too. When a slug misses in `workspaceId` but you wrote a document with that slug in another workspace, `message` names that workspace. | | `429` | `rate_limited` | Over the 600 requests a minute per-IP limit | ## Public documents without a key Agents and scripts can read a published document the same way a browser would. These routes need no auth; with a key or session they also serve your own and your workspaces' non-public documents. ### `GET /api/v1/public/posts/:workspaceSlug/:postSlug/raw` Also `GET /api/v1/public/posts/:workspaceSlug/projects/:projectSlug/:postSlug/raw`. Mirrors the document URL: `opendocs.cc/halvard/q3-investor-update` becomes `/api/v1/public/posts/halvard/q3-investor-update/raw`. Returns the Markdown as `text/markdown; charset=utf-8` with `Content-Disposition: attachment; filename="<slug>.md"`. Fenced `private` blocks are left out, for every reader. Unpublished documents and anything you can't read return `404 not_found`. Rate limit: 120 requests a minute per IP. ### `GET /api/v1/public/workspaces/:workspaceSlug/markdown.zip` Every document in the workspace you can read, as a zip of `.md` files (up to the 200 most recently updated), without their fenced `private` blocks. Default-project documents sit at the root, others under `<project-slug>/`, with a `manifest.json`: ```json { "workspace": "halvard", "workspaceName": "Halvard", "downloadedAt": "2026-10-24T09:00:00.000Z", "postCount": 2, "posts": [ { "slug": "q3-investor-update", "title": "Q3 investor update", "updatedAt": "2026-10-12T10:00:00.000Z", "path": "investors/q3-investor-update.md" } ] } ``` | Status | `error` | When | | --- | --- | --- | | `404` | `not_found` | No such workspace, or it doesn't allow public documents and you aren't a member | | `404` | `no_accessible_posts` | Nothing in it you can read | | `429` | `rate_limited` | More than 3 downloads a minute per IP | ## Related pages - [Post mutation endpoints](/api-reference/post-mutations): update, unpublish, visibility, tags, delete - [Agent endpoints](/api-reference/agent-endpoints): versions, moves, sharing - [Export endpoints](/api-reference/exports): PDF and Word - [Errors and pagination](/api-reference/errors-and-pagination) --- URL: https://docs.opendocs.cc/api-reference/post-mutations # Post mutation endpoints Six endpoints change a document you've already published. All accept an API key or a session and fall under the general rate limit (600 requests a minute per IP). None of them uses a document slot on Free, so they work even when a workspace is at 50 of 50. `:postId` is the post's UUID or its slug; scope slugs with `?workspaceId=` and `?projectId=` (see [Post IDs and slugs](/api-reference/posts#post-ids-and-slugs)). ## Who can do what | Action | Who | Endpoint | | --- | --- | --- | | Publish a new version, retag | The author and any active member of the document's workspace | `update`, `tags` | | Change visibility or project as part of an update | The author, workspace owners and admins | `update` with `visibility` or `projectId`/`projectSlug` | | Change visibility, unpublish, delete | The author, workspace owners and admins | `visibility`, `unpublish`, `DELETE` | These are the same rules the dashboard follows. Anyone else who can read the document gets `403 forbidden`. A document you can't read, such as a teammate's private one or another workspace's, answers `404 not_found`. A slug finds any document you can read in the workspace you scope it to (the CLI sends its active workspace). Without `workspaceId` it looks only in your own workspaces, never another one's. A UUID works anywhere you have access. ## `POST /api/v1/posts/:postId/update` Publishes new content as the next version. The URL doesn't change unless the update also moves the document to another project. ### Request body ```json { "markdown": "# Q3 investor update\n\nRevenue grew 21% quarter over quarter.", "title": "Q3 investor update", "workspaceId": "ws_123", "tags": ["investors", "q3"], "sourcePath": "updates/q3-investor-update.md", "baseVersionNumber": 3 } ``` | Field | Required | Notes | | --- | --- | --- | | `markdown` | yes | 1 to 1,000,000 characters | | `workspaceId` | yes | Required by validation; the document's own workspace is always used | | `title` | no | 1 to 255 characters. Omit it to take the title from the Markdown again | | `visibility` | no | Omit to keep the current visibility. Changing it needs author, owner or admin | | `confirmPublic` | no | Must be `true` when `visibility` is `public` | | `tags` | no | Omit to keep the current tags. `[]` clears them. Up to 20 | | `projectId` / `projectSlug` | no | Move to this project in the same workspace. Needs author, owner or admin. A taken slug gets a `-2` suffix | | `sourcePath` | no | Up to 1024 characters | | `baseVersionNumber` | no | The version your copy came from. If the document has moved past it, nothing is written and you get `409 version_conflict` | Send `X-OpenDocs-Client` so the version records which agent made it. ### Response ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "versionId": "3c5e7a9b-1d2f-4a6c-8e0b-2d4f6a8c1e3b", "versionNumber": 4, "unchanged": false, "contentHash": "9a1e...", "slug": "q3-investor-update", "url": "/halvard/projects/investors/q3-investor-update", "publicUrl": "https://opendocs.cc/halvard/projects/investors/q3-investor-update", "title": "Q3 investor update", "visibility": "workspace", "tags": ["investors", "q3"], "projectId": "proj_456", "projectSlug": "investors", "projectName": "Investors", "isDefaultProject": false } ``` When the Markdown is byte-identical to the current version, `unchanged` is `true`, `versionNumber` stays the same and no version is created. Title, visibility, tag and project changes still apply. `publicUrl` is the full link to share, on the workspace's [custom domain](/publishing/custom-domains) when the domain is active (see [the publish response](/api-reference/publish#response)). ### Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Body failed validation (missing `markdown` or `workspaceId`, public without `confirmPublic`) | | `400` | `update_failed` | The document is unpublished ("Cannot update an unpublished post."), or the save failed | | `403` | `forbidden` | You aren't a member of its workspace, or you tried to change visibility or project without author, owner or admin rights | | `404` | `not_found` | No document matches, or you can't read it | | `404` | `project_not_found` | The target project doesn't exist in this workspace | | `409` | `version_conflict` | `baseVersionNumber` is behind the current version | ```json { "error": "version_conflict", "message": "The document is at version 4, but your copy is based on version 3. Pull the latest version and re-apply your changes, or retry with force to overwrite.", "currentVersionNumber": 4, "baseVersionNumber": 3, "currentVersionCreatedAt": "2026-10-14T08:30:00.000Z" } ``` ## `POST /api/v1/posts/:postId/unpublish` Takes the document offline. Its Markdown and versions are kept and its slot on Free is freed. The author, workspace owners and admins. ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "unpublished": true } ``` | Status | `error` | When | | --- | --- | --- | | `400` | `unpublish_failed` | Already unpublished, or the change failed. The message is "Unable to unpublish document." | | `403` | `forbidden` | You aren't the author, a workspace owner or an admin | | `404` | `not_found` | No document matches, or you can't read it | `update` doesn't work on an unpublished document. To bring one back, publish its Markdown again with [`POST /api/v1/publish`](/api-reference/publish), which creates a new document and counts against the Free cap. ## `POST /api/v1/posts/:postId/visibility` Changes visibility without new Markdown. The author, workspace owners and admins. ```json { "visibility": "public", "confirmPublic": true } ``` `visibility` is `private`, `workspace` or `public`. `confirmPublic: true` is required for `public`. A public document is visible outside the workspace only while the workspace allows public documents. ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "visibility": "public", "url": "/halvard/projects/investors/q3-investor-update", "publicUrl": "https://notes.halvard.example/projects/investors/q3-investor-update" } ``` `publicUrl` follows the new visibility: making a document public in a workspace with an active [custom domain](/publishing/custom-domains) returns the custom-domain link. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_visibility` | `visibility` isn't `private`, `workspace` or `public` | | `400` | `visibility_change_failed` | `public` without `confirmPublic: true` (message "Unable to change document visibility."), or the document is unpublished ("Cannot change visibility of an unpublished post.") | | `403` | `forbidden` | You aren't the author, a workspace owner or an admin | | `404` | `not_found` | No document matches, or you can't read it | ## `PATCH /api/v1/posts/:postId/tags` Adds and removes tags without resending the list. Any active member of the document's workspace. ```json { "add": ["board"], "remove": ["draft"] } ``` At least one of `add` or `remove` must be non-empty. Each takes up to 20 tags of 1 to 64 characters; tags are lowercased. A document can have at most 20. ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "tags": ["board", "investors", "q3"] } ``` | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Both lists empty, or bad types | | `400` | `tag_update_failed` | The result would have more than 20 tags | | `403` | `forbidden` | You aren't a member of the document's workspace | | `404` | `not_found` | No document matches, or you can't read it | ## `DELETE /api/v1/posts/:postId` Deletes the document, its versions and tags for good, frees the slug and, if it was published, its Free slot. The author, workspace owners and admins. This can't be undone. ```json { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "deleted": true, "slug": "q3-investor-update" } ``` | Status | `error` | When | | --- | --- | --- | | `400` | `delete_failed` | The delete failed. The message is "Unable to delete document." | | `403` | `forbidden` | You aren't the author, a workspace owner or an admin | | `404` | `not_found` | No document matches, or you can't read it | ## Related pages - [Posts endpoints](/api-reference/posts): list, get, raw - [Agent endpoints](/api-reference/agent-endpoints): version history, restore, move, share - [Publish endpoints](/api-reference/publish): new documents - [Errors and pagination](/api-reference/errors-and-pagination) --- URL: https://docs.opendocs.cc/api-reference/projects # Projects endpoints Projects group documents inside a workspace. Every workspace has a Default project, which can't be renamed or deleted. Default-project documents live at `/<workspace>/<slug>`; others at `/<workspace>/projects/<project>/<slug>`. All endpoints accept an API key or a session. | Action | Who | | --- | --- | | List, resolve | Any active member | | Create | Any active member | | Rename, change slug, delete | Owners and admins | ## The project record ```json { "id": "proj_456", "workspaceId": "ws_123", "name": "Investors", "slug": "investors", "isDefault": false } ``` Project slugs are 1 to 64 characters of lowercase letters, numbers and single hyphens. `tag`, `tags`, `project`, `projects`, `new`, `edit` and `settings` are reserved. ## `GET /api/v1/projects?workspaceId=...` Lists the workspace's projects, Default first, then by name. Each one carries enough for an agent to decide where a new document belongs: ```json { "projects": [ { "id": "proj_123", "workspaceId": "ws_123", "name": "Default", "slug": "default", "isDefault": true, "postCount": 14, "updatedAt": "2026-01-10T12:00:00.000Z", "recentTitles": ["Hiring plan 2027", "Office move checklist"], "lastPublishedAt": "2026-10-20T16:04:00.000Z" }, { "id": "proj_456", "workspaceId": "ws_123", "name": "Investors", "slug": "investors", "isDefault": false, "postCount": 6, "updatedAt": "2026-03-02T09:00:00.000Z", "recentTitles": ["Q3 investor update", "Q2 investor update", "Seed round memo"], "lastPublishedAt": "2026-10-12T10:00:00.000Z" } ], "defaultProject": { "id": "proj_123", "name": "Default", "slug": "default", "isDefault": true, "...": "..." } } ``` - `postCount` counts every document in the project, published or not. - `recentTitles` holds up to three of the most recently updated published titles you can read. - `lastPublishedAt` is when the newest of those was last updated, or `null`. ## `GET /api/v1/projects/default?workspaceId=...` ```json { "project": { "id": "proj_123", "workspaceId": "ws_123", "name": "Default", "slug": "default", "isDefault": true } } ``` ## `GET /api/v1/projects/resolve?workspaceId=...&projectSlug=...` Looks a project up by `projectSlug` or `projectId` (omit both for the Default project). Returns `{ "project": { ... } }`, or `404 not_found` when there's no match or you aren't a member. ## `POST /api/v1/projects` ```json { "workspaceId": "ws_123", "name": "Board", "slug": "board" } ``` | Field | Required | Notes | | --- | --- | --- | | `workspaceId` | yes | | | `name` | yes | 1 to 120 characters | | `slug` | no | Up to 64 characters. Without it, a slug is made from the name and suffixed (`board-2`) if taken or reserved | Status `201`: `{ "project": { ... } }`. An explicit `slug` that another project in the workspace already uses isn't suffixed; the request fails with `409 slug_taken`. Pick another slug or leave `slug` out. ## `PATCH /api/v1/projects/:projectId` Renames a project or changes its slug. Send at least one field. Changing the slug changes the URL of every document in the project. ```json { "name": "Board of directors", "slug": "board-of-directors" } ``` Returns `{ "project": { ... } }`. ## `DELETE /api/v1/projects/:projectId` Deletes an empty, non-default project. Move or delete its documents first. ```json { "deleted": true, "projectId": "proj_789" } ``` ## Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Missing `workspaceId` or `name`, or `PATCH` with neither field | | `400` | `invalid_slug` | The slug doesn't fit the rules above | | `400` | `reserved_slug` | A reserved project slug | | `400` | `default_project` | Renaming or deleting the Default project | | `400` | `project_not_empty` | Deleting a project that still has documents (`postCount` is included) | | `403` | `forbidden` | You aren't an active member, or you're a member trying to rename or delete | | `404` | `not_found` | No such project (rename, delete, resolve) | | `409` | `slug_taken` | Another project in the workspace has that slug (create with an explicit `slug`, or rename) | ## Using projects with documents `POST /publish` takes `projectId` or `projectSlug`. The list, get, raw, update, export and delete routes take `?projectId=` to scope a slug. Move a document with [`POST /posts/:postId/move`](/api-reference/agent-endpoints#moving-between-projects). ## Related pages - [Projects](/publishing/projects): how projects work - [Publish endpoints](/api-reference/publish) - [Agent endpoints](/api-reference/agent-endpoints) --- URL: https://docs.opendocs.cc/api-reference/exports # Export endpoints Render documents to **PDF** or **Word (.docx)** with the workspace's export theme. PDF works on every plan, with the workspace's logo, brand color and font. Word export and a custom footer need the workspace to be on Pro or Team; on Free, exports end with a "Made with OpenDocs" footer and a `branding` object in the request is ignored. That holds even when a workspace that moved back to Free still has its own footer saved from its paid plan; the footer is kept and applies again after an upgrade. Fenced `private` blocks are never part of an export. Both signed-in endpoints accept an API key or a session. ## `POST /api/v1/posts/:postId/export/:format` Exports one document. - `:postId` is the post's UUID or slug. Scope a slug with `?workspaceId=` and `?projectId=`. - `:format` is `pdf` or `docx`. Anything else returns `404 not_found`. - You can export any document you can read (see [Posts endpoints](/api-reference/posts)). - Rate limit: 120 a minute per account, and at most 4 exports running at once per account. ### Request body Every field is optional. An empty body exports with the workspace's theme. ```json { "filename": "q3-investor-update", "landscape": false, "accent_color": "#0B3D5C", "branding": { "main_font": "Inter" } } ``` | Field | Type | Notes | | --- | --- | --- | | `filename` | string | 1 to 120 characters, without the extension. Defaults to the slug. | | `landscape` | boolean | Landscape pages. Default `false`. | | `accent_color` | string | 6-digit hex, `#` optional. Overrides the brand color for this export. | | `branding` | object | Converter branding overrides, passed through. Pro and Team only (it can replace the footer); ignored on Free. | The workspace's theme applies first and the request body on top. Change the theme itself with [`PATCH /api/v1/workspace/branding`](/api-reference/agent-endpoints#export-theme) (API keys) or the dashboard's per-field routes: [brand color](/api-reference/workspaces#post-apiv1workspacebrand-color), [font](/api-reference/workspaces#post-apiv1workspaceexport-font) and [footer](/api-reference/workspaces#post-apiv1workspaceexport-footer). ### Response The file, with these headers: ```http Content-Type: application/pdf Content-Disposition: attachment; filename="q3-investor-update.pdf" X-Cache: HIT ``` Word files use `application/vnd.openxmlformats-officedocument.wordprocessingml.document`. `X-Cache` (`HIT` or `MISS`) is present only when the server's export cache is on. ### Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Body failed validation, for example a bad `accent_color` | | `403` | `docx_requires_pro` | Word export in a Free workspace | | `404` | `not_found` | No document you can read matches, or `:format` isn't `pdf` or `docx` | | `429` | `rate_limited` | Over 120 a minute, or 4 exports already running. Wait `Retry-After` seconds (2 for the concurrency limit) | | `502` | `export_failed` | The converter returned an error | | `504` | `export_timeout` | The converter didn't answer within 55 seconds | ## `POST /api/v1/posts/batch/export` Exports up to **10** documents in one request and returns a zip with every file that succeeded plus a `manifest.json` describing every entry. - 1 to 10 `postIds`, UUIDs or slugs, mixed freely. - Each entry resolves like the single-document route: any document you can read, including teammates' workspace documents. Slugs are scoped by `workspaceId` and `projectId`, or without them to your own workspaces. - Rate limit: 30 a minute per account (300 documents), sharing the 4 concurrent exports with the single-export route. - Documents are converted one after another. If the client disconnects, the server stops. ### Request body ```json { "postIds": ["q3-investor-update", "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "board-minutes-october"], "format": "pdf", "landscape": false, "workspaceId": "ws_123" } ``` | Field | Required | Notes | | --- | --- | --- | | `postIds` | yes | 1 to 10 UUIDs or slugs | | `format` | yes | `pdf` or `docx` | | `landscape` | no | Applies to every document | | `accent_color` | no | Applies to every document | | `branding` | no | Applies to every document. Pro and Team only | | `workspaceId` | no | Scope slugs to this workspace. Ignored for UUIDs | | `projectId` | no | Scope slugs to this project | ### Response Status `200`, even when some documents failed: ```http Content-Type: application/zip Content-Disposition: attachment; filename="opendocs-export-2026-10-24.zip" X-Batch-Manifest: eyJmb3JtYXQiOiJwZGYiLCJyZXN1bHRzIjpbey...= ``` ```text opendocs-export-2026-10-24.zip ├── manifest.json ├── q3-investor-update.pdf └── board-minutes-october.pdf ``` `manifest.json`: ```json { "format": "pdf", "results": [ { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "success": true, "slug": "q3-investor-update", "filename": "q3-investor-update.pdf", "bytes": 84213, "cached": false }, { "postId": "rollout-plan", "success": false, "error": "not_found", "message": "Document not found, or you can't read it." } ], "summary": { "total": 3, "succeeded": 2, "failed": 1, "cacheHits": 1, "cacheMisses": 1 } } ``` - A successful result's `postId` is always the UUID; a failed lookup echoes what you sent. - `cached` is `true` when the file came from the export cache. - `cacheHits` and `cacheMisses` appear only when the export cache is on. - `X-Batch-Manifest` is the same JSON, base64-encoded, so you can read results before opening the zip. Per-document errors in the manifest: | `error` | Meaning | | --- | --- | | `not_found` | No document you can read matches | | `docx_requires_pro` | Word export from a Free workspace | | `converter_failed` | The converter returned an error | | `converter_timeout` | The converter didn't answer in time | | `export_failed` | Any other failure | ### Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | More than 10 `postIds`, a bad `format`, a bad `accent_color` | | `429` | `rate_limited` | Over 30 a minute, or 4 exports already running. Wait `Retry-After` seconds | ## Caching Exports are cached by content: the Markdown, workspace, format, orientation and resolved branding. The same inputs return the same bytes without running the converter again. Cache writes happen after the response and never fail an export. ## Public download: `POST /api/v1/public/posts/:workspaceSlug/:postSlug/export/:format` Also `/api/v1/public/posts/:workspaceSlug/projects/:projectSlug/:postSlug/export/:format`. The "Download PDF / Word" buttons on a document page. No auth needed: anyone who can open the page can download it. With a key or session, your own and your workspaces' non-public documents work too. - Ignores the request body; the workspace's theme always applies. - Word needs the workspace owner on Pro or Team (`403 docx_requires_pro`). - Unpublished documents and anything you can't read return `404 not_found`. - Rate limit: 60 a minute per IP. - Same `502 export_failed` and `504 export_timeout` errors as above. ## Free converter: `POST /api/v1/tools/convert/pdf` and `/docx` The no-account converter behind opendocs.cc/tools. Multipart form with a `file` field (a `.md` or `.markdown` file, up to 2 MB; the tool pages send pasted text the same way). The output always uses the OpenDocs theme and the "Made with OpenDocs" footer; an optional `tool` field (the tool page's slug) tags the footer link. | Status | `error` | When | | --- | --- | --- | | `400` | `missing_file` | No `file` field | | `400` | `empty_file` | The file is blank or only whitespace | | `400` | `unsupported_mime` | The file isn't `.md` or `.markdown` | | `413` | `file_too_large` | The file is over 2 MB | | `429` | `rate_limited` | More than 5 a minute, 30 an hour or 100 a day per IP | | `502` | `conversion_failed` | The converter couldn't convert the file | | `503` | `service_busy` | More than 30 conversions a minute or 600 an hour across everyone; wait `Retry-After` seconds | ## Rate limits | Endpoint | Limit | | --- | --- | | `POST /posts/:postId/export/:format` | 120 a minute per account (shared with the integration routes that render files) | | `POST /posts/batch/export` | 30 a minute per account | | Both | 4 exports running at once per account | | Public download | 60 a minute per IP | | Free converter | 5 a minute, 30 an hour and 100 a day per IP; 30 a minute and 600 an hour across everyone | See [Errors and pagination](/api-reference/errors-and-pagination#rate-limits) for every bucket. ## Related pages - [Posts endpoints](/api-reference/posts): list, get, raw - [Agent endpoints](/api-reference/agent-endpoints#export-theme): read and change the export theme - [Integrations](/api-reference/integrations): save a PDF, Word or Markdown file to Google Drive - [Workspaces API](/api-reference/workspaces): per-field branding routes --- URL: https://docs.opendocs.cc/api-reference/integrations # Integrations API These endpoints save a document to a Google Drive folder and run DocuSeal signature requests: draft, confirm, send, track, download and file. They back the CLI's `opendocs integrations`, `opendocs save` and `opendocs sign` commands. For what the integrations do and how to set them up, see [Google Drive](/integrations/google-drive) and [DocuSeal](/integrations/docuseal). Connecting an integration, naming Drive folders and changing the workspace's integration settings happen in the dashboard (**Integrations** tab, owners and admins). There's no API for those. ## Access All endpoints accept an API key or a session. On top of that: | Requirement | Otherwise | | --- | --- | | The workspace is on Pro or Team | `403 plan_required` (includes `tier`) | | You're an active member of the workspace | `404 not_found` | | You may **use** integrations: owners and admins always; members unless the workspace limits integrations to admins | `403 forbidden` with `reason: "integrations_admins_only"` | | You can read the document (for saving and drafting) | `404 not_found` | `GET /integrations` only needs the first two, so a member can always see what's connected (`canUse` tells them whether they may use it). Signature requests belong to the workspace: anyone who may use integrations there can list, read, send, cancel and download any of its requests. Two workspace settings shape this: | Setting | Values | Effect | | --- | --- | --- | | `usableBy` | `members` (default), `admins` | Who may save documents and handle signature requests | | `signatureConfirmation` | `chat` (default), `browser` | Who may send a draft: an agent after the person says yes in chat, or only a person in the browser | **Rate limits.** Saving a document, drafting a signature request, downloading a request's PDFs and filing signed copies count toward the export limit (120 a minute per account, shared with [single exports](/api-reference/exports)). The other endpoints fall under the general limit. ## `GET /api/v1/integrations?workspaceId=...` What's connected, the Drive folders you can save to, your permissions and the workspace settings. ```json { "workspace": { "id": "ws_123", "slug": "halvard", "name": "Halvard" }, "tier": "pro", "role": "member", "canManage": false, "canUse": true, "settings": { "usableBy": "members", "signatureConfirmation": "chat" }, "dashboardUrl": "https://opendocs.cc/dashboard/integrations", "integrations": [ { "provider": "google_drive", "name": "Google Drive", "description": "Save documents as PDF, Word or Markdown into Drive folders you choose, including shared drives. Only when you ask.", "capabilities": ["storage"], "status": "connected", "account": "dana@halvard.example", "connectedAt": "2026-10-02T09:12:00.000Z", "destinations": [ { "id": "dst_1", "name": "Board Minutes", "folderName": "Board minutes 2026", "driveName": "Legal", "url": "https://drive.google.com/drive/folders/..." }, { "id": "dst_2", "name": "Signed Contracts", "folderName": "Contracts", "driveName": "Legal", "url": "https://drive.google.com/drive/folders/..." } ] }, { "provider": "docuseal", "name": "DocuSeal", "description": "Send documents for e-signature. Signers get an email from DocuSeal; the signed PDF and its audit log come back here.", "capabilities": ["signature"], "status": "connected", "account": "dana@halvard.example", "connectedAt": "2026-10-02T09:20:00.000Z", "region": "com" } ] } ``` - `status` is `connected`, `not_connected` or `error`. With `error`, an `error` string says why (for example, access was revoked) and an owner or admin needs to reconnect it at `dashboardUrl`. - `destinations` (Drive only) are the named folders. Pass a `name` (any case) or `id` as `destination` below. `folderName` and `driveName` are the real Drive folder and shared drive. Empty until Drive is connected. - `region` (DocuSeal only) is `com`, `eu` or `custom`, or `null` when not connected. - `canManage` is `true` for owners and admins. `canUse` is whether you may use integrations. - Credentials are never returned. | Status | `error` | When | | --- | --- | --- | | `400` | `missing_workspace_id` | No `workspaceId` | | `403` | `plan_required` | Free workspace | | `404` | `not_found` | You aren't a member | ## Save a document to Drive ### `POST /api/v1/posts/:postId/storage` Renders a document (the current version, or one you name) and uploads it to a named Drive folder. `:postId` is the post's UUID or slug. ```json { "workspaceId": "ws_123", "destination": "Board Minutes", "format": "pdf", "versionNumber": 4, "filename": "Board minutes, October 2026" } ``` | Field | Required | Notes | | --- | --- | --- | | `destination` | yes | A destination name (case-insensitive) or id, 1 to 200 characters | | `format` | no | `pdf` (default), `docx` or `md` | | `versionNumber` | no | Save this version instead of the current one | | `filename` | no | 1 to 180 characters. A trailing `.pdf`, `.docx` or `.md` is dropped and the right one added. Defaults to the document title | | `workspaceId` | no | Scopes a slug lookup. Ignored for UUIDs | PDF and Word files use the workspace's export theme. Every format leaves out the document's `private` blocks. Each upload is a new Drive file; nothing is overwritten. Status `201`: ```json { "id": "run_7f3a", "provider": "google_drive", "destination": { "id": "dst_1", "name": "Board Minutes", "url": "https://drive.google.com/drive/folders/..." }, "document": { "id": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "board-minutes-october", "title": "Board minutes, October", "versionNumber": 4 }, "file": { "id": "1AbC...", "name": "Board minutes, October 2026.pdf", "url": "https://drive.google.com/file/d/1AbC.../view", "bytes": 84213, "sha256": "4e1f...", "driveSha256": "4e1f...", "verified": true, "format": "pdf" } } ``` `id` is the run recorded in the workspace's integration log. `sha256` is the hash of the bytes OpenDocs sent; `verified` is `false` only if Drive reported a different checksum. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Missing `destination`, bad `format` | | `403` | `plan_required`, `forbidden` | See [Access](#access) | | `404` | `not_found` | No document (or version) you can read | | `404` | `destination_not_found` | No folder by that name. Includes `destination` and `destinations` (the names you can use) | | `409` | `integration_not_connected` | Google Drive isn't connected (`provider: "google_drive"`) | | `409` | `reconnect_required` | Drive access was revoked or expired; an owner or admin must reconnect it | | `409` | `destination_unavailable` | Drive refused the folder (deleted, or the account lost access). Pick it again in the dashboard | | `502` | `export_failed` | The converter couldn't render the PDF or Word file | | `502` | `storage_failed` | The upload failed | | `504` | `export_timeout` | The converter didn't answer within 55 seconds | ## Signature requests A signature request goes through these states: | `status` | Meaning | | --- | --- | | `draft` | Created, nothing sent. The exact PDF is stored with its SHA-256 | | `pending` | Sent to DocuSeal; signers are being emailed in order | | `completed` | Everyone signed. The signed PDF and audit log are available | | `declined` | A signer declined | | `expired` | It passed `expiresAt` | | `cancelled` | Cancelled in OpenDocs | While a send is in progress the status is briefly `sending`. If DocuSeal rejects a send, the request goes back to `draft` with the reason in `lastError`. OpenDocs refreshes a pending request from DocuSeal when you read it (at most every 30 seconds) and when DocuSeal's webhook fires. When a request with `fileTo` completes, the signed PDF and audit log are saved to that Drive folder automatically and recorded in `filed`. ### The signature request object ```json { "id": "6b8d0f2a-4c6e-4a8b-9d0f-1a3c5e7b9d2f", "workspaceId": "ws_123", "status": "draft", "provider": "docuseal", "document": { "postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f", "slug": "engagement-letter-northwind", "title": "Engagement letter: Northwind", "versionNumber": 2, "sha256": "b7c1...", "fileName": "Engagement letter Northwind (v2).pdf" }, "signers": [ { "name": "Dana Reyes", "email": "dana@halvard.example", "role": "Halvard", "order": 1, "status": "draft" }, { "name": "Priya Nair", "email": "priya@northwind.example", "role": "Client", "order": 2, "status": "draft" } ], "order": "sequential", "message": { "subject": "Engagement letter for your signature" }, "expiresAt": "2026-11-30T23:59:59.000Z", "fileTo": { "id": "dst_2", "name": "Signed Contracts" }, "confirmation": { "mode": "chat", "approveUrl": "https://opendocs.cc/dashboard/integrations/signatures/6b8d0f2a-4c6e-4a8b-9d0f-1a3c5e7b9d2f" }, "sentAt": null, "confirmedVia": null, "completedAt": null, "filed": null, "lastError": null, "createdAt": "2026-10-24T14:02:00.000Z" } ``` - `signers[].status` is `draft`, `sent`, `awaiting`, `opened`, `completed` or `declined`. Signed and declined signers also carry `completedAt` or `declineReason`. - `signers[].order` is 1, 2, 3... for `sequential` requests and 1 for everyone in `parallel` ones. - `confirmation.mode` is the workspace's `signatureConfirmation` setting. `approveUrl` is the page where a person can review and send the draft. - `confirmedVia` is `chat` (sent with an API key) or `browser` (sent from a session) once sent. - `filed` is `{ "destination": { "id", "name" }, "files": [{ "kind", "name", "url", "sha256" }], "at" }` after the signed copies were saved to Drive. ### `POST /api/v1/posts/:postId/signature-requests` Creates a **draft**. Nothing reaches a signer until you [send it](#post-apiv1signature-requestsidsend). ```json { "workspaceId": "ws_123", "signers": [ { "name": "Dana Reyes", "email": "dana@halvard.example", "role": "Halvard" }, { "name": "Priya Nair", "email": "priya@northwind.example", "role": "Client" } ], "order": "sequential", "message": { "subject": "Engagement letter for your signature", "body": "Hi Priya, here's the engagement letter we discussed." }, "expiresAt": "2026-11-30", "fileTo": "Signed Contracts", "versionNumber": 2 } ``` | Field | Required | Notes | | --- | --- | --- | | `signers` | yes | 1 to 10. `name` 1 to 120 characters, `email` a valid address (lowercased), optional `role` up to 60 characters | | `order` | no | `sequential` (default: one after another, in the order given) or `parallel` | | `message` | no | Email `subject` (up to 200 characters) and `body` (up to 4,000). Longer is refused with `400 invalid_request` | | `expiresAt` | no | ISO 8601 date or date-time, at least an hour from now. A date alone means 23:59:59 UTC that day | | `fileTo` | no | A Drive destination name or id. The signed PDF and audit log are saved there on completion | | `versionNumber` | no | Sign this version instead of the current one | | `workspaceId` | no | Scopes a slug lookup. Ignored for UUIDs | The document is rendered to PDF with the workspace's theme and a signing field in each signature box: - If the Markdown has no ` ```signature ` block, one is appended with a box per signer. Roles are the ones you gave, or `Signer 1`, `Signer 2`, and so on. - If it has one, every role in the block needs exactly one signer, matched by `role` (case-insensitive) or else by the `name` written in the block. Status `201`: the signature request object plus `warnings`, a list of messages for signers whose email domain isn't one of the workspace members' domains. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | No signers, more than 10, or a field too long (a `message.body` over 4,000 characters, for example) | | `400` | `invalid_signers` | A bad email address, or a role that's repeated or uses `;`, `{`, `}` or `=` | | `400` | `signer_roles_mismatch` | Signers don't match the document's signature block. Includes `roles` | | `400` | `invalid_expiry` | `expiresAt` isn't a date, or is less than an hour away | | `403` | `plan_required`, `forbidden` | See [Access](#access) | | `404` | `not_found` | No document (or version) you can read | | `404` | `destination_not_found` | `fileTo` doesn't name a Drive folder. Includes `destinations` | | `409` | `integration_not_connected` | DocuSeal isn't connected (`provider: "docuseal"`) | | `409` | `reconnect_required` | DocuSeal rejected the stored API key; an owner or admin must reconnect it | | `502` | `export_failed` | The converter couldn't render the draft PDF | | `504` | `export_timeout` | The converter didn't answer within 55 seconds | ### `GET /api/v1/signature-requests?workspaceId=...` The workspace's requests, newest first, up to 50. | Query | Required | Notes | | --- | --- | --- | | `workspaceId` | yes | | | `post` | no | Only requests for this document (UUID or slug). `postId` works too | | `status` | no | Only this status | Returns `{ "requests": [ ... ] }`. Errors: `400 missing_workspace_id`, `403 plan_required`, `403 forbidden`, `404 not_found` (not a member, or no document matches `post`). ### `GET /api/v1/signature-requests/:id` One request, refreshed from DocuSeal if it's pending. Returns the signature request object. A request you can't use (another workspace, or integrations limited to admins) returns `404 not_found`; a Free workspace returns `403 plan_required`. ### `POST /api/v1/signature-requests/:id/send` Sends a draft to the signers through DocuSeal. The body must be exactly: ```json { "confirm": true } ``` Send it only after a person has reviewed the document, version, every signer's name and email, and the order, and said yes. An agent should read those back in chat first. - In a `chat` workspace, an API key or a session may send. - In a `browser` workspace, only a signed-in person can send. An API key gets `403 approval_required` with an `approveUrl` to give the person; they review and send it on that page. - Each draft can be sent once. Returns the signature request object with `status: "pending"`, `sentAt` and `confirmedVia`. After sending, OpenDocs keeps only the PDF's hash; DocuSeal holds the document. | Status | `error` | When | | --- | --- | --- | | `400` | `confirmation_required` | The body isn't `{"confirm": true}` | | `403` | `approval_required` | Browser-confirm workspace and an API key. Includes `approveUrl` | | `403` | `plan_required`, `forbidden` | See [Access](#access) | | `404` | `not_found` | No such request, or not in a workspace you're a member of | | `409` | `already_sent` | It isn't a draft any more. Includes `status` | | `409` | `integration_not_connected`, `reconnect_required` | DocuSeal isn't connected, or its key stopped working | | `502` | `send_failed` | DocuSeal didn't accept it (the request stays a draft, with `lastError`), or the draft's PDF is missing | ### `DELETE /api/v1/signature-requests/:id` Cancels a request. A pending one is archived in DocuSeal, so signers can no longer sign; a draft is discarded. Cancelling an already cancelled request returns it unchanged. Returns the signature request object with `status: "cancelled"`. | Status | `error` | When | | --- | --- | --- | | `403` | `plan_required`, `forbidden` | See [Access](#access) | | `404` | `not_found` | No such request, or you aren't a member | | `409` | `already_completed` | Everyone already signed | | `502` | `cancel_failed` | DocuSeal didn't cancel it | ### `GET /api/v1/signature-requests/:id/documents/:kind` Downloads a PDF. `:kind` is: - `draft`: the exact PDF the draft will send (its SHA-256 is `document.sha256`). Available until the request is sent. - `signed`: the signed PDF. Needs `status: "completed"`. - `audit`: DocuSeal's audit log (certificate of signature). Needs `status: "completed"`. The response is `application/pdf` with `Cache-Control: private, no-store` and a `Content-Disposition` filename such as `Engagement letter Northwind (v2) – signed.pdf` (also given as RFC 5987 `filename*`). | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_kind` | `:kind` isn't `draft`, `signed` or `audit` | | `403` | `plan_required`, `forbidden` | See [Access](#access) | | `404` | `not_found` | No such request, or you aren't a member | | `404` | `not_available` | The draft PDF is gone (already sent), or DocuSeal doesn't have the file yet | | `409` | `not_completed` | `signed` or `audit` before everyone signed. Includes `status` | | `409` | `integration_not_connected` | DocuSeal was disconnected | | `502` | `provider_failed` | DocuSeal didn't respond as expected | ### `POST /api/v1/signature-requests/:id/storage` Saves the signed PDF and the audit log of a completed request to a Drive folder as two new files, and marks them read-only in Drive (`locked` is `false` if Drive didn't allow it). Use it when the request had no `fileTo`, or to file another copy. ```json { "destination": "Signed Contracts" } ``` Status `201`: ```json { "destination": { "id": "dst_2", "name": "Signed Contracts" }, "files": [ { "kind": "signed", "id": "1XyZ...", "name": "Engagement letter Northwind (v2) – signed.pdf", "url": "https://drive.google.com/file/d/1XyZ.../view", "bytes": 120934, "sha256": "c0d2...", "driveSha256": "c0d2...", "verified": true, "locked": true }, { "kind": "audit", "id": "1QrS...", "name": "Engagement letter Northwind (v2) – audit log.pdf", "url": "https://drive.google.com/file/d/1QrS.../view", "bytes": 40211, "sha256": "9e4b...", "driveSha256": "9e4b...", "verified": true, "locked": true } ] } ``` Errors: `not_completed` (409), `destination_not_found` (404), `integration_not_connected`, `reconnect_required` and `destination_unavailable` (409), `not_available` (404), `provider_failed` and `storage_failed` (502), plus the [access](#access) errors. ## DocuSeal webhook `POST /api/v1/integrations/docuseal/webhook/:integrationId?token=<token>` Not for API clients: DocuSeal calls it when a submission changes. The URL, with its token, is shown in the dashboard when you connect DocuSeal, and you paste it into DocuSeal's webhook settings. If you also save DocuSeal's signing secret, the `X-DocuSeal-Signature` header is verified too. A webhook never changes a request by itself; it only makes OpenDocs refresh the request from DocuSeal's API. Responses: `200 { "ok": true, "synced": "<request id or null>" }`, `401 unauthorized` (wrong token or signature), `404 not_found` (unknown integration), `400 invalid_payload`. Bodies are limited to 1 MB. ## Other errors | Status | `error` | When | | --- | --- | --- | | `503` | `integrations_not_configured` | The server has no integrations encryption key (self-hosted setups) | Every error has the usual `error`, `message` and `docs_url` fields; the message says what to do next and, when a person has to act, links to the dashboard. See [Error codes](/errors). ## Related pages - [Google Drive](/integrations/google-drive) and [DocuSeal](/integrations/docuseal): what they do and how to connect them - [Export endpoints](/api-reference/exports): PDF and Word downloads - [Plans and limits](/getting-started/plans-and-limits): integrations are on Pro and Team --- URL: https://docs.opendocs.cc/api-reference/workspaces # Workspaces API The workspace is the sharing boundary and the first segment of every document URL: `opendocs.cc/<workspace-slug>/<post-slug>`. Team members and invitations are on [their own page](/api-reference/team-and-invitations). ## Auth | Accepts an API key | Session only | | --- | --- | | `GET /workspaces`, `POST /workspaces`, `POST /workspace/logo`, `POST /workspace/logo/upload`, `GET` and `PATCH /workspace/branding`, the [custom domain](#custom-domain) routes | Everything else on this page | A session-only route answers an API key with `401 unauthorized`. Agents change the export theme through `PATCH /workspace/branding`, described under [Export theme](/api-reference/agent-endpoints#export-theme). All routes fall under the general rate limit (600 requests a minute per IP). ## Who can change what | Setting | Who | | --- | --- | | Name, slug, bio, logo | Owners and admins | | Brand color, export font, logo in exports | Owners and admins, any plan | | Export footer | Owners and admins, on Pro or Team (`403 plan_required` on Free, whose exports keep the "Made with OpenDocs" footer) | | Custom domain | Owners and admins, on Pro or Team (`403 plan_required` on Free). Members can read it | | Allow public documents, default sort, delete the workspace | The owner only | ## The workspace record `GET /api/v1/workspace` returns this shape: ```json { "id": "ws_123", "name": "Halvard", "slug": "halvard", "plan": "free", "defaultVisibility": "workspace", "defaultSort": "recently-updated", "allowPublicDocuments": true, "bio": "Internal docs for Halvard.", "brandColor": "#13294B", "logoUrl": "https://cdn.opendocs.cc/logos/ws_123.png", "showLogoInExports": true, "exportFontMain": "IBM Plex Sans", "exportFooterEnabled": true, "exportFooterCompanyName": "Halvard", "exportFooterTagline": "Board and investor reporting", "exportFooterLinkUrl": "https://halvard.example", "exportFooterLinkLabel": "halvard.example", "ownerUserId": "usr_123", "role": "owner" } ``` `role` is your role (`owner`, `admin` or `member`). Unset fields are `null`. `plan` is the stored value. The plan that decides features is Team when that's stored, otherwise the owner's billing plan; read it from [`GET /me`](/api-reference/me) (`quota.documents.plan`) or [`GET /workspace/branding`](/api-reference/agent-endpoints#export-theme) (`tier`). ## `GET /api/v1/workspaces` **Accepts an API key.** Every workspace you're an active member of, in the order you joined them. The CLI uses it for `opendocs workspace list` and `opendocs workspace use <slug>`. ```json { "workspaces": [ { "id": "ws_123", "name": "Halvard", "slug": "halvard", "role": "owner" }, { "id": "ws_456", "name": "Halvard Labs", "slug": "halvard-labs", "role": "member" } ] } ``` Pending invitations aren't included. With no memberships you get `{ "workspaces": [] }`. ## `POST /api/v1/workspaces` **Accepts an API key.** Creates a workspace you own, with a Default project (`opendocs workspace create`). ```json { "name": "Halvard Labs", "slug": "halvard-labs" } ``` | Field | Required | Notes | | --- | --- | --- | | `name` | yes | 2 to 120 characters | | `slug` | no | 3 to 32 characters, lowercase `a-z 0-9 _ -`. Made from the name when omitted | Status `201`: ```json { "workspace": { "id": "ws_456", "name": "Halvard Labs", "slug": "halvard-labs", "role": "owner" }, "defaultProject": { "id": "proj_901", "workspaceId": "ws_456", "name": "Default", "slug": "default", "isDefault": true } } ``` How many workspaces you can own depends on your plan: 1 on Free, 2 on Pro (plus paid add-ons), unlimited on Team. See [Plans and limits](/getting-started/plans-and-limits). | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | `name` or `slug` length out of range | | `400` | `invalid_slug` | The slug has characters other than `a-z 0-9 _ -` | | `400` | `reserved_slug` | The slug is reserved (`docs`, `pricing`, `integrations` and others) | | `403` | `plan_limit` | You own as many workspaces as your plan allows. Includes `plan` and `limit` | | `409` | `slug_taken` | Another workspace has the slug | ## `GET /api/v1/workspace` **Session only.** One workspace's settings, as `{ "workspace": { ... } }`. | Query | Required | Notes | | --- | --- | --- | | `workspaceId` | no | Which workspace. Without it you get your earliest-joined active membership, the one the CLI picks at login; pass it if you have several. | `workspace` is `null` when you aren't an active member. ## `POST /api/v1/workspace` **Session only.** Renames the workspace. Owners and admins. ```json { "workspaceId": "ws_123", "name": "Halvard Group" } ``` `name` is 2 to 120 characters. Returns `{ "name": "Halvard Group" }`. ## `DELETE /api/v1/workspace` **Session only.** Deletes a workspace and everything in it. The owner only, and not your last workspace. ```json { "workspaceId": "ws_456", "confirmSlug": "halvard-labs" } ``` `confirmSlug` must equal the workspace's slug. ```json { "success": true, "deletedWorkspaceId": "ws_456", "nextWorkspaceId": "ws_123" } ``` | Status | `error` | When | | --- | --- | --- | | `400` | `confirmation_mismatch` | `confirmSlug` doesn't match | | `403` | `forbidden` | You aren't the owner | | `404` | `not_found` | No such workspace | | `409` | `last_workspace` | It's your only workspace | ## `GET /api/v1/workspaces/current` **Session only.** The workspace the onboarding flow reads: `{ "workspace": { "id", "name", "slug", "defaultVisibility", "defaultProject" } }`, or `{ "workspace": null }`. Agents should use [`GET /api/v1/me`](/api-reference/me). ## `GET /api/v1/workspace/check-slug` **Session only.** Availability check for the slug picker. See [Usernames and workspace slugs](/api-reference/usernames#get-apiv1workspacecheck-slug) for the response. ## `POST /api/v1/workspace/slug` **Session only.** Changes the workspace slug. Owners and admins. Every document URL under `/<old-slug>/` stops working; old slugs aren't redirected. ```json { "workspaceId": "ws_123", "slug": "halvard-group" } ``` Returns `{ "slug": "halvard-group" }`. Sending the current slug returns `200` with `{ "slug": "...", "unchanged": true }`. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | `slug` shorter than 3 or longer than 32 characters | | `400` | `invalid_slug` | Characters other than `a-z 0-9 _ -` | | `400` | `reserved_slug` | A reserved slug | | `403` | `forbidden` | You aren't an owner or admin | | `404` | `not_found` | No such workspace | | `409` | `slug_taken` | Another workspace has it | ## Branding These per-field routes back the dashboard's settings page and are session only. Agents use [`PATCH /workspace/branding`](/api-reference/agent-endpoints#export-theme), which takes presets and checks contrast. ### `POST /api/v1/workspace/brand-color` Any plan. Owners and admins. ```json { "workspaceId": "ws_123", "color": "#13294B" } ``` `color` is `#` plus 6 hex digits. Returns `{ "brandColor": "#13294B" }`. This route doesn't check contrast; `PATCH /workspace/branding` does. ### `POST /api/v1/workspace/logo` **Accepts an API key.** Owners and admins, any plan. Sets the logo to a URL, or clears it. ```json { "workspaceId": "ws_123", "logoUrl": "https://halvard.example/logo.png" } ``` `logoUrl` must be a URL or `null`. Returns `{ "logoUrl": "..." }`. ### `POST /api/v1/workspace/logo/upload` **Accepts an API key.** Owners and admins, any plan. Multipart upload that stores the image and sets `logoUrl`. - Form field `file`: the image - Form field `workspaceId`: required - Up to 2 MB; JPEG, PNG, WebP, GIF or SVG ```json { "logoUrl": "https://cdn.opendocs.cc/logos/ws_123.png", "workspace": { "logoUrl": "https://cdn.opendocs.cc/logos/ws_123.png" } } ``` | Status | `error` | When | | --- | --- | --- | | `400` | `missing_workspace_id` | No `workspaceId` form field | | `400` | `missing_file` | No `file` field | | `400` | `unsupported_mime` | Not JPEG, PNG, WebP, GIF or SVG | | `403` | `forbidden` | You aren't an owner or admin | | `413` | `file_too_large` | Over 2 MB | | `503` | `storage_not_configured` | Object storage isn't set up on this server | ### `POST /api/v1/workspace/logo-in-exports` Any plan. Owners and admins. Whether exports show the logo. ```json { "workspaceId": "ws_123", "show": true } ``` Returns `{ "showLogoInExports": true }`. ### `POST /api/v1/workspace/bio` Owners and admins. The description on the workspace's public page. ```json { "workspaceId": "ws_123", "bio": "Board and investor reporting for Halvard." } ``` Up to 500 characters, or `null` to clear. Returns `{ "bio": "..." }`. ## Export customization ### `POST /api/v1/workspace/export-font` Any plan. Owners and admins. ```json { "workspaceId": "ws_123", "font": "Inter" } ``` `null` resets to the default, Arial. Allowed values: - Sans-serif: `Arial`, `Inter`, `IBM Plex Sans`, `Lato`, `Roboto`, `Manrope` - Serif: `Merriweather`, `Vollkorn`, `EB Garamond` - Monospace: `JetBrains Mono` An unknown font fails validation with `400 invalid_request` (`font: Unknown font.`). Returns `{ "font": "Inter" }`. ### `POST /api/v1/workspace/export-footer` Pro and Team. Owners and admins. The footer line on exports. ```json { "workspaceId": "ws_123", "enabled": true, "companyName": "Halvard", "tagline": "Board and investor reporting", "linkUrl": "halvard.example", "linkLabel": "halvard.example" } ``` - `enabled` (required) turns the footer on or off. - `companyName`, `tagline`, `linkLabel`: up to 120 characters each; `null` or omitted for none. - `linkUrl`: a URL up to 2048 characters. Without a scheme, `https://` is added. This route replaces all footer fields at once. Returns the stored values as `exportFooterEnabled`, `exportFooterCompanyName`, `exportFooterTagline`, `exportFooterLinkUrl` and `exportFooterLinkLabel`. ## Workspace settings ### `POST /api/v1/workspace/public-documents` The owner only. Turns `public` visibility on or off for the whole workspace. ```json { "workspaceId": "ws_123", "allowed": false } ``` While it's off, `public` documents are visible only to workspace members (and people they're shared with), and public download links stop working. Turning it back on restores them. Returns `{ "allowPublicDocuments": false }`. ### `POST /api/v1/workspace/default-sort` The owner only. How the workspace's public page orders documents. ```json { "workspaceId": "ws_123", "value": "recently-updated" } ``` `value` is `recently-updated`, `recently-added`, `title-asc` or `title-desc`. Returns `{ "defaultSort": "recently-updated" }`. ## Custom domain A workspace's own domain for its reader pages, such as `notes.halvard.example`. Pro and Team, one per workspace. **These routes accept an API key.** How it works for readers, and the DNS side, are in [Custom domains](/publishing/custom-domains). ### The domain record `GET`, `PUT` and `POST /check` return the same shape: ```json { "domain": { "id": "7f2c...", "workspaceId": "ws_123", "hostname": "notes.halvard.example", "kind": "subdomain", "status": "active", "state": "active", "serving": true, "url": "https://notes.halvard.example", "records": [ { "type": "CNAME", "name": "notes.halvard.example", "host": "notes", "value": "custom.opendocs.cc", "purpose": "routing", "check": "ok" }, { "type": "TXT", "name": "_opendocs.notes.halvard.example", "host": "_opendocs.notes", "value": "opendocs-verify=Xq3v9...", "purpose": "verification", "check": "ok" } ], "lastError": null, "consecutiveFailures": 0, "verifiedAt": "2026-10-20T09:12:00.000Z", "lastCheckedAt": "2026-10-25T03:12:00.000Z", "failingSince": null, "createdAt": "2026-10-20T09:10:00.000Z" }, "plan": { "tier": "pro", "allowed": true } } ``` - `domain` is `null` when the workspace has none. `plan.allowed` says whether the workspace's plan includes custom domains. - `kind` is `subdomain`. (`apex` exists for servers set up for root domains; opendocs.cc connects subdomains only and answers `invalid_hostname` with `reason: "apex_unsupported"` for a root domain.) - `showPoweredBy` says whether the domain's footer shows "Published with OpenDocs". Change it with `PATCH /api/v1/workspace/domain` `{ "workspaceId", "showPoweredBy" }` (owners and admins, Pro or Team). - `status` is the DNS status as stored: `pending`, `active` or `misconfigured` (three scheduled checks in a row failed). - `state` is what the dashboard shows: `pending` (waiting for DNS), `verifying` (records found in the last 10 minutes; the certificate is issued on the first visit), `active`, `misconfigured`, or `paused` when the plan doesn't include custom domains. - `serving` is true when the domain serves the workspace's pages right now. - `records[].name` is the full name; `host` is the same name relative to the domain, for providers that ask for that. `check` is the last check's result for the record: `ok`, `missing`, `mismatch`, `conflict`, `proxied`, `error`, or `null` before the first check. - `lastError` is `null`, or `{ "code", "message" }` with the first record that failed: `txt_missing`, `txt_mismatch`, `txt_conflict`, `target_missing`, `target_mismatch`, `cloudflare_proxied`, `ipv6_mismatch`, `dns_error` or `domain_taken`. `message` says what to change. - `failingSince` is when the current run of failed checks began. ### `GET /api/v1/workspace/domain` Any member. `?workspaceId=` is required. ### `PUT /api/v1/workspace/domain` Owners and admins, on Pro or Team. Connects a domain or replaces the workspace's current one, then checks its records straight away. ```json { "workspaceId": "ws_123", "hostname": "notes.halvard.example" } ``` `hostname` may be pasted as a URL (`https://notes.halvard.example/`); only the name is kept, lowercased, with non-ASCII names in punycode. Sending the same hostname again keeps its verification token and re-checks. A different hostname replaces the domain, with a new token, and ends sign-ins on the old one. ### `POST /api/v1/workspace/domain/check` Owners and admins. Checks the records now. ```json { "workspaceId": "ws_123" } ``` Limited to 12 checks a minute per account. A failed check on an active domain is reported in `lastError` but doesn't count toward the three failures that stop it serving; only the background check every 6 hours does. ### `DELETE /api/v1/workspace/domain` Owners and admins. `?workspaceId=` is required. Stops serving the domain and ends sign-ins on it. ```json { "removed": true, "hostname": "notes.halvard.example" } ``` `removed` is `false` (and `hostname` `null`) when there was no domain. ### Errors | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | `workspaceId` or `hostname` missing | | `400` | `invalid_hostname` | Not a domain OpenDocs can serve. Includes `reason`: `empty`, `invalid`, `ip_address`, `too_long`, `single_label`, `reserved`, `opendocs` or `apex_unsupported` | | `403` | `forbidden` | You're a member, not an owner or admin | | `403` | `plan_required` | The workspace is on Free. Includes `tier` | | `404` | `not_found` | You aren't a member of the workspace | | `409` | `domain_taken` | Another workspace has the domain active | | `429` | `rate_limited` | More than 12 checks a minute | ## Common errors | Status | `error` | Meaning | | --- | --- | --- | | `400` | `invalid_request` | Body failed validation, often a missing `workspaceId` | | `401` | `unauthorized` | No session (or an API key on a session-only route) | | `403` | `forbidden` | Not a member, or your role can't make this change | | `403` | `plan_required` | The export footer or a custom domain on a Free workspace. Includes `tier` | ## Related pages - [Team and invitations API](/api-reference/team-and-invitations) - [Agent endpoints](/api-reference/agent-endpoints#export-theme): the export theme API for agents - [Usernames and workspace slugs](/api-reference/usernames) - [Plans and limits](/getting-started/plans-and-limits) - [Custom domains](/publishing/custom-domains) - [Onboarding and profile](/api-reference/onboarding-and-profile) --- URL: https://docs.opendocs.cc/api-reference/team-and-invitations # Team and invitations API Membership is how sharing works: every active member of a workspace can read its `workspace` and `public` documents and edit any of them. These are the admin-side endpoints. The invitee's side (your own invitations, leaving a workspace, joining by email domain) is under [Agent endpoints](/api-reference/agent-endpoints#team-invitations-from-the-invitees-side-leaving-and-auto-join). All endpoints accept an API key or a session, except `GET /workspace/team/stats` (session only). They fall under the general rate limit (600 requests a minute per IP). ## Roles | Role | What it adds | | --- | --- | | `member` | Publish documents, edit any document in the workspace (new versions, tags, restoring a version), create projects, use integrations (unless the workspace limits them to admins). Visibility, moving, sharing, unpublishing and deleting stay with each document's author or an admin. | | `admin` | Rename the workspace and change its slug, branding and logo; invite, re-role and remove members; rename and delete projects; connect and manage integrations; change the visibility of, move, share, unpublish or delete any document. Can't remove or demote another admin, or touch the owner. | | `owner` | Everything, plus: remove or demote admins, allow or block public documents, set the default sort, delete the workspace. One per workspace. | Every edit is a new version and the history records who made it, so any change can be rolled back. The person who creates a workspace is its owner. Everyone else joins through an invitation or an auto-join email domain. Roles work the same on every plan. ## Member caps | Plan | Members per workspace | | --- | --- | | Free | 3 | | Pro | 5 | | Team | Unlimited | On Free and Pro, active members **plus pending invitations** count toward the cap, so inviting is refused once they reach it (`403 member_limit`). On Team there's no cap in the app: when someone joins, OpenDocs counts unique active members across every workspace the subscriber owns and updates the Team seat quantity first. If billing can't be updated, joining fails with `402 billing_failed`. See [Plans and limits](/getting-started/plans-and-limits). :::info `workspaceId` is required The list routes take `?workspaceId=` (missing: `400 missing_workspace_id`). `POST /workspace/team/invite` takes it in the body. You must be an active member of that workspace (`403 forbidden` otherwise). The routes with an `:id` work from the member or invitation id. ::: ## `GET /api/v1/workspace/team?workspaceId=...` Active members, in the order they joined. Any member can call it. ```json { "members": [ { "id": "mem_1", "userId": "usr_123", "name": "Dana Reyes", "email": "dana@halvard.example", "image": "https://cdn.opendocs.cc/avatars/usr_123.png", "role": "owner", "joinedAt": "2026-01-10T12:00:00.000Z" }, { "id": "mem_2", "userId": "usr_456", "name": "Sam Okafor", "email": "sam@halvard.example", "image": null, "role": "admin", "joinedAt": "2026-02-14T09:30:00.000Z" } ] } ``` `id` is the membership id used by the role and remove routes. ## `GET /api/v1/workspace/team/stats?workspaceId=...` **Session only.** Counts for the dashboard badge. ```json { "totalMembers": 3, "pendingInvites": 1, "admins": 2 } ``` `admins` counts owners and admins. ## `GET /api/v1/workspace/team/invitations?workspaceId=...` Pending, unexpired invitations. Owners and admins; members get `403 forbidden`. ```json { "invitations": [ { "id": "inv_1", "email": "lee@halvard.example", "role": "member", "invitedAt": "2026-10-01T10:15:00.000Z", "invitedByName": "Dana Reyes" } ] } ``` ## `POST /api/v1/workspace/team/invite` Sends an invitation email (`opendocs invite`). Owners and admins. ```json { "workspaceId": "3f1c9a52-7d4e-4b8a-9c21-5e6f0a7b8c9d", "email": "lee@halvard.example", "role": "member" } ``` | Field | Required | Notes | | --- | --- | --- | | `workspaceId` | yes | The workspace's UUID | | `email` | yes | Up to 320 characters | | `role` | yes | `admin` or `member` | Status `201`: ```json { "invitation": { "id": "inv_1", "email": "lee@halvard.example", "role": "member", "invitedAt": "2026-10-24T10:15:00.000Z", "invitedByName": "Dana Reyes" } } ``` The invitation expires after 7 days. | Status | `error` | When | | --- | --- | --- | | `400` | `invalid_request` | Missing field, bad email, `role` not `admin`/`member`, `workspaceId` not a UUID | | `400` | `invite_limit` | The workspace already has 50 pending invitations | | `403` | `forbidden` | You aren't an owner or admin of `workspaceId` | | `403` | `member_limit` | Members plus pending invitations are at the plan's cap. Includes `plan` and `limit` | | `409` | `already_member` | That email is already an active member | | `409` | `already_invited` | A pending invitation for that email exists | ## `POST /api/v1/workspace/team/invitations/:id/resend` Sends the email again and resets the expiry to 7 days from now. Owners and admins. Returns `{ "success": true }`. Errors: `403 forbidden`, `404 not_found`. ## `DELETE /api/v1/workspace/team/invitations/:id` Cancels a pending invitation; its link stops working. Owners and admins. Returns `{ "success": true }`. Errors: `403 forbidden`, `404 not_found`. ## `POST /api/v1/workspace/team/accept-invite` Accepts an invitation by the token in its email link (`/invite/<token>`). For accepting by id without the link, see [Agent endpoints](/api-reference/agent-endpoints#team-invitations-from-the-invitees-side-leaving-and-auto-join). ```json { "token": "<token from the invitation link>" } ``` ```json { "workspaceId": "ws_123", "role": "member" } ``` If you're already a member, the invitation is cleaned up and you get the same `200` response. | Status | `error` | When | | --- | --- | --- | | `402` | `billing_failed` | A Team seat had to be added and billing couldn't be updated | | `403` | `forbidden` | Your signed-in email isn't the invited one | | `403` | `member_limit` | The workspace reached its member cap since the invitation was sent | | `404` | `not_found` | No invitation has that token | | `410` | `expired` | The invitation is past its 7 days; ask for a resend | ## `PATCH /api/v1/workspace/team/members/:id/role` Changes a member's role. Owners and admins; only the owner can demote an admin. The owner's role can't be changed here. ```json { "role": "admin" } ``` `role` is `admin` or `member`. ```json { "member": { "id": "mem_2", "userId": "usr_456", "name": "Sam Okafor", "email": "sam@halvard.example", "image": null, "role": "admin", "joinedAt": "2026-02-14T09:30:00.000Z" } } ``` Errors: `400 invalid_request`, `403 forbidden`, `404 not_found`. ## `DELETE /api/v1/workspace/team/members/:id` Removes a member. Owners and admins; only the owner can remove an admin, and nobody can remove the owner. Team seats are released when they're no longer used. Returns `{ "success": true }`. Errors: `403 forbidden`, `404 not_found`. ## Invitation lifecycle 1. **Send**: `POST /workspace/team/invite`. Pending for 7 days. 2. **Resend**: `POST /workspace/team/invitations/:id/resend`. New email, new 7-day expiry, same link. 3. **Cancel**: `DELETE /workspace/team/invitations/:id`. The link stops working. 4. **Accept**: by link (`POST /workspace/team/accept-invite`) or by id (`POST /invitations/:id/accept`). The person becomes an active member. 5. **Expire**: after 7 days the link returns `410 expired` until resent. ## Related pages - [Agent endpoints](/api-reference/agent-endpoints): the invitee's side, leaving, auto-join - [Workspaces API](/api-reference/workspaces): settings, branding, slug - [Workspaces and team access](/visibility/workspaces-and-team-access): how membership affects visibility - [Plans and limits](/getting-started/plans-and-limits): member caps per plan --- URL: https://docs.opendocs.cc/api-reference/usernames # Usernames and workspace slugs OpenDocs has two human-readable identifiers that are easy to mix up. | | Username | Workspace slug | | --- | --- | --- | | Identifies | A person | A workspace | | Appears in | Your profile and version history (`createdBy`); not in URLs | Every document URL: `opendocs.cc/<workspace-slug>/<post-slug>` | | Scope | Unique across OpenDocs | Unique across OpenDocs | | Rules | 3 to 32 characters, lowercase `a-z 0-9 _ -` | 3 to 32 characters, lowercase `a-z 0-9 _ -` | | Chosen | At sign-up or onboarding; rename with [`POST /profile/username`](/api-reference/onboarding-and-profile#post-apiv1profileusername) | At sign-up or when creating a workspace; change with [`POST /workspace/slug`](/api-reference/workspaces#post-apiv1workspaceslug) | | Check | `GET /api/v1/usernames/check` | `GET /api/v1/workspace/check-slug` | Both are lowercased before checking, and both share one reserved list (route and brand names such as `docs`, `pricing`, `integrations`, `dashboard`, `claim`, `openapi`). When an agent signs someone up with an emailed code, the workspace slug is the same as the username when it's free. :::tip To build the URL of a document you're about to publish, use the **workspace slug** (`onboarding.workspace.slug` from `GET /api/v1/me`, or `slug` from `GET /api/v1/workspaces`), not the username. Better still, use the `url` the publish response returns. ::: ## `GET /api/v1/usernames/check` No auth. ```http GET /api/v1/usernames/check?username=dana ``` | Query | Required | Description | | --- | --- | --- | | `username` | yes | The username to check | Available: ```json { "available": true, "normalized": "dana", "reason": null } ``` Taken: ```json { "available": false, "normalized": "dana", "reason": null } ``` Invalid or reserved: ```json { "available": false, "normalized": "docs", "reason": "reserved" } ``` `reason` is `invalid` (length or characters), `reserved`, or `null` (available, or valid but taken). ## `GET /api/v1/workspace/check-slug` **Session only** (it backs the onboarding form). ```http GET /api/v1/workspace/check-slug?slug=halvard ``` | Query | Required | Description | | --- | --- | --- | | `slug` | yes | The workspace slug to check | Available: ```json { "available": true } ``` Unavailable: ```json { "available": false, "reason": "That workspace ID is already taken." } ``` `reason` is a sentence you can show as is: missing, invalid (with the rule it broke), reserved, or taken. ## Related pages - [GET /api/v1/me](/api-reference/me): your username and workspace slug - [Workspaces API](/api-reference/workspaces): changing a workspace slug - [Onboarding and profile](/api-reference/onboarding-and-profile): choosing and renaming a username --- URL: https://docs.opendocs.cc/api-reference/account # Account API Account deletion is a dashboard action. Both endpoints are **session only**; an API key gets `401 unauthorized`. ## `GET /api/v1/account/delete-check` Whether the signed-in account can be deleted right now. ```json { "canDelete": true } ``` Deletion is blocked by an active paid subscription, or by a Team workspace you own that still has other active members: ```json { "canDelete": false, "reason": "active_plan" } ``` ```json { "canDelete": false, "reason": "team_workspace_with_members", "workspaces": [ { "id": "ws_123", "name": "Halvard", "memberCount": 4 } ] } ``` Cancel the subscription first, or transfer or empty those workspaces. ## `DELETE /api/v1/account` Deletes the signed-in account and its personal data. Workspaces you own and their documents are deleted with it. Billing history for canceled subscriptions is kept for accounting, with the user and workspace references removed. Status `204 No Content` on success. | Status | Code | When | | --- | --- | --- | | `401` | `error: "unauthorized"` | No valid session | | `409` | `code: "active_plan"` | You have an active Pro or Team subscription | | `409` | `code: "team_workspace_with_members"` | You own a Team workspace with other active members | The `409` body is the delete-check result plus `code`, and has no `error` field: ```json { "code": "team_workspace_with_members", "canDelete": false, "reason": "team_workspace_with_members", "workspaces": [{ "id": "ws_123", "name": "Halvard", "memberCount": 4 }] } ``` ## Related pages - [Plans and limits](/getting-started/plans-and-limits) - [Error codes](/errors#active-plan) --- URL: https://docs.opendocs.cc/api-reference/openapi # OpenAPI spec OpenDocs publishes an OpenAPI 3 document for agents, client generators and tool builders: ```text https://opendocs.cc/openapi.json ``` A copy ships with these docs at `https://docs.opendocs.cc/openapi.json`. Use the opendocs.cc one; it's the one agent instructions and `skill.md` point to, and the docs copy can lag behind it. ```bash curl https://opendocs.cc/openapi.json ``` When you run the docs site locally (`npm run start` in `apps/docs`), the copy is at `http://localhost:3001/openapi.json`. ## What it covers The spec describes the core surface: the auth check (`/me`), emailed-code sign-in, anonymous publishing and claiming, publish and batch publish, post reads and changes, version history, moves, sharing, exports, projects (list and create), workspaces and their settings, the export theme (`/workspace/branding`), team members and invitations, API keys and account deletion. Errors use the shared `Error` schema (`error`, `message`, `docs_url`). These pages document more than the spec does. Not in the spec yet: - [Integrations](/api-reference/integrations): Google Drive saves and signature requests - [Projects](/api-reference/projects): `GET /projects/default`, `GET /projects/resolve`, `PATCH` and `DELETE /projects/:projectId` - Invitee-side team routes and auto-join ([Agent endpoints](/api-reference/agent-endpoints#team-invitations-from-the-invitees-side-leaving-and-auto-join)) - `DELETE /workspace`, `POST /workspace/default-sort`, `POST /profile/username`, `GET`/`POST /profile`, avatar upload and image presign - Public raw Markdown, the public workspace zip and the free converter When the spec and these pages disagree, the pages are newer. ## Auth model The spec declares two security schemes: - `bearerAuth`: `Authorization: Bearer od_live_...`, for agents, the CLI and scripts. - `cookieAuth`: the dashboard's session cookie. Routes marked only with it don't accept API keys. ## Notes for agents - Start from local Markdown files? Use the CLI (`opendocs publish`); it handles state, conflicts, images and retries. - Building a service or a custom tool? Call the API directly. - `POST /api/v1/publish/batch` is the right call for a folder of files. - `GET /api/v1/workspaces` lists the workspace slugs `opendocs workspace use` accepts. - Send `X-OpenDocs-Client: <your-agent>` on every request. --- URL: https://docs.opendocs.cc/api-reference/errors-and-pagination # Errors and pagination ## Error shape Every JSON error has the same base shape: ```json { "error": "invalid_request", "message": "confirmPublic: Public publishing requires explicit confirmation.", "docs_url": "https://docs.opendocs.cc/errors#invalid-request" } ``` - `error` is a stable code to branch on. - `message` says what to do next. Routes that don't write one get a default (the code in words), so it's never empty. - `docs_url` links to the code on the [error code reference](/errors). The anchor is the code with `_` replaced by `-`. Some errors add fields: | Code | Extra fields | | --- | --- | | `invalid_request` | `issues`: Zod's flattened `formErrors` and `fieldErrors`. `message` summarizes the first three issues | | `document_limit` | `plan`, `limit`, `used`; batch adds `requested`, `workspaceId` | | `version_conflict` | `currentVersionNumber`, `baseVersionNumber`, `currentVersionCreatedAt` | | `plan_required` | `tier` | | `plan_limit`, `member_limit` | `plan`, `limit` | | `low_contrast` | `contrast`, `minContrast` | | `invalid_preset` / `invalid_font` (branding) | `presets` / `fonts` | | `domain_mismatch` | `domain`, `yourDomain` | | `destination_not_found` | `destination`, `destinations` | | `approval_required` | `approveUrl` | | `signer_roles_mismatch` | `roles` | | `already_sent`, `not_completed` | `status` | | `project_not_empty` | `postCount` | Account deletion's `409` is the exception: its body has `code` instead of `error` (see [Account API](/api-reference/account)). ## Status codes by area The full list with fixes is on [Error codes](/errors). | Status | Error codes | Where | | --- | --- | --- | | `400` | `invalid_request` | Any route that validates its body or query, and any body that isn't valid JSON | | `400` | `publish_failed`, `reserved_slug` | `POST /publish`, `POST /publish/batch` (per document) | | `400` | `update_failed`, `unpublish_failed`, `visibility_change_failed`, `invalid_visibility`, `tag_update_failed`, `delete_failed`, `move_failed`, `restore_failed`, `share_failed`, `unshare_failed` | Post mutation routes | | `400` | `missing_workspace_id` | Routes that take `?workspaceId=` (team lists, branding, auto-join, integrations, signature requests) and the logo upload form | | `400` | `onboarding_failed`, `invalid_username`, `reserved_username`, `no_username` | Onboarding and username rename | | `400` | `invalid_code`, `code_expired` | `POST /auth/code/verify` | | `400` | `invalid_slug`, `default_project`, `project_not_empty`, `confirmation_mismatch` | Workspaces and projects | | `400` | `invite_limit`, `invalid_domain`, `consumer_domain` | Team and auto-join | | `400` | `invalid_color`, `low_contrast`, `invalid_preset`, `invalid_font`, `invalid_footer`, `nothing_to_change`, `invalid_input` | Branding | | `400` | `missing_file`, `empty_file`, `unsupported_mime` | Uploads and the free converter | | `400` | `confirmation_required`, `invalid_signers`, `signer_roles_mismatch`, `invalid_expiry`, `invalid_kind`, `invalid_payload` | Signature requests | | `401` | `unauthorized` | Every protected route; the DocuSeal webhook | | `402` | `billing_failed` | Joining a Team workspace when the seat count couldn't be updated | | `403` | `forbidden` | Not a member, or your role can't do this | | `403` | `document_limit` | Publishing or claiming past the Free cap | | `403` | `plan_limit`, `member_limit` | Creating a workspace, inviting or joining past the plan's cap | | `403` | `plan_required`, `docx_requires_pro` | Pro features on a Free workspace | | `403` | `signups_disabled`, `email_not_verified`, `domain_mismatch`, `invalid_claim_token`, `approval_required` | See [Error codes](/errors) | | `403` | `hidden` | Updating or claiming an anonymous document that readers reported, while it's under review | | `404` | `not_found`, `project_not_found`, `version_not_found`, `no_accessible_posts`, `destination_not_found`, `not_available` | Lookups. Many routes answer `404` instead of `403` so they don't reveal what exists | | `409` | `version_conflict` | `POST /posts/:postId/update` with a stale `baseVersionNumber` | | `409` | `slug_taken`, `last_workspace`, `already_member`, `already_invited`, `owner_cannot_leave`, `username_taken`, `onboarding_incomplete` | Workspaces, team, accounts | | `409` | `integration_not_connected`, `reconnect_required`, `destination_unavailable`, `already_sent`, `already_completed`, `not_completed` | Integrations | | `409` | `code: active_plan`, `code: team_workspace_with_members` | `DELETE /account` | | `410` | `expired` | Anonymous documents and invitations past their expiry | | `413` | `payload_too_large` | Request bodies over 2 MB, or 32 MB for `POST /publish/batch` | | `413` | `file_too_large` | Avatar, logo and free-converter uploads over 2 MB | | `429` | `rate_limited`, `too_many_attempts` | Rate limits; five wrong sign-in codes | | `500` | `internal_error` | Unexpected errors | | `502` | `export_failed`, `conversion_failed`, `storage_failed`, `send_failed`, `cancel_failed`, `provider_failed` | The converter, Google Drive or DocuSeal failed | | `503` | `service_busy` | The free converter or anonymous publishing is at its limit across all clients; wait `Retry-After` seconds | | `503` | `storage_not_configured`, `integrations_not_configured` | The server is missing configuration | | `504` | `export_timeout` | The converter didn't answer within 55 seconds | The converter errors (`502 export_failed`, `504 export_timeout`) are the same for exports, Drive saves and signature drafts. ## The `document_limit` error Returned with `403` when a publish would take a workspace past its plan's document cap (Free: 50 published documents per workspace): ```json { "error": "document_limit", "plan": "free", "limit": 50, "used": 50, "message": "Your free plan allows 50 published documents. You currently have 50.", "docs_url": "https://docs.opendocs.cc/errors#document-limit" } ``` The batch version (`POST /publish/batch`) adds `requested` and `workspaceId`: ```json { "error": "document_limit", "plan": "free", "limit": 50, "used": 48, "requested": 3, "workspaceId": "ws_123", "message": "This batch would publish 3 documents, but your free plan allows 50 total. You have 2 slots left." } ``` The batch check runs before anything is written: if the cap would be exceeded, no document in the batch is published. Show `message` to the person as is. See [Plans and limits](/getting-started/plans-and-limits#the-50-document-cap-on-free). ## Rate limits Signed-in routes count per account, so teammates behind one office address don't share a bucket. Unauthenticated routes count per IP. Every request also counts toward the per-IP general limit. The signed-in limits are sized so an agent can republish and re-export a folder of 50+ long documents in one run. | Route group | Limit | Counted per | | --- | --- | --- | | All API traffic | 600 requests a minute | IP | | `POST /publish` | 120 a minute | Account | | `POST /publish/batch` (up to 25 documents each) | 20 a minute | Account | | `POST /posts/:postId/export/:format`, plus the integration routes that render or fetch files (Drive saves, signature drafts, signature PDF downloads, filing signed copies) | 120 a minute, shared | Account | | `POST /posts/batch/export` (up to 10 documents each) | 30 a minute | Account | | Exports running at the same time (single and batch) | 4 | Account | | `POST /auth/code/request` | 5 every 15 minutes | IP | | `POST /auth/code/verify` | 20 every 15 minutes | IP | | `POST /anonymous/publish` and `PUT /anonymous/:id` | 20 an hour, shared | IP | | `POST /anonymous/publish` (new documents) | 50 a day | IP | | `POST /anonymous/:id/report` | 5 an hour and 20 a day | IP | | Public download (`POST /public/posts/.../export/:format`) | 60 a minute | IP | | Public raw Markdown (`GET /public/posts/.../raw`) | 120 a minute | IP | | Public workspace zip (`GET /public/workspaces/:slug/markdown.zip`) | 3 a minute | IP | | Free converter (`POST /tools/convert/pdf\|docx`) | 5 a minute, 30 an hour and 100 a day | IP | | Browser sign-in (`POST /api/auth/*`, used by the dashboard) | 100 every 15 minutes | IP | Per-IP limits count an IPv6 client by its /56 prefix. The free converter and anonymous publishing also have ceilings across all clients, so a flood from many addresses can't crowd out everyone else: 30 conversions a minute and 600 an hour; 60 new anonymous documents a minute, 1,000 an hour and 5,000 a day. Only successful requests count. Over a ceiling you get `503 service_busy` with `Retry-After`; signed-in publishing and exports aren't affected. When a limit is hit you get `429`: ```json { "error": "rate_limited", "message": "Too many publish requests. Try again later.", "docs_url": "https://docs.opendocs.cc/errors#rate-limited" } ``` The response carries `Retry-After` (seconds to wait; 2 for the concurrent export limit) and `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` and `RateLimit-Policy` headers. The CLI waits and retries for you (0.4.6 and later), so a large publish or export slows down instead of failing. ## Pagination `GET /api/v1/posts` is the only paginated endpoint: ```json { "posts": [], "pagination": { "page": 1, "limit": 20, "total": 42, "totalPages": 3 } } ``` - `page` defaults to `1`. - `limit` defaults to `20`; values above `100` are treated as `100`. - Results are ordered by `updatedAt`, newest first. Other lists return everything in one response, except `GET /signature-requests`, which returns the newest 50. ## Practical guidance - Use modest `limit` values unless you need bigger pages. - Call `GET /api/v1/posts` to find a `postId` before `POST /posts/:postId/update`. - On `403 document_limit`, show the `message` to the person; it's written for them. - On `429`, wait `Retry-After` seconds and retry the same request.