Skip to main content

Posts endpoints

Read-side endpoints for the posts the caller owns. All three accept either API-key or session auth.

GET /api/v1/posts

List the authenticated user's posts.

Auth

API key or session auth.

Query parameters

NameTypeRequiredDescription
pagenumberNoDefaults to 1
limitnumberNoDefaults to 20, max 100
tagstringNoLowercase tag filter — only posts with this tag
workspaceIdstringNoScope the list to one workspace. The CLI sends this by default for the active workspace; omit it to list authored posts across all workspaces.
projectIdstringNoScope slug/list results to one project. The CLI sends this by default for the active project.

Example

curl "https://api.opendocs.cc/api/v1/posts?page=1&limit=20&tag=api" \
-H "Authorization: Bearer od_live_xxxxx"

Response

{
"posts": [
{
"id": "post_123",
"slug": "checkout-api-reference",
"title": "Checkout API reference",
"summary": "Endpoint summary.",
"visibility": "workspace",
"isPublished": true,
"updatedAt": "2026-04-12T10:00:00.000Z",
"workspaceId": "ws_123",
"workspaceSlug": "acme",
"projectId": "proj_default",
"projectSlug": "default",
"projectName": "Default",
"isDefaultProject": true,
"tags": ["api", "checkout"]
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
}

visibility can be private, workspace, or public.

GET /api/v1/posts/:postId

Return metadata for a single post.

:postId can be either the post UUID or the post slug. Slug lookups can be scoped with ?workspaceId=ws_123&projectId=proj_123, which is how the CLI disambiguates the same slug used in multiple workspaces or projects. UUID lookups ignore those query parameters because UUIDs are globally unique.

Response

{
"post": {
"id": "post_123",
"slug": "checkout-api-reference",
"title": "Checkout API reference",
"summary": "Endpoint summary.",
"visibility": "workspace",
"isPublished": true,
"publishedAt": "2026-04-12T10:00:00.000Z",
"updatedAt": "2026-04-12T10:00:00.000Z",
"url": "/acme/checkout-api-reference",
"projectId": "proj_default",
"projectSlug": "default",
"projectName": "Default",
"isDefaultProject": true,
"versionNumber": 1,
"tags": ["api", "checkout"]
}
}

Default project URLs are /<workspace-slug>/<post-slug>. Non-default project URLs are /<workspace-slug>/projects/<project-slug>/<post-slug>. Prepend https://opendocs.cc to get the absolute URL.

GET /api/v1/posts/:postId/raw

Return the current raw Markdown for a post.

Like GET /posts/:postId, this accepts either a UUID or slug and supports the optional ?workspaceId= query parameter for slug disambiguation.

Response

{
"markdown": "# Checkout API reference\n\nEndpoint summary.",
"title": "Checkout API reference",
"slug": "checkout-api-reference",
"versionNumber": 1
}

Used by the CLI's opendocs pull <postId> to reconstitute the local file.

Common errors

StatuserrorWhen
401unauthorizedMissing/invalid API key
404not_foundPost doesn't exist, belongs to a workspace the caller isn't a member of, or the slug exists in a different workspace than workspaceId
429rate_limited120/min general bucket exhausted