Skip to main content
POST
List And Create API Keys

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json

expires_at must be in the future and is immutable once the key exists. Omitted, the new key inherits the authenticating key's expiry, and never expires only when that key never does. A key cannot create one that outlives it: an expires_at later than the authenticating key's own returns 403.

name
string

API 密钥的名称。

permissions
ApiKeyPermissions · object

API 密钥的细粒度权限。省略时授予所有权限;否则,仅授予设置为 true 的权限。

expires_at
string<date-time>

Time at which api key expires. Omitted when it does not expire.

响应

状态码为 200 的响应

The secret-bearing bearer key, or the registered public key without any secret.

api_key_id
string
必填

API 密钥的 ID。

api_key
string
必填

API 密钥。

prefix
string
必填

API 密钥的前缀。

name
string
必填

API 密钥的名称。

created_at
string<date-time>
必填

API 密钥的创建时间。

pod_id
string

API 密钥作用域所限定的 Pod ID。设置后,该密钥只能访问此 Pod 内的资源。

inbox_id
string

API 密钥限定访问的收件箱 ID。如果设置,该密钥只能访问此收件箱内的资源。

permissions
ApiKeyPermissions · object

API 密钥的细粒度权限。省略时授予所有权限;否则,仅授予设置为 true 的权限。

expires_at
string<date-time>

Time at which api key expires. Omitted when it does not expire.