API-ключи

Создать API-ключ

Создание ключа. Токен возвращается один раз.

POST/api-keys
1curl -X POST 'https://sendtern.com/api-keys' \
2  -H 'Authorization: Bearer st_your_api_key' \
3  -H 'Content-Type: application/json' \
4  -d '{
5  "name": "production-web",
6  "permission": "sending"
7}'
Ответ
1{
2  "key": {
3    "id": "key_3nQe8",
4    "name": "production-web",
5    "permission": "sending",
6    "created_at": "2026-11-21T09:30:00.000Z",
7    "last_used_at": null
8  },
9  "token": "st_live_9f2kq1Hc7Zp0aR4mVx8sB3yT"
10}

Returns the key and its token. The token is never shown again, store it right away.

Параметры тела

namestringтребуется

Метка, до 50 символов.

permissionstring

sending (по умолчанию) или full.