{
  "openapi": "3.0.0",
  "info": {
    "title": "api/doki/informal",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1.0/atidocs/documents/": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              }
            },
            "description": "Результат запроса"
          }
        },
        "tags": [
          "Document"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentData"
              }
            }
          }
        },
        "summary": "Создание и/или сохранение документа"
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/attachments/": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Сохранить вложение",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file_upload": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Данные получены",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "result": {
                      "type": "string",
                      "description": "id документа"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Документ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_found"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Объект не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/send/": {
      "put": {
        "tags": [
          "Document"
        ],
        "summary": "Отправить документ",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          },
          {
            "in": "query",
            "name": "receiver",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Код пользователя в ATI.SU в формате <код фирмы>.<id контакта>"
          }
        ],
        "responses": {
          "200": {
            "description": "Документ отправлен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "result": {
                      "type": "string",
                      "description": "id документа"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Не найден аккаунт получателя",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "document_no_receiver"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Не найден аккаунт получателя"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Объект не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_found"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Документ не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/export/": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Экспорт документа для подписи",
        "description": "Аттачмент документа преобразуется в base64 строку для того, чтобы подписать документ.",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          }
        ],
        "responses": {
          "200": {
            "description": "Документ экспортирован",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "result": {
                      "type": "string",
                      "description": "id документа"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Документ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "boolean",
                      "example": true
                    },
                    "reason": {
                      "type": "string",
                      "example": "Документ не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1.0/atidocs/documents/{doc_id}/sign/": {
      "put": {
        "parameters": [
          {
            "description": "Идентификатор документа",
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUpdateResult"
                }
              }
            },
            "description": "Результат запроса"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Ошибка при подписании документа."
          }
        },
        "tags": [
          "Document"
        ],
        "description": "Для подписания документа следует использовать строку, которую вернул метод экспорта\nдокумента. При подписании сервер выполняет проверку подписи: сертификат клиента должен\nбыть выдан доверенным УЦ. \n\nЕсли документ требовал решения, то документ автоматически одобряется.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "sign": {
                    "description": "Подпись документа в виде base64-строки",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "application/xml": {
              "schema": {
                "properties": {
                  "sign": {
                    "description": "Подпись документа в виде base64-строки",
                    "type": "string",
                    "format": "binary"
                  }
                },
                "type": "object"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "sign": {
                    "description": "Подпись документа в виде base64-строки",
                    "type": "string",
                    "format": "binary"
                  }
                },
                "type": "object"
              }
            },
            "text/plain": {
              "schema": {
                "properties": {
                  "sign": {
                    "description": "Подпись документа в виде base64-строки",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "description": "Объект с подписью документа в виде строки, кодированной в base64."
        },
        "summary": "Подписание документа"
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/comments/": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Оставить комментарий к документу",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment-text": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Список комментариев",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment2"
                }
              }
            }
          },
          "400": {
            "description": "Ошибка запроса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "bad_request"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Нельзя отправить пустой комментарий"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Объект не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "not_found"
                    },
                    "reason": {
                      "type": "string",
                      "description": "Документ не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/revoke/": {
      "put": {
        "tags": [
          "Document"
        ],
        "summary": "Отозвать отправленный документ и сделать его черновиком",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          }
        ],
        "responses": {
          "200": {
            "description": "Документ отозван",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "result": {
                      "type": "string",
                      "description": "id документа"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Не указана причина отзыва документа",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "boolean",
                      "example": true
                    },
                    "reason": {
                      "type": "string",
                      "example": "Не указана причина отзыва документа"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Документ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "boolean",
                      "example": true
                    },
                    "reason": {
                      "type": "string",
                      "example": "Документ не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/": {
      "get": {
        "parameters": [
          {
            "description": "Идентификатор документа",
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "ok": true,
                    "result": {
                      "doctype": "Тип документа",
                      "sender": {
                        "ati_id": "0",
                        "name": "Имя",
                        "user": {
                          "ati_id": "0",
                          "name": "Имя пользователя",
                          "department_id": "0"
                        },
                        "status": "Статус документа",
                        "inn": ""
                      },
                      "receiver": {
                        "ati_id": "0",
                        "name": "Имя",
                        "user": {
                          "ati_id": "0",
                          "name": "Имя пользователя",
                          "department_id": "0"
                        },
                        "status": "Статус документа"
                      },
                      "file": {
                        "mimetype": "application/vnd.ati-docs.xml",
                        "name": "000.xml",
                        "xml_template": "order",
                        "timestamp": "2022-06-30T12:44:30Z",
                        "size": 9659,
                        "id": "00000"
                      },
                      "id": "00000",
                      "date": "2022-06-30",
                      "number": "1",
                      "updated": "2022-06-30T12:44:28Z",
                      "fix_price": {
                        "id": "00000",
                        "link": "",
                        "original_owner": "0",
                        "contact_1": "0",
                        "contact_2": "",
                        "document_creator": "0"
                      },
                      "flags": [
                        "is_sent",
                        "is_waiting",
                        "can_be_deleted",
                        "can_be_archived",
                        "can_be_signed",
                        "can_be_declined",
                        "can_be_revoked",
                        "can_be_templated"
                      ]
                    }
                  },
                  "properties": {
                    "ok": {
                      "$ref": "#/components/schemas/OkResult"
                    },
                    "result": {
                      "$ref": "#/components/schemas/Documents"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Сведения о документе"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            },
            "description": "Документ не найден"
          }
        },
        "tags": [
          "Document"
        ],
        "description": "Данные о документе по его идентификатору\n",
        "operationId": "GetDocumentInfo2",
        "summary": "Получение документа"
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/approve/": {
      "put": {
        "tags": [
          "Document"
        ],
        "summary": "Одобрить документ",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          }
        ],
        "responses": {
          "200": {
            "description": "Документ одобрен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "result": {
                      "type": "string",
                      "description": "id документа"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Документ не может быть одобрен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "document_can_not_be_approved"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Документ не может быть одобрен"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Документ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "not_found"
                    },
                    "reason": {
                      "type": "string",
                      "description": "Объект не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/decline/": {
      "put": {
        "tags": [
          "Document"
        ],
        "summary": "Отклонить документ",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "description": "Текст комментария",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Документ отклонен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "result": {
                      "type": "string",
                      "description": "id документа"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Документ не может быть одобрен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "document_can_not_be_changed"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Документ невозможно изменить, так как вторая сторона приняла по нему решение. Обновите страницу, чтобы продолжить работу"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Документ не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "not_found"
                    },
                    "reason": {
                      "type": "string",
                      "description": "Объект не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/gw/atidocs/api/2.0/documents/{doc_id}/attachments/{attachment_id}/": {
      "get": {
        "tags": [
          "Document"
        ],
        "summary": "Получить вложение по id документа",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id документа"
          },
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id вложения"
          }
        ],
        "responses": {
          "200": {
            "description": "Данные получены",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Объект не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_found"
                    },
                    "reason": {
                      "type": "string",
                      "example": "Документ не найден"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1.0/atidocs/documents/{doc_id}/zip_archive/": {
      "get": {
        "parameters": [
          {
            "description": "Идентификатор документа",
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP-архив"
          }
        },
        "tags": [
          "Document"
        ],
        "summary": "Скачать zip-архив документа с вложениями и подписями"
      }
    }
  },
  "components": {
    "schemas": {
      "Documents": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор документа"
          },
          "file": {
            "type": "object",
            "$ref": "#/components/schemas/File"
          },
          "number": {
            "type": "string",
            "description": "Номер документа"
          },
          "date": {
            "type": "string",
            "example": "2020-22-11"
          },
          "doctype": {
            "type": "string",
            "description": "Тип документа"
          },
          "updated": {
            "type": "string",
            "example": "2020-08-11T14:55:57Z",
            "description": "Дата и время последнего обновления документа"
          },
          "sender": {
            "type": "object",
            "$ref": "#/components/schemas/BaseUser",
            "description": "Отправитель документа"
          },
          "receiver": {
            "type": "object",
            "$ref": "#/components/schemas/BaseUser",
            "description": "Получатель документа"
          },
          "comments": {
            "type": "object",
            "properties": {
              "count": {
                "type": "string",
                "description": "Количество комментариев"
              },
              "last": {
                "type": "string",
                "description": "Последний комментарий"
              }
            }
          },
          "fix_price": {
            "type": "object",
            "description": "Информация о прикрепленном заказе",
            "properties": {
              "id": {
                "type": "string",
                "description": "Идентификатор заказа"
              },
              "link": {
                "type": "string",
                "description": "Ссылка на заказ"
              },
              "original_owner": {
                "type": "string"
              },
              "contact_1": {
                "type": "string"
              },
              "contact_2": {
                "type": "string"
              },
              "document_creator": {
                "type": "string"
              }
            }
          },
          "flags": {
            "type": "array",
            "description": "Флаги документа сообщающие о доступных действиях",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "File": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "f677f504254b4e4dbc3c48b390cdc71e",
            "description": "Идентификатор файла"
          },
          "timestamp": {
            "type": "string",
            "example": "2020-08-25T14:39:14Z",
            "description": "Дата и время загрузки файла"
          },
          "name": {
            "type": "string",
            "example": "b80985868fdc45e59209df7ee48daca9.xml",
            "description": "Имя файла"
          },
          "mimetype": {
            "type": "string",
            "example": "application/vnd.ati-docs.xml",
            "description": "mimetype файла"
          },
          "xml_template": {
            "type": "string",
            "example": "order"
          },
          "size": {
            "type": "string",
            "example": 5516,
            "description": "Размер файла в байтах"
          }
        }
      },
      "BaseUser": {
        "type": "object",
        "properties": {
          "ati_id": {
            "type": "string",
            "example": 14612,
            "description": "Идентификатор фирмы в ATI.SU (код в АТИ)"
          },
          "name": {
            "type": "string",
            "description": "Название фирмы"
          },
          "user": {
            "type": "object",
            "properties": {
              "ati_id": {
                "type": "string",
                "example": "14612.0",
                "description": "Идентификатор фирмы и контакта"
              },
              "name": {
                "type": "string",
                "description": "Название контакта"
              }
            }
          },
          "status": {
            "type": "string"
          },
          "inn": {
            "type": "string"
          }
        }
      },
      "Comment2": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "example": "2020-02-26T15:24:00.000Z"
          },
          "text": {
            "type": "string",
            "description": "Текст сообщения"
          },
          "has_attachments": {
            "type": "boolean",
            "example": false
          },
          "attachment": {
            "type": "object",
            "description": "Данные вложения",
            "properties": {
              "id": {
                "type": "string",
                "example": "95a971edb0994372aa6b76a9e1be8bdb"
              },
              "size": {
                "type": "integer",
                "example": 429939,
                "description": "Размер файла"
              },
              "name": {
                "type": "string",
                "example": "Книга новичка АТИ.pdf",
                "description": "Название файла"
              },
              "mimetype": {
                "type": "string",
                "example": "application/pdf"
              }
            }
          },
          "user": {
            "type": "object",
            "description": "Данные пользователя",
            "properties": {
              "id": {
                "type": "string",
                "example": "765044.0",
                "description": "ati id"
              },
              "fn": {
                "type": "string",
                "example": "wefwef_1!",
                "description": "Имя юзера"
              }
            }
          }
        }
      },
      "DocumentData": {
        "description": "Данные для создания документа",
        "properties": {
          "date": {
            "description": "Дата документа",
            "format": "date",
            "type": "string"
          },
          "doc_recipient_contact": {
            "$ref": "#/components/schemas/UserCode"
          },
          "doc_request": {
            "description": "Флаг запроса решения для документа. Если это поле не передается, то для новых документов\nзапрос решения остается без изменений. Если это передается, то в документе для флага\nбудет использовано переданное значение.\n",
            "type": "boolean"
          },
          "doc_sender_contact": {
            "$ref": "#/components/schemas/UserCode"
          },
          "doctype": {
            "description": "Тип документа",
            "type": "string",
            "enum": [
              "акт",
              "доверенность",
              "договор",
              "заказ",
              "заказ (табличный вид)",
              "заявка (к договору)",
              "заявка к договору (табличный вид)",
              "поручение экспедитору",
              "счет",
              "другой"
            ]
          },
          "id": {
            "description": "Идентификатор документа",
            "type": "string"
          },
          "number": {
            "description": "Номер документа",
            "type": "string"
          },
          "xmlBody": {
            "description": "Тело документа в формате xml, в виде строки",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DocumentUpdateResult": {
        "description": "Результат сохранения документа",
        "example": {
          "ok": true,
          "result": "12345676554321"
        },
        "properties": {
          "ok": {
            "$ref": "#/components/schemas/OkResult"
          },
          "result": {
            "description": "Идентификатор документа",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorResponse": {
        "description": "Сообщение об ошибке",
        "properties": {
          "error": {
            "description": "Код ошибки",
            "example": "bad_request",
            "nullable": false,
            "type": "string"
          },
          "reason": {
            "description": "Описание ошибки и возможная причина",
            "example": "Ошибка в запросе",
            "type": "string"
          }
        },
        "required": [
          "error",
          "reason"
        ],
        "type": "object"
      },
      "NotFoundError": {
        "description": "Документ не найден",
        "properties": {
          "error": {
            "enum": [
              "true"
            ],
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "Документ не найден"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "OkResult": {
        "enum": [
          true
        ],
        "type": "boolean"
      },
      "UserCode": {
        "description": "Код пользователя в ATI.SU в формате <код фирмы>.<id контакта>",
        "type": "string"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}