Create and manage email aliases programmatically using the Alias API.
The Alias API allows you to create and manage email aliases programmatically. Use it to generate unique forwarding addresses for your users or integrate email aliasing into your applications.
Authentication
All API requests must be authenticated using an API Key. Generate keys in your Dashboard.
Code
Authorization: Bearer ak_your_api_key_here
Base URL
Code
https://anon.li/api/v1
Bitwarden Integration
anon.li is compatible with Bitwarden's email alias generator. To configure:
Open Bitwarden Settings → Options → Username Generator
The part before the @ (e.g., netflix in alias@anon.li). Required when format is custom.
domain
string
No
The domain for the alias (default: anon.li).
format
string
No
Alias format: random_characters, random_words, uuid, or custom. Default: random_characters.
recipient_ids
string[]
No
Array of verified recipient IDs for multi-recipient routing. The first ID is primary. Limits are 1 on Free, 3 on Plus, and 5 on Pro.
recipient_email
string
No
Alternatively, specify a verified recipient by email address.
Alias labels and notes are vault-encrypted. Plaintext metadata fields (description, label, and note) are not accepted by the API. Create the alias first, then update encrypted_label or encrypted_note with ciphertext produced by a compatible vault client.
Vault-encrypted alias label envelope. Send null to clear it.
encrypted_note
string | null
No
Vault-encrypted alias note envelope. Send null to clear it.
recipient_id
string
No
Change the forwarding destination by recipient ID. The recipient must be verified.
recipient_ids
string[]
No
Replace the full recipient list for multi-recipient routing. The first ID is primary.
recipient_email
string
No
Change the forwarding destination by verified recipient email address.
The encrypted metadata envelope is versioned JSON: {"v":1,"alg":"AES-256-GCM","iv":"...","ct":"..."}. Encrypt labels and notes with the caller's unwrapped vault key and AES-GCM additional data anon.li:alias-metadata:v1:<aliasId>:label or anon.li:alias-metadata:v1:<aliasId>:note. Plaintext description, label, and note updates return 400.
# Change which inbox this alias forwards to using a recipient ID
curl -X PATCH https://anon.li/api/v1/alias/cuid... \
-H "Authorization: Bearer ak_..." \
-H "Content-Type: application/json" \
-d '{ "recipient_id": "rec_def456" }'
# Or specify the recipient by email address
curl -X PATCH https://anon.li/api/v1/alias/cuid... \
-H "Authorization: Bearer ak_..." \
-H "Content-Type: application/json" \
-d '{ "recipient_email": "work@company.com" }'
Tip: The recipient must already be verified before you can assign it to an alias. See the Recipient API to add and verify recipients, or refer to the common workflow for a step-by-step guide.