logseq-rest-api
Skill by logseq
Explains how to call the Logseq semantic REST API with a graph-scoped personal access token, including end-to-end encrypted graphs. Aimed at developers building integrations, scripts or agent tooling for Logseq DB graphs.
Install logseq-rest-api
Built from the published package, never by AI.
git clone --depth 1 https://github.com/logseq/logseq /tmp/logseq && mkdir -p ~/.claude/skills && cp -r /tmp/logseq/.agents/skills/logseq-rest-api ~/.claude/skills/logseq-rest-apiRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/logseq/logseq /tmp/logseq && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/logseq/.agents/skills/logseq-rest-api ~/.gemini/antigravity-cli/skills/logseq-rest-apiAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill documents the Logseq semantic REST API, served by the db-sync Cloudflare worker. It covers authentication with logseq_pat_ tokens, which are scoped to a single graph and carry read, write, or read+write permission. It lists 39 operations under /api/v1/graphs, grouped into pages, blocks, block properties, tags, tasks, capture, assets and search.
It also explains how to work with end-to-end encrypted graphs, including encrypting titles, names and asset bytes before writing, and which operations behave differently on encrypted graphs. The skill covers request shapes, rate limits, the MCP endpoint and local testing. It is written for developers and agent builders who read or write Logseq DB graphs over HTTP.
Written from the project's SKILL.md and checked against it.
What it can do
- Graph-scoped authenticationCalls the API with a logseq_pat_ personal access token limited to read, write, or read+write on one graph.
- Page and block operationsCovers pages, blocks, moving blocks, and inserting block children or nested trees.
- Property and tag managementSets and deletes block properties in batches and manages tags and their objects.
- Tasks and captureCreates tasks and captures content into a graph through the semantic API.
- Asset uploadUploads asset files with file name, size, SHA-256 checksum and optional page reference.
- SearchSearches a graph through the search operation, with limits noted for encrypted graphs.
- E2EE helpersEncrypts and decrypts text with the graph AES key and fetches the wrapped key for a user.
- MCP endpointExposes search, execute, upload_asset and get_asset_image tools plus one tool per API operation.
What you need
- A Logseq DB graph on the db-sync worker
- A graph-scoped personal access token (logseq_pat_)
- A user JWT for creating tokens and graphs
- The user's RSA private key for encrypted graphs
- Node.js and pnpm for running the local server
- Clojure for rebuilding after ClojureScript changes
Try asking
- Write a script that appends a block to my Logseq graph using the REST API.
- Show me how to upload an asset to an encrypted Logseq graph.
- Help me set a property on a block using the batch-set endpoint.
Good to know
- A token only works on its own graph; other graphs return 403.
- Read requests are limited to 120 per minute and write requests to 20 per minute.
- Plaintext keyword search is not possible on encrypted graphs.
- Path parameters must be UUIDs, not property or tag idents.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/logseq-rest-api/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to logseq-rest-api
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
logseq-rest-api: common questions
Can I search Logseq graphs with the REST API if they are encrypted?
Search runs on encrypted graphs but only matches ciphertext substrings, so plaintext keyword search is not possible there.
Which token do I need to create a new graph?
Creating graphs and personal access tokens requires a user JWT, not a personal access token.
Can agents create page references on encrypted graphs?
The source says agents cannot create references on encrypted graphs because the API has no way to supply reference UUIDs.
How do I install logseq-rest-api?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is logseq-rest-api free?
The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.
Is logseq-rest-api safe to use?
It scores 84 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to logseq-rest-api?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
