MailgentMailgent
API Reference

Errors

API error codes and responses

All errors follow a consistent format:

{
  "error": "error_code",
  "message": "Human-readable description",
  "status": 400
}

Error Codes

StatusError CodeDescription
400bad_requestMissing or invalid request body
401unauthorizedMissing, invalid, or expired API key
403forbiddenAPI key lacks required scope
404not_foundResource not found or not accessible
500internal_errorServer error

Common Scenarios

Missing required field

{
  "error": "bad_request",
  "message": "to, subject, and text are required",
  "status": 400
}

Message not found

{
  "error": "not_found",
  "message": "Message not found",
  "status": 404
}

This also occurs when trying to access a message that belongs to a different identity.

Scope violation

{
  "error": "forbidden",
  "message": "Missing required scope: mail:send",
  "status": 403
}

On this page