# Quickstart

> Send your first email with the Sendtide API in five minutes: create a key, send with curl, Node.js, Python or PHP and check the status. The test key never delivers.

URL: https://sendtide.ch/en/docs/quickstart/

From zero to your first email in five minutes. The test key never delivers anything, so you can practise safely.
## 1. Create a key

Create an account at [sendtide.ch](https://sendtide.ch/en-ch/sign-up/) and add a test key under “Keys” in the dashboard. It starts with sk_test_ and accepts, renders and logs emails but never delivers them. The key is shown only once. Keep it in an environment variable:

```
export SENDTIDE_API_KEY=sk_test_…
```

All requests go to https://api.sendtide.ch/v1 and carry the key as a bearer token. More about keys and permissions in [Authentication](https://sendtide.ch/en/docs/authentication/).
## 2. Send your first email

With a test key you may send from any address. Live keys need a [verified domain](https://sendtide.ch/en/docs/domains/) for the sender.

```
curl https://api.sendtide.ch/v1/emails \
  -H "Authorization: Bearer $SENDTIDE_API_KEY" \
  -H "Idempotency-Key: welcome-4821" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@example.com>",
    "to": "anna@example.org",
    "subject": "Welcome to Acme",
    "html": "<p>Hello Anna, great to have you.</p>"
  }'
```

```
// npm install sendtide
import { Sendtide } from "sendtide";

const sendtide = new Sendtide({ apiKey: process.env.SENDTIDE_API_KEY });

const { id, status } = await sendtide.emails.send(
  {
    from: "Acme <hello@example.com>",
    to: "anna@example.org",
    subject: "Welcome to Acme",
    html: "<p>Hello Anna, great to have you.</p>",
  },
  { idempotencyKey: "welcome-4821" },
);
console.log(id, status);
```

```
# pip install sendtide
import os
from sendtide import Sendtide

client = Sendtide(os.environ["SENDTIDE_API_KEY"])

res = client.emails.send(
    {
        "from": "Acme <hello@example.com>",
        "to": "anna@example.org",
        "subject": "Welcome to Acme",
        "html": "<p>Hello Anna, great to have you.</p>",
    },
    idempotency_key="welcome-4821",
)
print(res["id"], res["status"])
```

```
<?php
// composer require sendtide/sendtide-php
use Sendtide\Client;

$sendtide = new Client(getenv('SENDTIDE_API_KEY'));

$res = $sendtide->emails->send([
    'from' => 'Acme <hello@example.com>',
    'to' => 'anna@example.org',
    'subject' => 'Welcome to Acme',
    'html' => '<p>Hello Anna, great to have you.</p>',
], idempotencyKey: 'welcome-4821');
echo $res['id'], ' ', $res['status'];
```

The answer comes at once, before anything is delivered:

```
{ "id": "msg_8kq2m4bt", "status": "queued" }
```

Status 202 means Sendtide accepted and stored the email. Delivery happens in the background. The Idempotency-Key makes sure that repeating the request does not send a second email, see [Sending email](https://sendtide.ch/en/docs/sending-email/#idempotency-keys).
## 3. Check the status

Fetch the email with its history:

```
curl https://api.sendtide.ch/v1/emails/msg_8kq2m4bt \
  -H "Authorization: Bearer $SENDTIDE_API_KEY"
```

The answer has the status, the recipients with their own status and the events (email.queued, email.sent, email.delivered and more). Search with GET /v1/emails?q=status:bounced. The dashboard shows the same data in the logs.

For live delivery updates, set up a [webhook](https://sendtide.ch/en/docs/webhooks/) instead of polling.
## 4. Go live
- Add your domain and set the DNS records, see [Set up domains](https://sendtide.ch/en/docs/domains/).
- Confirm your email address as the owner. Until then the account is “in review”: live keys answer 403 account_in_review, test keys work.
- Create a live key (sk_live_…) and swap it into your configuration. The code stays the same.
- Set up a webhook for email.bounced and email.complained so that you remove invalid addresses from your system at once.
## What next?
- [Authentication and keys](https://sendtide.ch/en/docs/authentication/): scopes and restrictions
- [Sending email](https://sendtide.ch/en/docs/sending-email/): batch, attachments, templates, scheduling
- [Templates](https://sendtide.ch/en/docs/templates/): edit copy without deploying
- [Errors and limits](https://sendtide.ch/en/docs/errors-and-limits/): what to do when something fails
- [API reference](https://sendtide.ch/en/docs/api/): all endpoints
