Nest Authbeta
API ReferenceEndpointsAdmin-blocked-email-domains

POST /auth/admin/api/blocked-email-domains

Add one or more blocked domains

Add one or more blocked domains

POST/auth/admin/api/blocked-email-domains

Request body

AdminAddBlockedDomainsDto

FieldTypeRequiredDescription
domainsstring[]requiredOne or more email domains to block (e.g. ["mailinator.com", "guerrillamail.com"]). Max 1000 per request; each max 253 chars.
Example: ["mailinator.com","guerrillamail.com"]

Examples

Example
{
  "domains": [
    "mailinator.com",
    "guerrillamail.com"
  ]
}

Responses

201{ added, skipped }
400Validation failed (bad input).

ApiErrorResponseDto

FieldTypeRequiredDescription
statusCodenumberrequiredHTTP status code
Example: 401
errorstringrequiredHTTP status text / exception name
Example: Unauthorized
messagestringrequiredHuman-readable message
Example: Invalid credentials
codestringrequiredStable, machine-readable error code — branch on this, not the message
Example: INVALID_CREDENTIALS

Example response

{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid credentials",
  "code": "INVALID_CREDENTIALS"
}
401Admin session missing or invalid.

ApiErrorResponseDto

FieldTypeRequiredDescription
statusCodenumberrequiredHTTP status code
Example: 401
errorstringrequiredHTTP status text / exception name
Example: Unauthorized
messagestringrequiredHuman-readable message
Example: Invalid credentials
codestringrequiredStable, machine-readable error code — branch on this, not the message
Example: INVALID_CREDENTIALS

Example response

{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid credentials",
  "code": "INVALID_CREDENTIALS"
}
403Authenticated but not permitted.

ApiErrorResponseDto

FieldTypeRequiredDescription
statusCodenumberrequiredHTTP status code
Example: 401
errorstringrequiredHTTP status text / exception name
Example: Unauthorized
messagestringrequiredHuman-readable message
Example: Invalid credentials
codestringrequiredStable, machine-readable error code — branch on this, not the message
Example: INVALID_CREDENTIALS

Example response

{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid credentials",
  "code": "INVALID_CREDENTIALS"
}

Try it

curl -X POST 'https://api.example.com/auth/admin/api/blocked-email-domains' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -d '{"domains":["mailinator.com","guerrillamail.com"]}'

On this page