First send via API
You need
Section titled “You need”- A project with a connected domain and an approved sender address.
- An API key for that project. It is shown once when you create it; store it in your secret manager right away. Creating a key asks for your second factor.
- The API base URL and stream ID shown on the project’s API page.
curl -sS "$WENEED_API_URL/v1/emails" \ -H "Authorization: Bearer $WENEED_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: signup-7f3c2a91-welcome" \ -d '{ "stream_id": "YOUR-STREAM-ID", "from": { "email": "hello@yourdomain.com", "name": "Your App" }, "to": [ { "email": "person@example.com" } ], "subject": "Welcome", "text": "Thanks for signing up." }'The response is 202 with a message ID. That means the message is stored and queued. Open the
message in your dashboard to follow delivery.
The idempotency key matters
Section titled “The idempotency key matters”Idempotency-Key is required: 16 to 128 printable characters that name this one intent, for
example the sign-up event’s ID. If the request times out, send it again with the same key and
the same body. You get the original message back instead of a duplicate.
Never generate a new key for a retry. Read Retries and duplicates.
Optional fields
Section titled “Optional fields”| Field | Use |
|---|---|
html |
HTML body. Send text, html or both. |
reply_to |
One reply address. Verifying a domain doesn’t create a mailbox, so use an inbox that exists. |
expires_at |
Don’t send after this time. Useful for one-time codes. |
tags |
Up to 10 key–value pairs for your own filtering. |
See the API reference for every endpoint and response code.