# Send your first email

Verify a domain, create a scoped key and send transactional email from your application server.

Source: https://docs.ravenrelay.joshlab.site/

Agent index: https://docs.ravenrelay.joshlab.site/llms.txt
OpenAPI: https://docs.ravenrelay.joshlab.site/openapi.json

## Before you start

RavenRelay handles queued sending, delivery events and signed webhooks through one API. You need an account, a project and a domain whose DNS you can edit.

> Start with a development project. Test keys deliver real emails only to exact verified domains connected to that project. All To, CC and BCC recipients must be allowed. Delivery events and webhooks are enabled.

## Verify your sending domain

1. Open the dashboard and create or select your project.
2. In Domains, add the exact domain you will send from, such as example.com.
3. Publish the generated DKIM CNAME records and the MX and SPF records for raven.example.com.
4. Refresh verification until the identity, DKIM and MAIL FROM are ready.

Subdomains are separate sending identities. Verifying example.com does not authorize hello@mail.example.com. DMARC is detected separately and does not require an enforcement policy.

## Create an API key

In API Keys, create a key for the selected project. Save the secret when it is shown; you cannot retrieve it later. A development project issues an rr_test_ key. Store it only in your application server's environment.

Server environment

```
RAVENRELAY_API_KEY=your_test_api_key
```

> The example addresses below are placeholders. Replace the sender and recipients with verified domains connected to your development project before running the request.

## Submit a message

cURL

```
curl https://api-production-1c6a.up.railway.app/v1/emails \
  -H "Authorization: Bearer $RAVENRELAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: welcome-user-123' \
  -d '{
    "from": "hello@example.com",
    "to": ["user@example.com"],
    "subject": "Welcome",
    "text": "Hello from RavenRelay"
  }'
```

HTTP 202 · example response

```
{
  "id": "your-email-id",
  "status": "queued",
  "test_mode": true
}
```

HTTP 202 means the request has been stored for asynchronous processing. In Emails, open the returned ID to inspect its timeline. Development messages deliver through RavenRelay when every recipient belongs to a verified domain connected to the project.

## Move to live sending

Use a production project and an rr_live_ key. A trusted operator must activate the workspace after reviewing the owner and use case. Your domain must be ready, and delivery provider account restrictions and quotas still apply.

Create your webhook before the first live send, then send one controlled message to an address you own. Sent means the delivery provider accepted it; delivered means the recipient's mail server accepted it, not that it reached the inbox.
