Documentation

Approvals

A key that drafts instead of sends, and the queue a person releases from.

An API key can be marked as requiring approval. A send from it is persisted and visible, but nothing goes out until a person releases it. This is the safety valve for giving an autonomous agent a sending credential: without it the choices are trusting the agent completely or not giving it email at all.

Marking a key

Set it when creating the key in the dashboard under API keys, or with requires_approval: true on POST /v1/api-keys. Creating keys over the API needs domains:write, the closest thing to an administrative scope: a key that can only send must not be able to mint one that can do more. A key cannot grant scopes it does not hold, and a key with guardrails of its own can only create keys at least as restricted, so a held key can only make held keys. See API keys.

{
  "name": "support-agent",
  "scopes": ["emails:send", "emails:read", "threads:read"],
  "requires_approval": true,
  "daily_send_limit": 50
}

What the agent sees

POST /v1/emails from such a key still returns 202, with status: "pending_approval" and an approval_id. The message exists in the log with status queued. The plan allowance, the recipient allowlist, the daily cap, the sending domain, the postal address for marketing mail, suppression, topic opt-outs and scheduled_at are all checked first, the recipient checks for every address in to, cc and bcc, so a send that would have been refused is refused rather than queued for someone to reject. The draft counts against the key's daily cap as soon as it is held, whatever the decision.

That status is not an error and there is nothing to retry: sending again queues a second draft. Replaying the same Idempotency-Key with the same body returns the same held response.

{
  "id": "…",
  "status": "pending_approval",
  "thread_id": "…",
  "scheduled_at": null,
  "skipped": false,
  "reason": null,
  "approval_id": "…"
}

The queue

GET /v1/approvals (scope emails:read) lists what is waiting, oldest first, each with id, message_id, api_key_id, created_at, expires_at and the message (to, subject, text, html) so a reviewer can read it in place. from, cc, bcc, reply_to, attachments and the scheduled time are not part of it, so a reviewer working from this list does not see who else a draft is copied to. An approval expires 72 hours after it was requested and drops out of the list, so a forgotten draft never goes out days later, out of context; its message is then marked canceled.

Deciding

POST /v1/approvals/{id} (scope emails:send) takes a decision of approve or reject, a decided_by naming who authorised it, and an optional reason. Approving sends the message immediately and returns status: "approved" with the message_id and scheduled_at: null. If the held send carried a scheduled_at still in the future, approving places it on the schedule instead and the response carries that scheduled_at; a hold cannot be walked around by scheduling. Rejecting marks the message canceled and returns status: "rejected" with the message_id. Both answers carry the same fields, id, status, message_id, scheduled_at, skipped and reason, with null or false where there is nothing to say.

The key that made a draft cannot decide it, neither can any key with guardrails of its own (requires_approval, a non-empty allowed_recipients or a daily_send_limit), and neither can an OAuth access token: all three get 403 forbidden. The reviewer is a person in the dashboard, or an API key without guardrails. A hold the held key could lift would not be a hold. A key with guardrails is one someone configured for an agent, and an OAuth token is what an MCP client holds after signing in, so both are an agent's credential.

A draft can wait days, so approving checks suppressions and topic opt-outs again for every recipient, and the plan allowance. Someone who unsubscribed, hard-bounced or complained while the draft waited is dropped; if no to address is left, nothing is sent and the response says skipped: true with a reason.

A released message keeps its thread and its In-Reply-To header, and clears the thread's awaiting_reply once it is sent.

curl -X POST https://api.sendraven.ai/v1/approvals/$APPROVAL_ID \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision": "approve", "decided_by": "ana@example.com"}'

Once, not twice

A release takes the approval for itself before it sends, so two reviewers clicking at the same moment, or one double-clicking, cannot release the same message twice: the second gets 409 approval_in_progress while the first is sending, and 409 invalid_state once it has finished.

The approval is recorded as approved only when the release works. If it fails, the call answers with what stopped it (502 ses_error for the provider, 402 plan_limit_reached, 422 workspace_suspended, 422 no_postal_address, 422 warmup_limit, 422 no_verified_identity for a deleted sending domain, 409 invalid_state for a message that is no longer a held draft, 404 not_found when the message itself is gone) and the approval stays pending, so it can be approved again once the cause is fixed.

What an agent should do with a held response

Report that the message awaits review, with its approval_id, and stop. Do not retry, do not send it from a different key or to a different spelling of the address, and do not call decide_approval unless a human has explicitly said which decision to make. The hold exists precisely so that the agent is not the one deciding.

On this page