跳到内容
Esc
↑↓导航↵打开⌘J预览

Create an API key

POST/api-keys
授权
AuthorizationBearer 令牌 · header必填

A BillionSend API key (bs_…).

请求体
必填application/json
namestring必填
最小长度 1 · 最大长度 80
permissionstring
默认值:"full_access"
允许值:full_accesssending_access
domain_idstring<uuid> | null

Restricts the key to this one verified domain of the team: a GET /domains row with shared: false. The key sends only from it and reads and changes only that domain's own resources: its emails, its broadcasts, topics and segments bound to it, its opt-outs, its inboxes and received mail, its own GET, PATCH, DELETE and verify of /domains/{id}, its metrics, and the keys held to the same domain (GET and DELETE /api-keys). Everything that belongs to the team as a whole answers 403 restricted_api_key: webhooks, suppressions, templates, contact properties, /usage, /deliverability, /verifications and POST /domains. Omitted or null, the key inherits the calling key's scope: all domains, or the calling key's domain if it is domain-scoped. A domain-scoped calling key cannot name any other domain (403 restricted_api_key).

inbox_idstring<uuid> | null

BillionSend extension: restricts the key to one inbox of the team. It reads that inbox's threads, drafts and received mail and sends only from its address; every other route answers 403 restricted_api_key. Needs full_access, can't be combined with domain_id, and an inbox holds at most 5 active keys (outside the team's 25).

响应
200

API key created; the token is returned only here

idstring<uuid>必填
tokenstring必填
401

Missing, malformed, unknown or revoked API key

statusCodenumber必填
namestring必填
messagestring必填
403

Restricted API key: a sending_access key, an inbox-scoped key, or a domain_id outside the calling key's domain

statusCodenumber必填
namestring必填
messagestring必填
422

Validation error

statusCodenumber必填
namestring必填
messagestring必填
429

Over the rate limit (rate_limit_exceeded, with Retry-After)

statusCodenumber必填
namestring必填
messagestring必填
试一试
服务器
授权
请求体application/json
请求
curl -X POST 'https://api.billionsend.com/api-keys' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "permission": "full_access",
  "domain_id": "b2f7354f-b74d-4332-ab10-1a5e3c56466c",
  "inbox_id": "5127f22b-d152-46dd-aeaa-3a852d9fbfc2"
}'
响应
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "token": "string"
}

这个页面有帮助吗?