{
  "tags": [
    "证书管理"
  ],
  "description": "删除路径中指定的一个或多个证书，多个 ID 使用英文逗号分隔并在同一事务中处理。普通用户只能删除自己的证书，管理员可删除其他用户证书。每个证书必须已禁用，且关联任务为空或状态为 done；任一目标失败时整批回滚。",
  "operationId": "user_delete_v1_certs_cert_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "业务结果通过 HTTP 200 返回。全部目标删除并提交后返回确认消息；ID、记录、权限、启用状态、任务状态、维护或认证校验失败返回业务错误码，事务回滚。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "删除成功状态码，固定为 0。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      "证书删除成功"
                    ],
                    "description": "证书删除批次成功消息。"
                  },
                  "data": {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      null
                    ],
                    "description": "删除成功时固定为 null。"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "cert-1",
                      "cert-2",
                      "cert-3",
                      "cert-4",
                      "cert-47",
                      "maintain",
                      "login_required"
                    ],
                    "description": "业务错误码：1 表示 ID 格式错误，2 表示证书不存在，3 表示证书仍启用，4 表示证书任务尚未完成，47 表示普通用户删除其他用户证书，maintain 和 login_required 表示维护或认证失败。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "与业务错误码对应的中文 ID、记录、状态、权限或认证失败原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "code": 0,
            "msg": "证书删除成功",
            "data": null
          }
        }
      }
    }
  },
  "x-python-handler": "site.CertAPI",
  "x-python-route-line": 364,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "cert_id",
      "in": "path",
      "required": true,
      "description": "要删除的证书 ID；多个 ID 按 10021,10022 形式用英文逗号连接，每段必须为十进制数字。",
      "schema": {
        "type": "string",
        "pattern": "^[0-9]+(?:,[0-9]+)*$"
      },
      "example": "10021,10022"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "site.CertAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 364
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "delete",
  "path": "/v1/certs/{cert_id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "删除一个或多个证书",
    "description": {
      "content": "删除路径中指定的一个或多个证书，多个 ID 使用英文逗号分隔并在同一事务中处理。普通用户只能删除自己的证书，管理员可删除其他用户证书。每个证书必须已禁用，且关联任务为空或状态为 done；任一目标失败时整批回滚。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "certs",
        ":cert_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 要删除的证书 ID；多个 ID 按 10021,10022 形式用英文逗号连接，每段必须为十进制数字。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "cert_id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "DELETE",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}