{
  "openapi": "3.0.0",
  "info": {
    "title": "api/doki/certificates",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/gw/sign_checker/v4/verify-account-by-signature": {
      "post": {
        "tags": [
          "Подтверждение аккаунта по сертификату ЭЦП (public)"
        ],
        "summary": "Подтверждение аккаунта с помощью сертификата КЭП",
        "description": "Подтверждает аккаунт с помощью сертификата КЭП, а также выполняет проверку подписи.",
        "operationId": "verify_account_by_signature_v4_verify_account_by_signature_post",
        "security": [
          {
            "api-secret": []
          },
          {
            "user-id": []
          },
          {
            "client-name": []
          },
          {
            "baggage": []
          },
          {
            "x-baggage-passthrough": []
          }
        ],
        "parameters": [
          {
            "name": "verify_signature",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Флаг для проверки подписи",
              "default": true,
              "title": "Verify Signature"
            },
            "description": "Флаг для проверки подписи"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_verify_account_by_signature_v4_verify_account_by_signature_post"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/gw/sign_checker/v4/certificates/{certificate_id}/registration": {
      "post": {
        "tags": [
          "Получение списка сертификатов по списку id"
        ],
        "summary": "Регистрация сертификата ИП в системе ЭПД",
        "description": "Запускает подключение ИП к системе оператора ЭПД Калуга Астрал с указанием  адреса регистрациии.",
        "operationId": "register_certificate_with_legal_address_v4_certificates__certificate_id__registration_post",
        "security": [
          {
            "api-secret": []
          },
          {
            "user-id": []
          },
          {
            "client-name": []
          },
          {
            "baggage": []
          },
          {
            "x-baggage-passthrough": []
          }
        ],
        "parameters": [
          {
            "name": "certificate_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "[a-fA-F0-9]{40}",
              "description": "ID (отпечаток) сертификата",
              "title": "Certificate Id"
            },
            "description": "ID (отпечаток) сертификата"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalAddressSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/gw/sign_checker/v4/certificates": {
      "get": {
        "tags": [
          "Получение списка сертификатов по списку id"
        ],
        "summary": "Получение данных сертификатов",
        "description": "Возрвщает данные сертификаты из указанного списка ID (отпечатков).",
        "operationId": "get_certificates_details_v4_certificates_get",
        "security": [
          {
            "api-secret": []
          },
          {
            "user-id": []
          },
          {
            "client-name": []
          }
        ],
        "parameters": [
          {
            "name": "certificate_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 10,
              "description": "Список ID (отпечатков) сертификатов",
              "title": "Certificate Ids"
            },
            "description": "Список ID (отпечатков) сертификатов"
          }
        ],
        "responses": {
          "200": {
            "description": "Список сертификатов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CertificateResponsePublicData"
                  },
                  "title": "Response Get Certificates Details V4 Certificates Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/gw/sign_checker/v4/firms/current-user/certificates": {
      "get": {
        "tags": [
          "Получение списка сертификатов по списку id"
        ],
        "summary": "Получение сертификатов авторизованного пользователя",
        "description": "Возвращает все сертификаты авторизованного пользователя.",
        "operationId": "get_all_certificates_for_current_user_v4_firms_current_user_certificates_get",
        "responses": {
          "200": {
            "description": "Сертификаты авторизованного пользователя",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CertificateResponsePublicData"
                  },
                  "type": "array",
                  "title": "Response Get All Certificates For Current User V4 Firms Current User Certificates Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "api-secret": []
          },
          {
            "user-id": []
          },
          {
            "client-name": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "enum": [
                "string",
                "integer"
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "Body_verify_account_by_signature_v4_verify_account_by_signature_post": {
        "properties": {
          "signature": {
            "type": "string",
            "format": "binary",
            "title": "Signature",
            "description": "Подпись в формате base64"
          }
        },
        "type": "object",
        "required": [
          "signature"
        ],
        "title": "Body_verify_account_by_signature_v4_verify_account_by_signature_post"
      },
      "CertificateMetaResponseDict": {
        "properties": {
          "revoked": {
            "type": "boolean",
            "title": "Revoked"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "revoked",
          "created_at"
        ],
        "title": "CertificateMetaResponseDict"
      },
      "CertificateResponsePublicData": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "body": {
            "type": "string",
            "title": "Body"
          },
          "components": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Components"
          },
          "issuer": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Issuer"
          },
          "serial": {
            "type": "string",
            "title": "Serial"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "valid_from": {
            "type": "string",
            "title": "Valid From"
          },
          "valid_until": {
            "type": "string",
            "title": "Valid Until"
          },
          "meta": {
            "$ref": "#/components/schemas/CertificateMetaResponseDict"
          }
        },
        "type": "object",
        "required": [
          "id",
          "body",
          "components",
          "issuer",
          "serial",
          "title",
          "valid_from",
          "valid_until",
          "meta"
        ],
        "title": "CertificateResponsePublicData"
      },
      "LegalAddressSchema": {
        "properties": {
          "postcode": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "nullable": true,
            "title": "Postcode",
            "description": "Почтовый индекс"
          },
          "region_id": {
            "type": "integer",
            "title": "Region Id",
            "description": "Идентификатор региона"
          },
          "district": {
            "type": "string",
            "pattern": "^[^,]*$",
            "nullable": true,
            "title": "District",
            "description": "Район",
            "examples": [
              "Выборгский",
              "Приморский"
            ]
          },
          "city": {
            "type": "string",
            "pattern": "^[^,]*$",
            "nullable": true,
            "title": "City",
            "description": "Город",
            "examples": [
              "Санкт-Петербург",
              "Москва"
            ]
          },
          "locality": {
            "type": "string",
            "pattern": "^[^,]*$",
            "nullable": true,
            "title": "Locality",
            "description": "Населенный пункт",
            "examples": [
              "Населенный пункт"
            ]
          },
          "street": {
            "type": "string",
            "nullable": true,
            "title": "Street",
            "description": "Улица",
            "examples": [
              "Невский проспект"
            ]
          },
          "house": {
            "type": "string",
            "nullable": true,
            "title": "House",
            "description": "Дом",
            "examples": [
              "10a"
            ]
          },
          "apartment": {
            "type": "string",
            "nullable": true,
            "title": "Apartment",
            "description": "Квартира",
            "examples": [
              "123"
            ]
          },
          "housing": {
            "type": "string",
            "nullable": true,
            "title": "Housing",
            "description": "Корпус",
            "examples": [
              "5"
            ]
          }
        },
        "type": "object",
        "required": [
          "region_id"
        ],
        "title": "LegalAddressSchema"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}