xmark API

chat with your x bookmarks

base URL

https://www.xmark.dev/api/v1
llms.txtllms-full.txtOpenAPI

the xmark API uses REST conventions with JSON request and response bodies. all endpoints require authentication via API key.

responses follow a consistent shape: { data: ... } for success and { error: { code, message, requestId } } for errors.

authentication

all API requests must include your API key in the Authorization header. keys are prefixed with nt_live_ and shown exactly once at creation — store them in a secret manager, never commit them.

header format

http
Authorization: Bearer nt_live_YOUR_API_KEY

verify your key

any valid key can call GET /keys/me to introspect itself — useful for confirming a key works and seeing its scopes.

bash
curl "https://www.xmark.dev/api/v1/keys/me" \
  -H "Authorization: Bearer nt_live_YOUR_API_KEY"

scopes

each API key carries a set of scopes. grant the minimum needed — an admin key can create other keys and manage webhooks, so treat it as a root credential.

scopedescription
readread-only access to owned resources
writecreate and update owned resources
deletedelete owned resources
adminmanage API keys and webhook endpoints

default scopes (if none specified): read, write.

API reference

bookmarks

read, search, and sync the authenticated user's X bookmarks.

paginated list of the caller's bookmarks, newest first

fetch a single bookmark

remove a bookmark. local-only by default (the next sync re-creates anything still bookmarked on X); pass unbookmark=true to also remove it on X

semantic search over the caller's bookmark library (pgvector + OpenAI embeddings)

pull the latest bookmarks from the connected X account, embed new ones, and store them

chat

ask natural-language questions about bookmarks; Claude answers with citations grounded in them.

submit a question. xmark retrieves the most relevant bookmarks via semantic search and has Claude generate an answer with inline citations. returns a single JSON response

conversations

list, read, and delete past chat conversations.

paginated list of the caller's conversations, most recently active first

the conversation's message history, oldest first. assistant messages carry the IDs of the bookmarks retrieved for that answer

permanently delete a conversation and its messages

usage

plan and quota usage for the authenticated user.

the caller's plan, chat-message usage this month, syncs today, bookmark count, and whether an X account is connected. limits are null on unlimited plans

error handling

errors are returned as JSON with code, message, optional field, and requestId. the X-Request-ID response header carries a per-request trace id — include it when contacting support.

json
{
  "error": {
    "code": "SERVER_005",
    "message": "name must be under 100 characters",
    "field": "name",
    "requestId": "req_abc123"
  }
}
authentication
codeHTTPdescription
AUTH_001401missing or invalid authorization header
AUTH_002403API key missing required scope
AUTH_004401invalid or revoked API key
billing
codeHTTPdescription
BILLING_001402no active subscription
BILLING_006402plan usage limit reached (402 on chat quota, 429 on sync rate)
BILLING_007402subscription required for this operation
BILLING_008403current plan does not include this feature
rate limiting
codeHTTPdescription
RATE_001429too many requests - back off and retry
validation & server
codeHTTPdescription
SERVER_001500internal server error
SERVER_002400bad request (malformed body or missing field)
SERVER_003404resource not found
SERVER_004405method not allowed
SERVER_005400validation failed
SERVER_008500database error
SERVER_012409conflict (e.g. concurrent modification)
webhooks
codeHTTPdescription
HOOK_001401invalid webhook signature
HOOK_002500webhook processing failed
HOOK_004408webhook delivery timed out