Skip to content

Local REST API

James Mr. Squirrely edited this page Nov 17, 2026 · 1 revision

Local REST API

The local API lets scripts and other apps read and edit the project that is open in WritingIDE. It listens on this computer only.

Switch it on

Tools > Extensions and API > Local API: switch it on, and copy the token. Every request needs it. The port is 5719 unless you change it.

Requests

Request Does
GET /api/project Name, author, chapter count, words
GET /api/chapters Chapters in reading order (id, title, book, status, synopsis, POV, story date, words)
POST /api/chapters Add a chapter: { "title": "...", "text": "...", "bookId": null }
GET /api/chapters/{id} A chapter and its text
PUT /api/chapters/{id}/text Replace its text (plain text or { "text": "..." }). Undoable in an open editor
GET /api/chapters/{id}/comments Comments, bookmarks and plot markers
POST /api/chapters/{id}/comments Add a comment: { "offset": 0, "length": 5, "text": "..." }
GET /api/entities Story elements
POST /api/entities Add one: { "kind": "Character", "name": "...", "summary": "..." }
GET /api/diagnostics The Error List
POST /api/save Save the project
GET /api/openapi.json An OpenAPI 3 description (no token needed), for Postman, Swagger UI and code generators

Examples

PowerShell:

$h = @{ Authorization = "Bearer <token>" }
Invoke-RestMethod http://localhost:5719/api/chapters -Headers $h

curl:

curl -H "Authorization: Bearer <token>" http://localhost:5719/api/project

Limits

Request bodies are limited to 16 MB. Unexpected errors return a generic message; the details go to the Output window. New token on the same tab invalidates the old one.

Clone this wiki locally