跳到主要内容
限时活动每支视频只要 HK$1限量 1000 支,先到先得立即抢购
Axiom Lab
开发者文档

参考

API 参考 · 项目、Key 与审计

管理项目和 API Key,查看变更记录。

查看 Markdown

List Projects

GET/v1/projects

需要 API Key成功 200

参数

名称类型说明
limitqueryinteger默认 50; 范围 1–200
cursorquerystring长度 ≤ 256; 可为 null
afterquerystring长度 ≤ 256; 可为 null
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
data必填array<object>
data[].id必填string
data[].organization_id必填string
data[].name必填string
data[].created_at必填number
next_cursorstringOpaque; pass as cursor (or the after alias) for the next page; 可为 null
has_moreboolean默认 false

示例

curl "https://axiomlab.online/v1/projects" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

Create Project

POST/v1/projects

需要 API Key成功 201

参数

名称类型说明
Idempotency-Keyheaderstring调用方生成并保存的唯一值;超时重试时复用它,同一请求不会被执行两次; 长度 1–128; 可为 null
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

请求体 application/json

名称类型说明
name必填string长度 1–120

返回 201 application/json

名称类型说明
id必填string
organization_id必填string
name必填string
created_at必填number

示例

curl -X POST "https://axiomlab.online/v1/projects" \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name": "<name>"}'

Delete Project

DELETE/v1/projects/{project_id}

需要 API Key成功 200

参数

名称类型说明
project_id必填pathstring
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
id必填string
deletedboolean默认 true

示例

curl -X DELETE "https://axiomlab.online/v1/projects/<project_id>" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

List Keys

GET/v1/api-keys

需要 API Key成功 200

参数

名称类型说明
limitqueryinteger默认 50; 范围 1–200
cursorquerystring长度 ≤ 256; 可为 null
afterquerystring长度 ≤ 256; 可为 null
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
data必填array<object>
data[].id必填string
data[].name必填stringLabel given at creation (also returned as owner)
data[].owner必填string
data[].prefix必填string可为 null
data[].organization_id必填string可为 null
data[].project_idstringSet when the key is bound to one project; 可为 null
data[].role必填string可选值:owner editor viewer
data[].active必填boolean
data[].created_at必填number可为 null
data[].last_used_atnumber可为 null
data[].expires_atnumber可为 null
data[].revoked_atnumber可为 null
next_cursorstringOpaque; pass as cursor (or the after alias) for the next page; 可为 null
has_moreboolean默认 false

示例

curl "https://axiomlab.online/v1/api-keys" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

Create Key

POST/v1/api-keys

需要 API Key成功 201

参数

名称类型说明
Idempotency-Keyheaderstring调用方生成并保存的唯一值;超时重试时复用它,同一请求不会被执行两次; 长度 1–128; 可为 null
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

请求体 application/json

名称类型说明
name必填string长度 1–120
rolestring可选值:owner editor viewer; 默认 editor
project_idstring可为 null
monthly_budget_usdnumber范围 ≥ 0; 可为 null
rate_per_hourinteger范围 ≥ 1; 可为 null

返回 201 application/json

名称类型说明
id必填string
name必填stringLabel given at creation (also returned as owner)
owner必填string
prefix必填string可为 null
organization_id必填string可为 null
project_idstringSet when the key is bound to one project; 可为 null
role必填string可选值:owner editor viewer
active必填boolean
created_at必填number可为 null
last_used_atnumber可为 null
expires_atnumber可为 null
revoked_atnumber可为 null
key必填stringThe bearer secret; shown once (an idempotent replay returns the same value)

示例

curl -X POST "https://axiomlab.online/v1/api-keys" \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name": "<name>"}'

Rotate Key

POST/v1/api-keys/{key_id}/rotate

需要 API Key成功 200

The old secret dies at once, or after grace_seconds so running fleets can switch without downtime.

参数

名称类型说明
key_id必填pathstring
grace_secondsqueryinteger默认 0; 范围 0–604800
Idempotency-Keyheaderstring调用方生成并保存的唯一值;超时重试时复用它,同一请求不会被执行两次; 长度 1–128; 可为 null
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
id必填string
key必填string
previous_id必填string
previous_expires_in必填integer可为 null

示例

curl -X POST "https://axiomlab.online/v1/api-keys/<key_id>/rotate" \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Revoke Key

DELETE/v1/api-keys/{key_id}

需要 API Key成功 200

参数

名称类型说明
key_id必填pathstring
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
id必填string
activeboolean默认 false

示例

curl -X DELETE "https://axiomlab.online/v1/api-keys/<key_id>" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

Audit Log

GET/v1/audit

需要 API Key成功 200

Identity and configuration changes for this organization (keys, projects, webhooks), oldest first from after.

参数

名称类型说明
afterqueryinteger默认 0; 范围 ≥ 0
limitqueryinteger默认 50; 范围 1–200
X-Project-IDheaderstring要操作的项目;省略时使用默认项目; 可为 null

返回 200 application/json

名称类型说明
data必填array<object>
data[].id必填string
data[].sequence必填integer
data[].type必填string
data[].created_at必填number
data[].api_version必填string
data[].project_id必填string可为 null
data[].data必填object
next_cursor必填integerSequence number to pass as after; unchanged when the page is empty
has_moreboolean默认 false

示例

curl "https://axiomlab.online/v1/audit" \
  -H "Authorization: Bearer $AZIMO_API_KEY"

← 全部接口