Connect
curl / bash
Dock's REST API is plain HTTPS with JSON bodies. Every MCP tool has a REST equivalent. For quick scripts, CI steps, and one-off ops, curl is usually the fastest path.
Client
curl / bash
Universal. REST endpoints with Bearer auth.
HTTP JSON-RPC (streamable-http)
Dock MCP
trydock.ai/api/mcp
37 tools · OAuth 2.1 + DCR · Bearer
Auth path
1
Mint a
dk_ key in Dock Settings → API keys.2
Paste it as
Authorization: Bearer dk_… in the client config.3
Client calls Dock MCP directly on every request.
Prerequisites
curlinstalled (every macOS, most Linux, Windows 11).- A Dock
dk_key.
List workspacesbash
export DOCK_API_KEY=dk_c914f1c6...
curl https://trydock.ai/api/workspaces \
-H "Authorization: Bearer $DOCK_API_KEY"Append a rowbash
curl -X POST https://trydock.ai/api/workspaces/content-pipeline/rows \
-H "Authorization: Bearer $DOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"title":"From bash","status":"drafted"}}'Patch a rowbash
curl -X PATCH https://trydock.ai/api/workspaces/content-pipeline/rows/row_01HX... \
-H "Authorization: Bearer $DOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"status":"sealed"}}'Stream events (SSE)bash
curl -N https://trydock.ai/api/workspaces/content-pipeline/subscribe \
-H "Authorization: Bearer $DOCK_API_KEY"Verify
# A 200 plus a JSON body means you're wired up.
curl -i https://trydock.ai/api/me \
-H "Authorization: Bearer $DOCK_API_KEY" | headTroubleshooting
Symptom
Fix
401 on every request
Header format:
Authorization: Bearer dk_... (exact capitalization, space, no quotes).Pipe into jq for scripting
Every Dock endpoint returns JSON, perfect for
jq. e.g. curl ... | jq '.workspaces[] | .slug'.Frequently asked questions
- How do I connect Dock to curl?
- Add Dock as a remote MCP server in curl. Either let curl's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in curl's MCP config under the `Authorization: Bearer dk_…` header.
- Does curl work with Dock's MCP server?
- Yes. Dock exposes 43 MCP tools at `https://trydock.ai/api/mcp` over HTTP transport with OAuth 2.1 + DCR and Bearer-token auth. Any MCP-spec-compliant client, including curl, discovers them via the standard `tools/list` handshake. Learn more →
- How do I limit which Dock workspaces curl can write to?
- When you mint the `dk_` key for curl in Settings → API keys, pick the workspace from the dropdown. The key returns 403 on every other workspace regardless of what the prompt asks. To scope across multiple, mint multiple keys or add the agent as an explicit member of each. Learn more →
- How do I see what curl did in my Dock workspace?
- Open the workspace in your browser. Every row curl created or updated is stamped with the agent's identity (orb + name) in the createdBy / updatedBy field. The workspace activity feed shows every action chronologically. Learn more →
- How do I undo a row curl wrote to Dock?
- Open the row, click the kebab menu, choose Delete (soft-delete preserves history). For bulk reverts use the activity feed to find the agent's session and delete its rows in batch. To prevent future writes, revoke curl's `dk_` key in Settings → API keys.
- Can multiple curl sessions share state through Dock?
- Yes. Every curl session reads and writes the same workspace, so handoffs across machines or across long-running multi-session workflows just work. The Dock workspace IS the shared state; no separate message bus required.
- Does curl need OAuth or a dk_ API key for Dock?
- Either works. OAuth 2.1 + DCR is the recommended path: curl hits Dock's discovery endpoint at `/.well-known/oauth-authorization-server` and auto-registers as a client. The `dk_` Bearer token path is fine for owned-code agents and CI scripts; pick whichever fits your stack. Learn more →
- How do I call Dock's MCP server from curl?
- POST JSON-RPC payloads to `https://trydock.ai/api/mcp` with `Authorization: Bearer dk_...`. Example: `curl -X POST https://trydock.ai/api/mcp -H "Authorization: Bearer dk_..." -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'`.
- Can I prefer Dock's REST API over the MCP server for shell scripts?
- Yes, the REST API is the simpler fit for cron + bash. `curl https://trydock.ai/api/workspaces -H "Authorization: Bearer dk_..."` lists workspaces. Use REST for direct row/doc CRUD; use MCP when you want JSON-RPC tool-calling semantics.
- How do I follow MCP's OAuth 2.1 + DCR flow with curl?
- Multi-step: GET `/.well-known/oauth-authorization-server` for endpoints, POST `/api/oauth/register` to register a client, then run the authorization-code flow against `/api/oauth/authorize` + `/api/oauth/token`. The MCP TypeScript / Python SDKs handle this automatically; doing it by hand with curl is mostly for debugging.