Skip to Content
Won.dev
DocumentationAPI reference
Cold email API

Approve emails

Let emails that wait for approval go out, as written. Free.

Approves emails that wait for approval (pending_approval): each goes out as written, from its mailbox, as soon as that mailbox may send and the recipient is in office hours. One that is not waiting, such as one approved already, stays as it is (done: false). A key that is set to ask for approval cannot approve (forbidden): a person does, in the console. Free.

  • Billing: The call is free, and so are the emails: they go out from the sender's sending domains, paid for by the month, see Sending domains.

A test key (won_test_...) runs this in the sandbox: nothing is sent and nothing is charged.

POST
/email/messages/approve

Authorization

apiKey
headerAuthorizationBearer <API key>

Authorization: Bearer won_live_..., a key from the console.

Header Parameters

Idempotency-Key?string

Any unique string. A retry with the same key and the same body returns the first response and is not charged again.

Lengthlength <= 255

Request Body

application/json
  1. body
message_ids*array<>

Up to 100 email IDs, such as msg_3e5r4k2m9x7p1q8w, from GET /email/messages?status=pending_approval.

Items1 <= items <= 100

Response Body

The result.

application/json
  1. response
data*array<>

One result per ID, in the order given.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

Example Request
curl -X POST 'https://api.won.dev/v1/email/messages/approve' \  -H 'Content-Type: application/json' \  -d '{  "message_ids": [    "msg_3e5r4k2m9x7p1q8w"  ]}'
Example Response
{  "data": [    {      "id": "msg_3e5r4k2m9x7p1q8w",      "done": true,      "status": "approved"    }  ],  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}