# API 介绍

> 基础URL、身份验证、格式和惯例。

## 基础网址

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

对所有生产请求使用 HTTPS。

## 认证

发送一个 [API key](https://sendtern.com/docs/authentication) 到 `Authorization` 头中,键的作用域为一个工作区。

```
Authorization: Bearer st_your_api_key
```

## 请求和答复

- 请求主体是 JSON 与 `Content-Type: application/json`。
- 响应是 JSON,除了 . `204 No Content` 关于删除。
- 时间戳是ISO 8601 UTC字符串。
- ID 是 UUID。

## 页码

电子邮件列表使用 `limit`(最多 100 个)和前一页的可选 `after` 光标。

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

## 状态代码

| 代码 | 意义 |
| --- | --- |
| 200 | 成功 |
| 202 | 接受,处理在后台继续进行 |
| 204 | 成功,没有身体 |
| 4xx 格式 | 请求出错了,请查看[错误](https://sendtern.com/docs/errors) |
| 5xx 年份 | 404 您访问的页面出错了返回首页 |

## 终点

- [电子邮件](https://sendtern.com/docs/api-send-email): 发送、检索、列表和计数。
- [领域](https://sendtern.com/docs/api-create-domain): 添加、验证和删除发送域。
- [API密钥](https://sendtern.com/docs/api-create-api-key): 创建、列出和撤销密钥。
