Skip to main content

Base URL

All API requests should be made to:
https://api.prefid.dev/v1

Authentication

All API requests require an access token obtained via OAuth 2.0:
curl -X GET "https://api.prefid.dev/v1/preferences" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Rate Limits

PlanRate Limit
Free100 requests/minute
Pro1,000 requests/minute
EnterpriseCustom
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1703012400

Response Format

All responses are JSON:
{
  "success": true,
  "data": { ... },
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2024-12-19T10:30:00Z"
  }
}

Error Responses

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired access token",
    "details": null
  },
  "meta": {
    "request_id": "req_abc123"
  }
}

Error Codes

CodeHTTP StatusDescription
UNAUTHORIZED401Invalid or expired token
FORBIDDEN403Insufficient scopes
NOT_FOUND404Resource not found
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Server error

Pagination

List endpoints support pagination:
GET /v1/preferences/atoms?limit=20&offset=0
Response includes pagination info:
{
  "data": [...],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 150,
    "has_more": true
  }
}

Endpoints Overview