Overview
The Cleve REST API lets you read and write docs and folders from your own scripts and tools, and pull the docs you publish into your own website with the published posts routes. Base URL:https://app.cleve.ai/api/v1
OpenAPI spec: https://app.cleve.ai/api/v1/openapi.json (also at https://www.cleve.ai/openapi.json). Every operation has an operationId, typed parameters and response schemas, so you can generate a client or give it to an LLM as function-calling tools.
The API calls docs notes: endpoints live under
/api/v1/notes and IDs are noteId. Notes and docs are the same thing.data:
Authentication
Every request needs an API key, sent as a Bearer token. The published posts routes are the exception: they’re public and need no key.Getting an API Key
- In Cleve, open Settings → Developer.
- Under REST API, click Manage next to API keys. Your account profile opens.
- Go to API keys and create a key. Copy it somewhere safe.
Which workspace a key uses
A personal API key acts as you, in one workspace per request:- If you belong to one workspace, the key works there. You don’t need to do anything.
- If you belong to several, send the workspace’s ID in the
X-Cleve-Workspaceheader to choose one. Without the header, the request uses your first workspace, which may not be the one you want.
403 and nothing is read or changed.
Within that workspace, you can do what you can do in the app. Actions you don’t have permission for, such as pinning a doc that was only shared with you, return an error.
Workspace API keys
A key created on a workspace’s API keys page belongs to that workspace instead of to one person:- It only works in its own workspace. You don’t need
X-Cleve-Workspace; if you send it, it must be that workspace’s ID, or the request fails with403. - It acts as the member who created it: it can reach what they can in that workspace, and what it creates or changes is recorded as theirs.
- It stops working, with
403, if the person who created it leaves the workspace. Create a new key to replace it.
Try it in Cleve
Settings → Developer also has:- Base URL, to copy.
- Workspace ID: the ID of the workspace you’re in, to copy and send as
X-Cleve-Workspace. It shows when you’re in a workspace. - Agent prompt: copy a ready-made description of every endpoint to paste into your AI agent, then add your key. It includes the
X-Cleve-Workspaceheader for the workspace you’re in. - An endpoint list under Notes and Folders, with each endpoint’s parameters.
- API Tester: pick an Endpoint, fill in its parameters and body, and click Send to see the status and response. It runs as you, signed in to the app, so you don’t need a key to try it. Code snippet gives the same request in cURL, Node.js and Python, with the
X-Cleve-Workspaceheader for the workspace you’re in.
Notes
List notes
content is a short plain-text preview; get a doc for its full text.
Query parameters
Example
Create a note
Example
201)
Get a note
permission (owner, editor or viewer), canManageSharing and linkRole (viewer or editor when anyone with the link can open it). Returns 404 if the doc doesn’t exist or you can’t access it.
Query parameters
Example
Update a note
Send at least one of these fields; a body with none of them returns
400. The doc’s owner or any member of its workspace can change isPinned; someone the doc was only shared with can’t. Changing link access needs permission to manage the doc’s sharing, as in the app’s Share dialog.
About link access: viewer and editor let anyone with the link view or edit the doc. restricted turns that off. It doesn’t publish the doc to your profile (use Publish a note), and it doesn’t remove collaborators, workspace access or access inherited from a shared folder.
Formatting: content takes the same Markdown the MCP server describes, including callouts, toggles, doc links ([[Label|/notes/<id>]]), interactive HTML blocks, maths and YouTube embeds.
Example
Delete a note
Restore a note
List the Bin
kind (note or folder), id, title, binnedAt, purgeAt (when it will be deleted for good, in milliseconds since the epoch), binnedByName, fromFolderName, docCount and canDeleteForever.
Publish a note
400 whose error says why.
Example
Unpublish a note
List recent notes
A
limit outside the range is clamped to it; one that isn’t a number returns 400.
Search notes
content is plain text; get the doc for its Markdown.
Query parameters
Example
POST the same fields as a JSON body, which is easier for queries with special characters:
Count notes
{ "total": number, "pinned": number } for the workspace.
Query parameters
Folders
List folders
parentId, which is absent for top-level folders.
Example
Create a folder
Example
201)
Rename or move a folder
name, parentId or both; an empty body returns 400.
Delete a folder
Restore a folder
Published posts
Use Cleve as the CMS for your blog or website: write and publish docs in Cleve, then pull them into your site with these routes. They serve what you’ve published to your profile atcleve.ai/@your-handle, so they’re public. You don’t need an API key, any website can call them from the browser, and responses are cached for up to five minutes.
These routes list docs you published one by one. Docs that only show on your profile because their folder is published aren’t listed.
List posts
handle is the name after @ in your profile address.
Query parameters
Example
excerpt is the opening words under the title as plain text, and imageUrl is the post’s link preview image. For the next page, pass nextCursor back as cursor. It’s null on the last page.
Get a post
markdown: the post’s body as GitHub-flavored Markdown, ready for any Markdown renderer. The title isn’t repeated in the body, comments are left out, and links to your other docs and @mentions show as plain text. Toggles come as <details> HTML, and interactive blocks as code fenced with cleve-block, so they never run on your site by themselves. A post that isn’t published returns 404.
Example
RSS feed
Build a blog with it
Fetch the list for your blog’s index page and each post for its own page, then render the Markdown with any Markdown library. For example, in Next.js:Error Responses
Every error returns JSON with a human-readableerror, a stable code to branch on, a hint that says how to fix it, and a docs link:
Unknown paths under
/api/v1 return the same JSON 404. A 4xx won’t succeed on retry: fix the request using error and hint. If an error keeps happening, email support@cleve.ai with the request details.
Related
MCP tool reference
Connect AI agents to Cleve with OAuth and 50+ tools.
Use Cleve in other AI apps
Set up Claude, ChatGPT, Cursor and more.
Settings overview
Where to find Developer settings and API keys.
Plans
The API is included on every plan.