SecureAgentMail

Reject

Rejects a pending approval request. The withheld message will not be sent. An optional reason can be provided for audit purposes.

POST
/approvals/{approval_id}/reject

Authorization

BearerAuth
AuthorizationBearer <token>

API key passed as a Bearer token. Production keys start with am_live_ and sandbox keys start with am_test_.

In: header

Path Parameters

approval_id*string

The unique approval ID (prefixed with apr_).

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

reason?string

Optional human-readable reason for the rejection.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://secureagentmail.com/api/v1/approvals/string/reject" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "apr_n3m8k1",
  "status": "rejected",
  "reviewed_by": "usr_j4k2l9",
  "reason": "Message contains unapproved discount offer.",
  "message_id": "msg_x7k9m2",
  "resolved_at": "2026-02-25T11:00:00Z"
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key.",
    "status": 401
  }
}
{
  "error": {
    "code": "not_found",
    "message": "The requested resource was not found.",
    "status": 404
  }
}
{
  "error": {
    "code": "validation_error",
    "message": "The 'slug' field is required and must be a valid identifier.",
    "status": 422
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Please retry after 30 seconds.",
    "status": 429
  }
}