Skip to main content

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.
Every success response wraps its payload in data:
The API is included on every plan. If you’re connecting an AI agent rather than writing code, the MCP server gives it the same workspace with OAuth sign-in and more tools.

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

  1. In Cleve, open Settings → Developer.
  2. Under REST API, click Manage next to API keys. Your account profile opens.
  3. Go to API keys and create a key. Copy it somewhere safe.
To revoke a key, delete it from the same page. Keep keys secret: anyone with your key can read and change your docs. Workspace keys: you can also create a key that belongs to one workspace. Click the workspace switcher, then Manage next to the workspace, and open API keys. See workspace API keys for how they differ.

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-Workspace header to choose one. Without the header, the request uses your first workspace, which may not be the one you want.
To find the ID, switch to the workspace in Cleve, open Settings → Developer and copy Workspace ID. Each request can name a different workspace, so one key can work across all of yours. If you aren’t a member of the workspace you name, the request fails with 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 with 403.
  • 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-Workspace header 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-Workspace header for the workspace you’re in.

Notes

List notes

Lists docs in the workspace, newest first, up to 200. content is a short plain-text preview; get a doc for its full text. Query parameters Example

Create a note

Creates a doc from a title and a Markdown body. Body (JSON, all optional) Example
Response (201)

Get a note

Returns one doc with its metadata, and its full content as Markdown in the same syntax Update a note takes, so you can change it and write it back without losing tables, doc links, interactive blocks or other formatting. Includes 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

Body (JSON, all optional) 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
Response

Delete a note

Moves the doc to the Bin. It can be restored for 30 days, then it is deleted for good. See Bin. Example

Restore a note

Restores a doc from the Bin into its folder, or to the top level if that folder is gone.

List the Bin

Lists the docs and folders in the Bin, newest first. Each item has 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

Publishes the doc as a readable post on your public Cleve profile. Only the doc’s owner can publish, and you need a profile handle first. To set one, open Settings → General and click Set up next to Public profile. If publishing isn’t possible, the response is a 400 whose error says why. Example

Unpublish a note

Removes the doc from your profile. Link sharing and collaborators are unchanged. Example
See Publishing for how profile publishing differs from link sharing.

List recent notes

Returns the most recently updated docs. Query parameters A limit outside the range is clamped to it; one that isn’t a number returns 400.

Search notes

Full-text search across doc titles and content: matches in the body come first, by relevance, then docs that match only by title. Each result’s content is plain text; get the doc for its Markdown. Query parameters Example
You can also POST the same fields as a JSON body, which is easier for queries with special characters:

Count notes

Returns { "total": number, "pinned": number } for the workspace. Query parameters

Folders

List folders

Returns every folder in the workspace as a flat list. Nesting is given by parentId, which is absent for top-level folders. Example

Create a folder

Body (JSON) Example
Response (201)

Rename or move a folder

Body (JSON). Pass name, parentId or both; an empty body returns 400.

Delete a folder

Moves the folder to the Bin with its docs and subfolders, as deleting a folder in the app does. Restoring the folder within 30 days brings it all back.

Restore a folder

Restores a folder from the Bin, with everything that was binned along with it.

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 at cleve.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

Your published posts, newest published first, a page at a time. handle is the name after @ in your profile address. Query parameters Example
Response
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

The same fields as the list, plus 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

An RSS 2.0 feed of your 20 newest posts, each with its title, link, date and excerpt. Add it to a feed reader or a newsletter tool.

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:
Changes you make to a published post reach the API within about five minutes.

Error Responses

Every error returns JSON with a human-readable error, 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.

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.