Purl

API Reference

The Purl REST API lets you save, read, update, and delete links programmatically. All endpoints are authenticated with an API key and return JSON.

Base URL: https://purl.nublson.com/api/v1

Using an AI client? Connect over MCP instead.

Authentication

All API requests require a Bearer token in the Authorization header. Generate an API key in your Purl settings under Settings → API Keys.

http
Authorization: Bearer purl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

API keys are scoped to your account. Keep them secret — do not expose them in client-side code or public repositories.

All /api/v1 endpoints include Access-Control-Allow-Origin: * headers, so they can be called directly from browser environments.

Rate Limiting

The API is rate-limited per account. When exceeded, requests return 429 Too Many Requests. Respect the Retry-After response header.

Endpoints

API Keys

GET/keys

Returns all API keys for your account. Key values are never returned after creation — only the prefix and metadata.

curl
curl https://purl.nublson.com/api/v1/keys \
  -H "Authorization: Bearer purl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
json
[
  {
    "id": "key_abc123",
    "name": "My App",
    "start": "purl_xxxx",
    "createdAt": "2025-06-01T09:00:00.000Z"
  }
]
POST/keys

Creates a new API key. The full key value is returned only once in the response — store it immediately.

ParameterTypeDescription
namestringA label for this key (e.g. "My App"). Defaults to "API Key".
curl
curl -X POST https://purl.nublson.com/api/v1/keys \
  -H "Authorization: Bearer purl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "My App"}'

Response — 201 Created

json
{
  "id": "key_abc123",
  "name": "My App",
  "key": "purl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "start": "purl_xxxx",
  "createdAt": "2025-06-05T12:00:00.000Z"
}

The full key value is only returned once — store it immediately. It cannot be retrieved again.

DELETE/keys/:id

Revokes an API key. Returns 204 No Content on success. This action is irreversible.

curl
curl -X DELETE https://purl.nublson.com/api/v1/keys/key_abc123 \
  -H "Authorization: Bearer purl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Error Codes

All errors return JSON with an error field. Some errors include an additional code field.

ParameterTypeDescription
400Bad RequestMissing or invalid request body / parameters.
401UnauthorizedMissing, invalid, or expired API key.
402Payment RequiredPlan limit reached. Check code: LIMIT_REACHED and feature fields.
404Not FoundThe requested resource does not exist or belongs to another account.
429Too Many RequestsRate limit exceeded. Retry after the Retry-After header value.
500Internal Server ErrorUnexpected server error. Contact support if it persists.
json
{
  "error": "Plan limit reached",
  "code": "LIMIT_REACHED",
  "feature": "ai_extractions"
}