AgentDock
1.7k
Dock Agent Api
REST API Reference

REST API Reference

The 36 REST routes of the Dock document workspace API, grouped by capability area. Standard HTTP under /api/d/*, callable from any language.

The REST API lives under /api/d/* on https://app.agentdock.ai. It is plain HTTP, so any language or backend that can make a request can use it. Authenticate with the x-api-key header (see Authentication).

curl https://app.agentdock.ai/api/d \
  -H "x-api-key: ak_usr_YOUR_TOKEN"

All paths below are relative to /api/d. There are 36 routes across eight areas.

MethodPathDoes
GET/List your documents, newest first
POST/Create a new blank document
GET/{id}Read a document (JSON by default; Accept: text/markdown for markdown, ?format=nodes for the node list)
PATCH/{id}Update content, title, or the document's citation style
DELETE/{id}Delete a document
POST/{id}/duplicateCopy a document
PATCH/{id}/moveMove a document to a folder, or to the root
POST/import-urlImport a web page as a new editable document

The GET /{id} route returns the structured editor document as JSON by default. Send an Accept: text/markdown header to get the document as markdown text, or pass ?format=nodes to get a flat node list with stable node IDs for targeted edits. A PATCH /{id} body can carry markdown to replace content, title to rename, or citationStyle to set the bibliography style for that document.

MethodPathDoes
POST/{id}/publishPublish to a public /p/slug page with SEO metadata
DELETE/{id}/publishUnpublish, reverting to a private draft

The publish body accepts an optional slug, seoTitle, seoDescription, and an isListed flag for an unlisted page. Omit them and the server derives a slug and metadata from the document.

MethodPathDoes
GET/{id}/suggestionsList pending suggestions on a document
DELETE/{id}/suggestions/{sid}Reject a suggestion (discard without applying)
POST/{id}/suggestions/{sid}/acceptAccept a suggestion (apply the change)

A suggestion is proposed by writing to the document in suggest mode rather than direct mode; see Writing Modes. These three routes are how a reviewer works through the pending list.

MethodPathDoes
GET/foldersList your folders
POST/foldersCreate a folder
PATCH/folders/{folderId}Rename or move a folder
DELETE/folders/{folderId}Delete a folder (its documents move to the root)

MethodPathDoes
GET/{id}/versionsList version history metadata
GET/{id}/versions/{vid}Read a specific past version

Every write creates a version, and each version records whether a human or an agent made it, plus the model name when it was automated.

Citations span three groups: in a document, in your reusable library, and in collections.

In a document

MethodPathDoes
GET/{id}/citeList the citations in a document
POST/{id}/citeAdd a citation by DOI, URL, PMID, or arXiv ID
DELETE/{id}/cite/{cid}Remove a citation from a document
GET/cite/searchSearch academic sources to cite

Library

MethodPathDoes
GET/citationsList saved citations in your library
POST/citationsSave a citation to your library
GET/citations/{citationId}Read a saved citation
DELETE/citations/{citationId}Delete a saved citation
GET/citations/searchFull-text search your library
POST/citations/formatFormat a citation in a style (preview, no save)

Collections

MethodPathDoes
GET/citation-collectionsList your citation collections
POST/citation-collectionsCreate a collection
DELETE/citation-collections/{collectionId}Delete a collection
POST/citation-collections/{collectionId}/citationsAdd a citation to a collection
DELETE/citation-collections/{collectionId}/citations/{citationId}Remove a citation from a collection

Citations format in any of 10,000+ academic styles from the CSL catalog. Pass the seven classics by short id (apa, mla, chicago, harvard, ieee, ama, vancouver) or any other style by its CSL file name, such as nature or the-lancet.

MethodPathDoes
GET/promptsList your personal and system prompts
GET/prompts/{promptId}Read a prompt by ID

So an agent can pull a saved prompt instead of improvising one.

Setting the per-document citation style is the document settings operation. It is a field on the document update rather than its own endpoint:

curl -X PATCH https://app.agentdock.ai/api/d/{id} \
  -H "x-api-key: ak_usr_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"citationStyle": "IEEE"}'

Routes return JSON. A successful create returns the new resource (with its id), a publish returns the public url and slug, and a list returns an array under a named key (documents, folders, citations, and so on). A request that uses a verb outside your key's scopes, or reaches a document a document-scoped token is not bound to, is rejected. See Authentication for scopes.