Edit or promote an address

PATCH /api/v1/settings/identities/{identityId} Changes an address or its display name, or promotes it as the organization default. Admin role required.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Path parameters

ParameterTypeDescription
identityIdstringRequired. The address to change

Request body

FieldTypeRequiredDescription
senderEmailstringnoNew address — same domain rule as when adding one
senderNamestringnoNew display name
isDefaultbooleannotrue promotes it. false is refused: promote another address instead

Example

bash
curl -X PATCH -H "x-api-key: $AGENTMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"isDefault": true}' \
  "https://www.agentsmail.io/api/v1/settings/identities/$IDENTITY_ID"

Response

  • 200 OK — the call succeeded.
  • 400 Bad Request — validation failed; details carries the field-level issues.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 403 Forbidden — the key's owner is a member of the organization, not an admin.
  • 404 Not Found — no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

The address after the change, same shape as the address book.
There is exactly one default. Promoting an address demotes the previous one in the same operation — you never have to clear it first.
FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringUnchanged
data.senderEmailstringThe address
data.senderNamestring \null
data.isDefaultbooleantrue if this call promoted it
data.createdAtstringISO creation date

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "senderEmail": "hello@mail.example.com",
    "senderName": "Example",
    "isDefault": true,
    "createdAt": "2026-08-23T10:22:05.000Z"
  }
}