版本 2.1.1792967583 · 最新 下载 OpenAPI Markdown 版

证书

上传或自动签发的 HTTPS 证书。可绑定到站点;有站点在用时不能删除或停用。

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

列出证书

GET/api/v2/certs
鉴权: 用户(部分参数仅管理员)

查询参数

字段类型必填说明
pageinteger— 页码,从 1 开始。
默认 1
page_sizeinteger— 每页条数。
默认 20
sortstring— 排序字段,逗号分隔,前缀 `-` 表示降序,如 `-created_at,id`。
tenant_idinteger— 仅管理员可用:按租户过滤。租户凭据调用时忽略,只返回本租户数据。
namestring— 名称包含。
domainstring— SAN 包含(域名或 IP 的一部分)。
scopestring— site = 站点证书;ip = 平台 IP 证书;panel = 面板证书(主控 HTTPS 监听用)。
可选值 ["site","ip","panel"]
enabledboolean— 是否启用
expire_daysinteger— 只列 N 天内到期(含已过期)的证书。
idinteger— 证书 id 精确匹配。
idsstring— 多个证书 id 逗号分隔(至多 200 个),命中其中任一个。
desstring— 备注包含。
typestring— 证书类型。
可选值 ["custom","lets","zerossl","zerossl_api"]
dns_api_idinteger— 用此 DNS API 凭据的证书。
domainsstring— 多个域名或 IP,逗号分隔,证书 SAN 里含其中任一个(精确匹配)。
issue_statestring— ACME 签发状态(上传的证书没有)。
可选值 ["pending","running","issued","failed"]
kindstring— domain = SAN 含域名;ip = SAN 全是 IP。
可选值 ["domain","ip"]

创建证书

POST/api/v2/certs
鉴权: 用户(部分参数仅管理员)

查询参数

字段类型必填说明
tenant_idinteger— 仅管理员可用:按租户过滤。租户凭据调用时忽略,只返回本租户数据。

请求体 application/json

