DELETE /api/v1/domains/{domainId}
Removes the declaration. Admin role required.
The underlying sending identity is kept: another organization may have declared the same
domain, and a verified identity is expensive to rebuild.
Removing a domain removes what its addresses stood on — a campaign whose sender is no longer on a
verified domain stops going out, and the refusal names it.
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Path parameters
| Parameter | Type | Description |
|---|---|---|
domainId | string | Required. The declaration to remove |
Example
bash
curl -X DELETE -H "x-api-key: $AGENTMAIL_API_KEY" \
"https://www.agentsmail.io/api/v1/domains/$DOMAIN_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 amemberof the organization, not anadmin.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
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.deleted | boolean | true when the declaration is gone |
Example response
json
{"success": true, "data": {"deleted": true}}