Remove an address

DELETE /api/v1/settings/identities/{identityId} Removes an address from the book. Admin role required. Two refusals worth knowing before you call: deleting the default while other addresses remain (promote another one first), and deleting an address a campaign references — the campaigns are named in the error, whatever their status. Deleting the last address is allowed: an organization with an empty book falls back to the shared AgentsMail address, as long as no domain is verified.

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 remove

Example

bash
curl -X DELETE -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/settings/identities/$IDENTITY_ID"

Response

  • 200 OK — the call succeeded.
  • 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

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.deletedbooleantrue when the address is gone

Example response

json
{"success": true, "data": {"deleted": true}}