字段类型必填说明
acmeCertAcmeSummary— 签发状态摘要(证书 GET 与列表里带):签发得来的证书(type=lets/zerossl/zerossl_api)才有,上传的证书(custom)没有这个字段。完整状态(验证方式、ARI 窗口等)见 GET /certs/{id}/acme。
certstring— 证书链 PEM(叶证书在前,补全过中间证书,不含根);不含私钥(私钥只能经 POST /certs/{id}/private-key 导出)。
desstring— 备注说明
enabledboolean— 是否启用
keystring— 私钥 PEM(PKCS#1/PKCS#8/SEC1,不许加密);换证时不给则用原私钥核对。
namestring必填 名称
scopestring— 证书范围:site = 站点证书;ip = 平台 IP 证书;panel = 面板证书。
可选值 ["site","ip","panel"]
typestring— custom = 上传;lets/zerossl = ACME 签发;zerossl_api = ZeroSSL 付费 REST API 签发。

批量查 ACME 签发状态

GET/api/v2/certs/acme-states
鉴权: 用户(部分参数仅管理员)

查询参数

字段类型必填说明
idsstring必填 证书 id,逗号分隔,至多 200 个。

批量申请 ACME 证书

POST/api/v2/certs/batch
鉴权: 用户(部分参数仅管理员)

查询参数

字段类型必填说明
tenant_idinteger— 仅管理员可用:按租户过滤。租户凭据调用时忽略,只返回本租户数据。

请求体 application/json

字段类型必填说明
acme_account_idinteger— 指定签发账号(同 POST /certs 的 acme.acme_account_id);不给按类型先取本租户启用的、再取平台启用的。
auto_renewboolean— 不给为 true。
desstring— 备注说明
dns_api_idinteger— DNS-01 验证用的 DNS API 凭据(ACME 证书用)。
itemsCertAcme[]必填 签发状态。
typestring— custom = 上传;lets/zerossl = ACME 签发;zerossl_api = ZeroSSL 付费 REST API 签发。

批量重签或续签 ACME 证书

POST/api/v2/certs/batch-issue
鉴权: 用户(部分参数仅管理员)

请求体 application/json

字段类型必填说明
idsinteger[]必填 证书 id。

列出可签 ZeroSSL 证书的 IP

GET/api/v2/certs/zerossl-ips
鉴权: 用户(部分参数仅管理员)

查询参数

字段类型必填说明
tenant_idinteger— 仅管理员可用:按租户过滤。租户凭据调用时忽略,只返回本租户数据。

获取证书

GET/api/v2/certs/{id}
鉴权: 用户(部分参数仅管理员)

修改证书

PUT/api/v2/certs/{id}
鉴权: 用户(部分参数仅管理员)

请求体 application/json

字段类型必填说明
acmeCertAcmeSummary— 签发状态摘要(证书 GET 与列表里带):签发得来的证书(type=lets/zerossl/zerossl_api)才有,上传的证书(custom)没有这个字段。完整状态(验证方式、ARI 窗口等)见 GET /certs/{id}/acme。
certstring— 证书链 PEM(叶证书在前,补全过中间证书,不含根);不含私钥(私钥只能经 POST /certs/{id}/private-key 导出)。
desstring— 备注说明
enabledboolean— 是否启用
keystring— 私钥 PEM(PKCS#1/PKCS#8/SEC1,不许加密);换证时不给则用原私钥核对。
namestring必填 名称
scopestring— 证书范围:site = 站点证书;ip = 平台 IP 证书;panel = 面板证书。
可选值 ["site","ip","panel"]
typestring— custom = 上传;lets/zerossl = ACME 签发;zerossl_api = ZeroSSL 付费 REST API 签发。

删除证书

DELETE/api/v2/certs/{id}
鉴权: 用户(部分参数仅管理员)

获取证书的 ACME 签发状态

GET/api/v2/certs/{id}/acme
鉴权: 用户(部分参数仅管理员)

修改证书的自动续签开关

PUT/api/v2/certs/{id}/acme
鉴权: 用户(部分参数仅管理员)

请求体 application/json

字段类型必填说明
auto_renewboolean必填 不给为 true。

证书绑定到站点

POST/api/v2/certs/{id}/bind
鉴权: 用户(部分参数仅管理员)

请求体 application/json

字段类型必填说明
site_idsinteger[]必填 在用此证书的站点。

重新签发 ACME 证书

POST/api/v2/certs/{id}/issue
鉴权: 用户(部分参数仅管理员)

导出证书私钥

POST/api/v2/certs/{id}/private-key
鉴权: 用户(部分参数仅管理员)

请求体 application/json

字段类型必填说明
passwordstring— 当前登录口令。
totp_codestring— 动态口令(TOTP)的 6 位当前码;账号须已启用动态口令。

证书对象

字段类型必填说明
acmeCertAcmeSummary— 签发状态摘要(证书 GET 与列表里带):签发得来的证书(type=lets/zerossl/zerossl_api)才有,上传的证书(custom)没有这个字段。完整状态(验证方式、ARI 窗口等)见 GET /certs/{id}/acme。
只读
acme_account_idinteger— 指定签发账号(同 POST /certs 的 acme.acme_account_id);不给按类型先取本租户启用的、再取平台启用的。
ari_endstring— CA 经 ARI 建议的续签窗口结束时间。
ari_startstring— CA 经 ARI 建议的续签窗口;null = CA 没给,按到期前 cert.acme.renew_before_days 天续签。
auto_renewboolean— 不给为 true。
certstring— 证书链 PEM(叶证书在前,补全过中间证书,不含根);不含私钥(私钥只能经 POST /certs/{id}/private-key 导出)。
只读
cert_idinteger— 证书 id。
challengestring— 验证方式:http-01、dns-01,或 http-file(zerossl_api 的 ZeroSSL 文件验证)。
可选值 ["http-01","dns-01","http-file"]
created_atstring— 创建时间
只读
desstring— 备注说明
dns_api_idinteger— DNS-01 验证用的 DNS API 凭据(ACME 证书用)。
enabledboolean— 是否启用
err_timesinteger— 这一轮已失败次数。
failedinteger— 失败的条数。
fingerprintstring— 叶证书 SHA-256 指纹(小写十六进制)。
只读
idinteger— 记录 ID
只读
idsinteger[]必填 证书 id。
issued_atstring— 最近一次签发成功的时间。
issuerstring— 证书颁发者。
只读
itemsCertAcme[]— 签发状态。
keystring— 私钥 PEM(PKCS#1/PKCS#8/SEC1,不许加密);换证时不给则用原私钥核对。
last_errorstring— 最近一次错误
namestring— 名称
namesstring[]— SAN(域名、通配域名或 IP);无 SAN 时取 CN。
只读
next_try_atstring— 续签失败终态后,续签扫描最早再试的时刻。
not_afterstring— 证书到期时间。
只读
not_beforestring— 证书生效时间。
只读
ocspboolean— 叶证书带 OCSP 地址(节点可装订)。
只读
okinteger— 已排队签发的条数。
passwordstring— 当前登录口令。
renewingboolean— 当前这轮是续签(失败时旧证书照用)。
scopestring— 证书范围:site = 站点证书;ip = 平台 IP 证书;panel = 面板证书。
可选值 ["site","ip","panel"]
site_idsinteger[]— 在用此证书的站点。
只读
statestring— pending 排队或等重试;running 签发中;issued 已签出;failed 重试用完(已发提醒)。
可选值 ["pending","running","issued","failed"]
tenant_idinteger— 所属租户;null = 平台 IP 证书。
只读
totp_codestring— 动态口令(TOTP)的 6 位当前码;账号须已启用动态口令。
typestring— custom = 上传;lets/zerossl = ACME 签发;zerossl_api = ZeroSSL 付费 REST API 签发。
updated_atstring— 更新时间
只读
versioninteger— 证书内容版本,换证 +1。
只读
zerossl_order_idstring— zerossl_api 证书当前的 ZeroSSL 订单号;空 = 还没下单。
zerossl_order_statestring— ZeroSSL 订单状态(draft、pending_validation、issued、cancelled 等);空 = 还没下单。