Add an Agent Mail address
Adds one address to the workspace. Two forms:
{ "previewId": "…" }confirms a quote fromPOST /v1/emails/addresses/preview. A paid address ($2/mo) is charged to the saved card now; an included one (one per paid Lusor Phone,free: trueon the quote) is not charged.{}adds an address included with the workspace’s Lusor Phones, without a quote. It needs anIdempotency-Key. If no included address is left the answer is402 inbox_payment_required: preview its price instead.
Either form may name the address’s username (the part before the
@); without one the address gets a generated name. A
quote previewed with a username confirms only with that same
username (otherwise 409 preview_expired). A name taken since the
quote is 409 username_taken before any charge; one taken in the last
instant is refused after the charge and the charge is reversed.
Callers: an API key for the workspace, or a tenant administrator.
Retries: safe. With a previewId and no Idempotency-Key, the
quote itself is the request key, so a confirmed quote replays its
stored receipt (created: false) and never charges twice. With a
key, a repeat with the same key returns the same address.
curl --request POST \
--url https://api.lusor.ai/v1/emails/addresses \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"previewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "alice.smith"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({previewId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', username: 'alice.smith'})
};
fetch('https://api.lusor.ai/v1/emails/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/emails/addresses"
payload = {
"previewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "alice.smith"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"status": "<string>",
"quantity": 123,
"paymentPending": false,
"created": true,
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}{
"error": "validation_error",
"details": {}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Headers
Query Parameters
Body
The address's name before the @, case-insensitive (stored
lowercase). 3–30 characters of a-z, 0-9, ., _, -, starting
and ending with a letter or digit, never two of ., _, - in a row.
Unique across all workspaces, deleted addresses included. Reserved
names (e.g. admin, postmaster, support, noreply) are refused.
Omit it for a generated name.
1 - 255"alice.smith"
Was this page helpful?
curl --request POST \
--url https://api.lusor.ai/v1/emails/addresses \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"previewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "alice.smith"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({previewId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', username: 'alice.smith'})
};
fetch('https://api.lusor.ai/v1/emails/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/emails/addresses"
payload = {
"previewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "alice.smith"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"status": "<string>",
"quantity": 123,
"paymentPending": false,
"created": true,
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}{
"error": "validation_error",
"details": {}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}
