# Quickstart

## 1. Get a test key [#1-get-a-test-key]

In Relevate, open the workspace menu and choose **Advanced → Email test mode**.
Then go to **Workspace settings → API keys** and make a key with *Send service email*. It
starts with `rlvt_test_`: email sent with it is simulated, never delivered.

```bash
export RELEVATE_API_KEY=rlvt_test_...
export RELEVATE_API_URL=https://api.relevate.app
```

## 2. Send an email [#2-send-an-email]

```bash
curl "$RELEVATE_API_URL/email/emails" \
  -H "Authorization: Bearer $RELEVATE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-1" \
  -d '{
    "from": "Acme <hello@acme.test>",
    "to": "you@example.com",
    "subject": "Hello from Relevate",
    "html": "<p>It works.</p>"
  }'
```

The answer is the email, with an `id` and a `state` for each recipient.

## 3. Check what happened [#3-check-what-happened]

```bash
curl "$RELEVATE_API_URL/email/emails/<id>/events" \
  -H "Authorization: Bearer $RELEVATE_API_KEY"
```

In test mode the email is "delivered" within moments. Send to
`bounced@test.relevate.app` to see a bounce.

## 4. Go live [#4-go-live]

1. [Set up your domain](/docs/email/domains).
2. Leave test mode and make a live key (`rlvt_live_`).
3. Send from an address on your verified domain.

Next: [Sending](/docs/developers/sending), [Templates from code](/docs/developers/templates),
[Webhooks](/docs/developers/webhooks).
