# API introduction

> Base URL, authentication, formats and conventions.

## Base URL

```
https://sendtern.com
```

Use HTTPS for all production requests.

## Authentication

Send an [API key](https://sendtern.com/docs/authentication) in the `Authorization` header. Keys are scoped to one workspace.

```
Authorization: Bearer st_your_api_key
```

## Requests and responses

- Request bodies are JSON with `Content-Type: application/json`.
- Responses are JSON, except `204 No Content` on deletes.
- Timestamps are ISO 8601 strings in UTC.
- IDs are UUIDs.

## Pagination

The emails list uses `limit` (up to 100) and an optional `after` cursor from the previous page.

```
{
  "object": "list",
  "data": [],
  "has_more": false
}
```

## Status codes

| Code | Meaning |
| --- | --- |
| 200 | Success |
| 202 | Accepted, processing continues in the background |
| 204 | Success, no body |
| 4xx | Something is wrong with the request. See [Errors](https://sendtern.com/docs/errors) |
| 5xx | Something went wrong on our side. Safe to retry with an idempotency key |

## Endpoints

- [Emails](https://sendtern.com/docs/api-send-email): Send, retrieve, list and count.
- [Domains](https://sendtern.com/docs/api-create-domain): Add, verify and remove sending domains.
- [API keys](https://sendtern.com/docs/api-create-api-key): Create, list and revoke keys.
