Skip to content

Developer API

Integrate anon.li directly into your applications using our secure REST APIs.

anon.li provides developer-friendly REST APIs for both email aliasing and encrypted file sharing. Build privacy-first applications with secure email forwarding and zero-knowledge file encryption.

Getting Started

1. Create an API Key

Generate an API key in your Dashboard. Your key will start with ak_ and should be kept secret. API keys are created and deleted from your signed-in dashboard session; an existing API key cannot create or delete other API keys.

2. Authenticate Requests

Include your API key in the Authorization header:

Code
Authorization: Bearer ak_your_api_key_here

3. Choose Your API

Base URL

All API endpoints are relative to:

Code
https://anon.li/api/v1

Conventions

Every endpoint under /api/v1 follows the same contract. The one exception is POST /api/v1/aliases, which keeps the request and error shape Bitwarden's addy.io integration expects (see the Alias API).

Response envelope

A successful response carries the result in data:

Code
{
  "data": { "id": "cuid...", "email": "[email protected]" },
  "meta": { "request_id": "req_1234567890abcdef" }
}

A list adds pagination to meta. has_more tells you whether another page exists:

Code
{
  "data": [{ "id": "..." }],
  "meta": { "request_id": "req_1234567890abcdef", "total": 120, "limit": 50, "offset": 0, "has_more": true }
}

Every response, success or error, also carries the request ID in the X-Request-Id header. Include it when you contact support.

Field names

Request bodies, response fields and query parameters are snake_case. A request body with a field the endpoint doesn't define is rejected. Timestamps are ISO 8601 strings in UTC. Byte counts that can exceed 2^53 (storage totals, file sizes in lists) are decimal strings.

Pagination

Paginated lists take limit (1–100, default 50) and offset (default 0). An out-of-range value is a validation error, not silently clamped. Small, bounded collections (domains, recipients, API keys) return everything as one page.

Status codes

StatusMeaning
200Success. A DELETE that removed a resource answers { "id": "...", "deleted": true }
201A resource was created
400The request is invalid (see below)
401Missing or invalid credentials
402Your plan doesn't cover the request
403Authenticated, but not allowed
404The resource doesn't exist, or isn't yours
409The request conflicts with the resource's current state
410The resource is permanently unavailable
429Rate limited; retry after Retry-After seconds
503A dependency is unavailable; retry after Retry-After seconds

Errors

Every error has the same shape:

Code
{
  "error": {
    "message": "Validation failed",
    "code": "VALIDATION_ERROR",
    "details": [{ "field": "recipient_email", "message": "Invalid email address" }]
  },
  "meta": { "request_id": "req_1234567890abcdef" }
}

Branch on code; message is written for people and may change. When a request fails validation, message is Validation failed and details lists each problem with its field path (files.0.chunk_index); malformed JSON is reported against the field body.

When a plan limit refuses a request, details.upgrade says which limit and what to upgrade to:

Code
{
  "error": {
    "message": "Random alias limit reached (10). Upgrade to add more.",
    "code": "UPGRADE_REQUIRED",
    "details": {
      "upgrade": {
        "scope": "alias_random",
        "current_tier": "free",
        "suggested_tier": "plus",
        "current_value": 10,
        "limit_value": 10
      }
    }
  },
  "meta": { "request_id": "req_1234567890abcdef" }
}
CodeStatusMeaning
VALIDATION_ERROR400The request is invalid; see details
INVALID_REQUEST400The request doesn't apply to this resource
UNAUTHORIZED401Missing or invalid API key, session or upload token
UPGRADE_REQUIRED402A plan limit, or a team without an active Business subscription
FORBIDDEN403Not allowed (team role, ban, wrong form password, ...)
NOT_FOUND404Doesn't exist or isn't yours
CONFLICT409Already exists, or a stale vault generation
DROP_NOT_READY409The drop is still uploading
DROP_DISABLED403The drop's owner disabled it
DROP_EXPIRED410The drop expired
DOWNLOAD_LIMIT_REACHED410The drop (or recipient) has no downloads left
TAKEN_DOWN410Removed for a policy violation
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Something went wrong on our side
SERVICE_UNAVAILABLE503A dependency is unavailable

A few endpoints add codes of their own, such as DNS_LOOKUP_FAILED (503) when domain verification can't reach DNS; their pages list them.

Security Features

  • API Key Authentication - Secure Bearer token authentication
  • Rate Limiting - Protection against abuse with per-endpoint limits
  • Monthly API Quotas - API-key requests count against your Alias, Drop or Form monthly API quota; dashboard actions use separate abuse-prevention limits
  • End-to-End Encryption - Drop files are encrypted client-side before upload
  • Zero-Knowledge File Sharing - Drop keys stay client-side and do not reach our servers
  • Vault-Wrapped Recovery - CLI clients can store only vault-wrapped Drop owner keys and encrypted Alias metadata
  • Transient Email Forwarding - Alias forwards mail to your inbox instead of providing hosted mailbox storage

Rate Limits

Rate limits vary by endpoint. When you exceed one, the response is 429 with code RATE_LIMITED and these headers:

Code
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1699999999999
Retry-After: 3600

X-RateLimit-Reset is a Unix timestamp in milliseconds; Retry-After is in seconds. API-key requests also count against your plan's monthly API quota per product; Get Account reports it as limits.api_requests_per_month.

Need Help?