# Quickstart

> Send your first email in under five minutes.

This guide takes you from a new account to a delivered email. You only need a terminal or any language that can make an HTTP request.

## Send your first email

1. **Create an API key**: Open [API Keys](https://sendtern.com/dashboard/api-keys) in the dashboard and create a key with **Sending only** access. The key is shown once, so copy it right away.

2. **Store the key**: Keep the key out of your code. Put it in an environment variable named `SENDTERN_API_KEY`.

```
# .env
SENDTERN_API_KEY=st_your_api_key
```

3. **Send the request**: Make a `POST` request to `/emails`. Replace the example sender with an address on your [verified domain](https://sendtern.com/docs/domains), and use a recipient address you control.

```
curl -X POST 'https://sendtern.com/emails' \
  -H 'Authorization: Bearer st_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "Acme <hello@mail.example.com>",
  "to": [
    "you@example.com"
  ],
  "subject": "Hello from Sendtern",
  "html": "<p>It works!</p>"
}'
```

```
const res = await fetch("https://sendtern.com/emails", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SENDTERN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "from": "Acme <hello@mail.example.com>",
    "to": [
      "you@example.com"
    ],
    "subject": "Hello from Sendtern",
    "html": "<p>It works!</p>"
  }),
});

const data = await res.json();
```

```
import os
import requests

res = requests.post(
    "https://sendtern.com/emails",
    headers={"Authorization": f"Bearer {os.environ['SENDTERN_API_KEY']}"},
    json={
      "from": "Acme <hello@mail.example.com>",
      "to": [
        "you@example.com"
      ],
      "subject": "Hello from Sendtern",
      "html": "<p>It works!</p>"
    },
)

print(res.json())
```

4. **Watch it deliver**: The response contains the email `id`. Open [Emails](https://sendtern.com/dashboard/emails) to watch it move from **queued** to **delivered**, with the remote server's reply for every step.

```
{
  "id": "47be30ca-24b7-48fb-b35d-ff287b89e66d"
}
```

> **tip:** Building with an AI tool? Point it at [/llms.txt](https://sendtern.com/llms.txt) and it will find every page of these docs as plain text.

## Next steps

- [Add a domain](https://sendtern.com/docs/domains): Send from your own address to anyone.
- [Idempotency](https://sendtern.com/docs/idempotency): Retry safely without duplicate emails.
- [Send email reference](https://sendtern.com/docs/api-send-email): Every field the endpoint accepts.
