Skip to content
EN

API Overview & Authentication

CollMap has a RESTful HTTP API (built with Fastify) for managing rooms, markers, layers, uploads, comments, and exports. Anything you can do in the app you can largely do over HTTP — most usefully, driving a single room from a script with a room-scoped token.

All endpoints are served from the app origin:

https://collmap.com

(Running the stack locally, the API server is at http://localhost:3001.)

Every protected endpoint takes a bearer token in the Authorization header:

Authorization: Bearer <token>

There are two kinds of token:

For acting as yourself — everything your account can do, including owner-only operations (create / delete / rename rooms, invite members, mint API tokens, read your account). A signed-in browser session exchanges its OIDC cookie for a short-lived JWT:

GET /api/auth/token

{ "token": "<jwt>" }. The JWT is short-lived and refreshed automatically in the app.

For scripts and external tools that push data into (or pull it from) one room, with no browser session. You mint it once as the room owner and use it directly. Room tokens are room-scoped and limited to data operations — see Room API Tokens.

A room token is accepted only on the room-scoped data endpoints it’s explicitly allowed to reach. Present it anywhere else and the request is rejected with 403 api_token_not_allowed — by design. A token used against a different room, or without the required permission, likewise gets a 403. The full allowlist is on the Room API Tokens page.

Real-time collaboration runs over a separate Yjs WebSocket (wss://collmap.com/ws). The WebSocket is JWT-only — API tokens have no WebSocket path; token writes reach the live document through the REST endpoints and propagate from there.