ACME 账号 acme-accounts

自动签发证书用的 CA 账号(Let's Encrypt、ZeroSSL)。第一次签发时才向 CA 注册。

点击任一接口,右侧显示对应的调用示例。

证书鉴权: 用户(部分参数仅管理员)5 个接口

鉴权

请求头带 X-API-Key(在「API 密钥」页开通,密钥只在开通时显示一次);也可用登录得到的 Authorization: Bearer 令牌。

X-API-Key

鉴权失败回 401;无权回 403(code 为 insufficient_scope 等)。

约定

分页参数 page(从 1 起)、page_size;排序 sort=字段 或 -字段。

时间一律 RFC 3339(UTC);金额单位为分。

写操作成功回 200/201/204;重复提交按资源唯一键回 409。

GET/api/v2/acme-accounts列出ACME 账号

鉴权: 用户(部分参数仅管理员)

查询参数

字段类型说明
pageinteger 页码,从 1 开始。
默认 1
page_sizeinteger 每页条数。
默认 20
sortstring 排序字段,逗号分隔,前缀 `-` 表示降序,如 `-created_at,id`。
tenant_idinteger 仅管理员可用:按租户过滤(格式错 422)。租户凭据调用时忽略,只返回本租户数据。
castring 只列这家 CA 的账号。
可选值 ["lets","zerossl"]
POST/api/v2/acme-accounts创建ACME 账号

鉴权: 用户(部分参数仅管理员)

查询参数

字段类型说明
tenant_idinteger 仅管理员可用:按租户过滤(格式错 422)。租户凭据调用时忽略,只返回本租户数据。

请求体 application/json

字段类型说明
api_keystring ZeroSSL REST API Key 的掩码(`****abcd`);空 = 没配。Key 加密存库,不回明文。
ca必填string 签发证书的 CA:lets = Let's Encrypt;zerossl = ZeroSSL。
可选值 ["lets","zerossl"]
directorystring ACME 目录地址;空 = 主控配置 acme.directories 里该 CA 的地址(缺省为正式地址)。
eab_hmacstring 掩码(≥16 位露末 4 位 `****abcd`,否则 `********`),不回明文。
eab_kidstring EAB 密钥 id(ZeroSSL 用)。
emailstring 邮箱
enabledboolean 是否启用
name必填string 名称
recheckboolean 为 true 时重新检测已存的 API Key;通过则账号回到可用,并立即重签因账号不可用而等待的证书。
GET/api/v2/acme-accounts/{id}获取ACME 账号

鉴权: 用户(部分参数仅管理员)

PUT/api/v2/acme-accounts/{id}修改ACME 账号

鉴权: 用户(部分参数仅管理员)

请求体 application/json

字段类型说明
api_keystring ZeroSSL REST API Key 的掩码(`****abcd`);空 = 没配。Key 加密存库,不回明文。
ca必填string 签发证书的 CA:lets = Let's Encrypt;zerossl = ZeroSSL。
可选值 ["lets","zerossl"]
directorystring ACME 目录地址;空 = 主控配置 acme.directories 里该 CA 的地址(缺省为正式地址)。
eab_hmacstring 掩码(≥16 位露末 4 位 `****abcd`,否则 `********`),不回明文。
eab_kidstring EAB 密钥 id(ZeroSSL 用)。
emailstring 邮箱
enabledboolean 是否启用
name必填string 名称
recheckboolean 为 true 时重新检测已存的 API Key;通过则账号回到可用,并立即重签因账号不可用而等待的证书。
DELETE/api/v2/acme-accounts/{id}删除ACME 账号

鉴权: 用户(部分参数仅管理员)

ACME 账号对象

字段类型说明
api_checked_atstring 最近一次检测 API Key 的时间。
只读
api_errorstring API Key 最近一次检测或签发遇到的账号级错误。
只读
api_keystring ZeroSSL REST API Key 的掩码(`****abcd`);空 = 没配。Key 加密存库,不回明文。
只读
api_statestring API Key 状态:none 没配;ok 可用;blocked 账号级错误(额度满、欠费、Key 被拒,6 小时后或重新检测通过再签);error Key 解不开须重填。
只读可选值 ["none","ok","blocked","error"]
castring 签发证书的 CA:lets = Let's Encrypt;zerossl = ZeroSSL。
可选值 ["lets","zerossl"]
created_atstring 创建时间
只读
directorystring ACME 目录地址;空 = 主控配置 acme.directories 里该 CA 的地址(缺省为正式地址)。
eab_hmacstring 掩码(≥16 位露末 4 位 `****abcd`,否则 `********`),不回明文。
eab_kidstring EAB 密钥 id(ZeroSSL 用)。
emailstring 邮箱
enabledboolean 是否启用
idinteger 记录 ID
只读
last_errorstring 最近一次错误
只读
namestring 名称
recheckboolean 为 true 时重新检测已存的 API Key;通过则账号回到可用,并立即重签因账号不可用而等待的证书。
statusstring new = 还没注册;registered = 已在 CA 注册;error = 注册失败(原因见 last_error)。
只读可选值 ["new","registered","error"]
tenant_idinteger 所属租户;null = 平台账号。
只读
updated_atstring 更新时间
只读

返回与错误

成功直接回资源 JSON(HTTP 2xx);失败回 application/problem+json(code、detail,校验失败带 errors);列表为 items + total。

成功
{
  "id": 1,
  "name": "example"
}
列表
{
  "items": [
    {
      "id": 1
    }
  ],
  "page": 1,
  "page_size": 20,
  "total": 1
}
失败
{
  "code": "validation_failed",
  "detail": "请求参数不合法",
  "errors": [
    {
      "code": "required",
      "field": "/name",
      "message": "name 必填"
    }
  ],
  "request_id": "0123456789abcdef",
  "status": 422,
  "title": "Unprocessable Entity",
  "type": "about:blank"
}
开始使用

体验在线演示

访问在线演示,或联系我们获取报价与安装命令