{"openapi":"3.0.3","info":{"title":"API Specification","version":"0.2.24","description":"This specification describes interaction with the api server.\n"},"servers":[{"description":"Dev Server","url":"https://dev.ridom.ru/api/v1"},{"description":"Current","url":"/api/v1"},{"description":"Configurable","url":"{protocol}://{host}:{port}/api/v1","variables":{"protocol":{"enum":["http","https"],"default":"http"},"host":{"default":"localhost"},"port":{"default":"8080"}}}],"security":[{"bearerAuth":[]}],"tags":[{"name":"auth"},{"name":"registration"},{"name":"account"},{"name":"push-notifications"},{"name":"controllers"},{"name":"controllers-firmware"},{"name":"controllers-danger-zone"},{"name":"devices"},{"name":"units"},{"name":"sites"},{"name":"rooms"},{"name":"events"},{"name":"site-alerts"},{"name":"site-users"},{"name":"site-invitations"},{"name":"widgets"},{"name":"news"},{"name":"catalog"},{"name":"surgard"},{"name":"psc-auth"},{"name":"psc-users"},{"name":"psc-controllers"},{"name":"version"},{"name":"stories"},{"name":"custom_scripts"},{"name":"humidifier_scripts"}],"paths":{"/version":{"get":{"summary":"Get version server","tags":["version"],"responses":{"200":{"description":"Get version information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}}},"/auth/token":{"post":{"summary":"OAuth 2.0 token endpoint","tags":["auth"],"security":[],"description":"Token endpoint used by the client to exchange an authorization grant for an access token.\n\nSupported authorization grants:\n* Resource Owner Password Credentials Grant (password)\n* Refreshing an Access Token (refresh_token)\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TokenPasswordGrant"},{"$ref":"#/components/schemas/TokenRefreshTokenGrant"}]},"examples":{"password":{"value":{"grant_type":"password","username":"SuperRick","password":"F0RG0TP@ssword","client_id":"com.rielta.rihome.swagger","client_secret":"1ac38d6c-2917-4a46-b68e-f90ab7b0bc43"}},"refresh_token":{"value":{"grant_type":"refresh_token","refresh_token":"355cd7ae-b4a4-42a5-992f-c41993e7f437","client_id":"com.rielta.rihome.swagger","client_secret":"1ac38d6c-2917-4a46-b68e-f90ab7b0bc43"}}}}}},"responses":{"200":{"$ref":"#/components/responses/TokenResponse"},"400":{"$ref":"#/components/responses/TokenErrorResponse400"},"401":{"$ref":"#/components/responses/TokenErrorResponse401"}}}},"/psc/auth/token":{"post":{"summary":"OAuth 2.0 endpoint для токенов ЧОП","tags":["psc-auth"],"security":[],"description":"Endpoint для получения пары токенов пользователя ЧОП.\n\nПоддерживаемые grant_type:\n* password\n* refresh_token\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TokenPasswordGrant"},{"$ref":"#/components/schemas/TokenRefreshTokenGrant"}]},"examples":{"password":{"value":{"grant_type":"password","username":"psc_user@example.com","password":"F0RG0TP@ssword","client_id":"com.rielta.ridom.psc","client_secret":"f3f573ee-2f6c-4c04-aab7-21491f2430a9"}},"refresh_token":{"value":{"grant_type":"refresh_token","refresh_token":"355cd7ae-b4a4-42a5-992f-c41993e7f437","client_id":"com.rielta.ridom.psc","client_secret":"f3f573ee-2f6c-4c04-aab7-21491f2430a9"}}}}}},"responses":{"200":{"$ref":"#/components/responses/TokenResponse"},"400":{"$ref":"#/components/responses/TokenErrorResponse400"},"401":{"$ref":"#/components/responses/TokenErrorResponse401"}}}},"/psc/users":{"post":{"summary":"Создание пользователя ЧОП","tags":["psc-users"],"description":"Создает пользователя ЧОП.\nДоступно для API Admin и PSC Admin.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPSCUser"}}}},"responses":{"200":{"description":"Пользователь ЧОП успешно создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PSCUser"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"500":{"$ref":"#/components/responses/500Error"}}},"get":{"summary":"Получение пользователей ЧОП по компании","tags":["psc-users"],"description":"Возвращает список пользователей ЧОП, относящихся к охранной компании из PSC токена.\nДоступно только с PSC access token.\n","responses":{"200":{"description":"Список пользователей ЧОП","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PSCUser"}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"500":{"$ref":"#/components/responses/500Error"}}}},"/psc/users/{id}":{"get":{"summary":"Получение пользователя ЧОП","tags":["psc-users"],"description":"Возвращает пользователя ЧОП по идентификатору в рамках охранной компании из PSC токена.\nДоступно только с PSC access token.\n","parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор пользователя ЧОП","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Пользователь ЧОП","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PSCUser"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"500":{"$ref":"#/components/responses/500Error"}}}},"/psc/controllers":{"get":{"summary":"Список контроллеров для охранной компании (PSC)","tags":["psc-controllers"],"description":"Возвращает контроллеры объектов, которые относятся к охранной компании из PSC access token (поле company_id).\n\nОтвет в том же формате, что и карточка контроллера в мобильном API (схема Controller), но без загрузки списка устройств - поле `devices` в теле не заполняется.\n\nДоступ: только PSC Admin с валидным PSC access token. При отсутствии прав PSC Admin возвращается 403.\n","responses":{"200":{"description":"Массив контроллеров охранной компании","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Controller"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"500":{"$ref":"#/components/responses/500Error"}}}},"/auth/start":{"post":{"summary":"Start Auth (new)","tags":["auth"],"description":"Инициирует процесс аутентификации с использованием grant_type (authorization_code или refresh_token).\nПоддерживаемые значения для verification_type:\n  - SMS\n  - EMAIL\n  - CALL_TO_PHONE\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAuthRequest"},"examples":{"authorization_code":{"summary":"Пример для grant_type=authorization_code","value":{"grant_type":"authorization_code","username":"user@example.com","verification_type":"EMAIL","client_id":"com.rielta.rihome.swagger","client_secret":"1ac38d6c-2917-4a46-b68e-f90ab7b0bc43"}},"refresh_token":{"summary":"Пример для grant_type=refresh_token","value":{"grant_type":"refresh_token","refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","client_id":"com.rielta.rihome.swagger","client_secret":"1ac38d6c-2917-4a46-b68e-f90ab7b0bc43"}}}}}},"responses":{"200":{"description":"Успешный ответ, зависящий от grant_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAuthResponse"},"examples":{"authorization_code":{"summary":"Ответ для grant_type=authorization_code","value":{"verification_id":"9d5e3797-f5e1-4750-abd2-35b5419b4be8","message":"verification_send"}},"refresh_token":{"summary":"Ответ для grant_type=refresh_token","value":{"token_type":"Bearer","access_token":"eyJhbGciOiJIUzI1NiIs...","refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6...","expires_in":3600,"created_at":1696420000}}}}}},"400":{"description":"Неверный запрос (например, неверный grant_type, refresh_token или данные)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/auth/confirm":{"post":{"summary":"Confirm Auth (new)","tags":["auth"],"description":"Подтверждает аутентификацию с использованием verification_id и кода.\nПоддерживаемые значения для verification_type:\n  - SMS\n  - EMAIL\n  - CALL_TO_PHONE\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmAuthRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/TokenResponse"},"400":{"description":"Неверный запрос (например, неверный verification_id или код)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Конфликт (например, ошибка верификации)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"412":{"description":"Номер пользователя еще не подтвержден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthConfirmNotConfirmedResponse"}}}},"429":{"description":"Слишком много попыток верификации","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/registration/register":{"post":{"summary":"Registration","tags":["registration"],"security":[],"description":"Registration of a new user account in the system.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","email","phone","password"],"properties":{"name":{"description":"The user name","type":"string"},"email":{"description":"The user email","type":"string"},"phone":{"description":"The user phone","type":"string"},"password":{"description":"The user password","type":"string"}}},"example":{"name":"User Name","email":"email@example.com","phone":"+70000000000","password":"Passw0rd"}}}},"responses":{"201":{"description":"Successful registration","content":{"application/json":{"schema":{"type":"object","required":["email","phone"],"properties":{"email":{"description":"The user email","type":"string"},"phone":{"description":"The user phone","type":"string"}}},"example":{"email":"email@example.com","phone":"+70000000000"}}}},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/registration/check-email":{"post":{"summary":"Checking email for registration","tags":["registration"],"security":[],"description":"Checking the availability and validity of the email address.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"The value of email","type":"string"}}},"example":{"value":"email@example.com"}}}},"responses":{"200":{"description":"Email is valid","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"Email is invalid or already taken","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/registration/check-phone":{"post":{"summary":"Checking phone for registration","tags":["registration"],"security":[],"description":"Checking the availability and validity of the phone number.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"The value of phone","type":"string"}}},"example":{"value":"+70000000000"}}}},"responses":{"200":{"description":"Phone is valid","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"Phone is invalid or already taken","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/registration/start-activation":{"post":{"summary":"Start user account activation after registration","tags":["registration"],"security":[],"description":"Start the user account activation process by sending activation codes to the user email address and phone number.\n\nNotes:\n* Activation expires in `24 hours`\n* New activation can start no more than once every `3 minutes`\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","phone"],"properties":{"email":{"description":"The user email","type":"string"},"phone":{"description":"The user phone","type":"string"},"phone_verification_method":{"$ref":"#/components/schemas/PhoneVerificationMethod"}}},"example":{"email":"email@example.com","phone":"+70000000000","phone_verification_method":"SMS"}}}},"responses":{"200":{"description":"Activation data","content":{"application/json":{"schema":{"type":"object","required":["activated"],"properties":{"activated":{"description":"User activation status:<br/>\n* _true_ - user account is already activated\n* _false_ - user account requires activation\n","type":"boolean"},"activation_id":{"description":"Unique activation identifier.<br/>\nReturned only when activation is required.\n","type":"string","format":"uuid"}}},"examples":{"Activated":{"value":{"activated":true}},"Not Activated":{"value":{"activated":false,"activation_id":"b83abb5b-65bd-4021-ab1d-74c361f5b342"}}}}}},"422":{"description":"New activation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Account Not Found":{"description":"User with this email address and phone number does not exist.\n","value":{"code":"account_not_found","message":"account not found"}},"Too Many Requests":{"description":"New activation request rejected by frequency.","value":{"code":"account_activation_too_many_requests","message":"new activation can start no more than once every 3 minutes"}}}}}}}}},"/registration/activate":{"post":{"summary":"User account activation","tags":["registration"],"security":[],"description":"Activate user account with activation codes and activation ID from the `/registration/start-activation` endpoint.\n\nNotes:\n* maximum number of attempts to send activation codes is `5`\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["activation_id","email_code","phone_code"],"properties":{"activation_id":{"description":"Unique activation identifier","type":"string","format":"uuid"},"email_code":{"description":"The code sent to the user email address","type":"string"},"phone_code":{"description":"The code sent to the user phone number","type":"string"}}},"example":{"activation_id":"b83abb5b-65bd-4021-ab1d-74c361f5b342","email_code":"836540","phone_code":"217436"}}}},"responses":{"200":{"description":"Successful activation of the user account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"422":{"description":"Activation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Activation Not Found":{"description":"Activation not found by activation identifier","value":{"code":"account_activation_not_found","message":"activation not found"}},"Activation Expired":{"description":"Activation expired or the number of errors exceeded.","value":{"code":"account_activation_expired","message":"activation expired"}},"Invalid Codes":{"description":"Activation codes are invalid","value":{"code":"account_activation_invalid_codes","message":"activation codes are invalid"}}}}}}}}},"/registration/verification/start/phone":{"post":{"summary":"Отправляет подтверждение на номер телефона пользователя","tags":["registration"],"security":[],"description":"Отправляет определенное подтверждение на номер телефона пользователя \nс указанием phone_verification_method.\n\nПоддерживаемые методы:\n  - SMS\n  - CALL\n  - CALL_TO_PHONE\n\nПри resend_code=true, подтверждение будет отправлено еще раз\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_phone","phone_verification_method"],"properties":{"user_phone":{"description":"Номер телефона пользователя","type":"string"},"phone_verification_method":{"description":"Методы верификации (\"\", SMS, CALL, CALL_TO_PHONE)","type":"string","enum":["","SMS","CALL","CALL_TO_PHONE"]},"resend_code":{"description":"Флаг, используется если нужно отправить подтверждение на указанный номер еще раз","type":"boolean"}}},"example":{"user_phone":"+70000000000","phone_verification_method":"SMS"}}}},"responses":{"200":{"description":"Verification sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"verification_id":{"type":"string"}}},"example":{"verification_id":"9d5e3797-f5e1-4750-abd2-35b5419b4be8"}}}},"400":{"description":"Bad request (invalid phone or code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Incorrect Phone Number":{"value":{"code":"bad_request","message":"incorrect phone number"}}}}}},"409":{"description":"Conflict (user activated, phone confirmed, not found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"User Activated":{"value":{"code":"conflict","message":"user activated"}},"Phone Already Confirmed":{"value":{"code":"conflict","message":"phone already confirmed"}},"Not Found":{"value":{"code":"conflict","message":"user or user verification not found"}}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"429":{"description":"Too many requests or attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Max Attempts":{"value":{"code":"too_many_requests","message":"max verification attempts"}},"Too Many Requests":{"value":{"code":"too_many_requests","message":"too many requests"}}}}}}}}},"/registration/verification/confirm/phone":{"post":{"summary":"Подтверждение пользовательской верификации","tags":["registration"],"security":[],"description":"Проверка подтверждения верификации пользователя\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_verification_id","phone_verification_method"],"properties":{"user_verification_id":{"description":"Verification ID","type":"string"},"phone_verification_method":{"description":"Method used (\"\", SMS, CALL, CALL_TO_PHONE)","type":"string","enum":["","SMS","CALL","CALL_TO_PHONE"]},"phone_code":{"description":"Code received by user","type":"string"}}},"example":{"user_verification_id":"9d5e3797-f5e1-4750-abd2-35b5419b4be8","phone_verification_method":"SMS","phone_code":"1234"}}}},"responses":{"200":{"description":"Confirmation result","content":{"application/json":{"schema":{"type":"object","properties":{"is_confirmed":{"type":"string","enum":["true","false"]},"message":{"type":"string"}}},"examples":{"Success":{"value":{"is_confirmed":"true","message":"phone number successfully confirmed"}}}}}},"400":{"description":"Bad request (invalid code, verification, type)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Verification Was Used":{"value":{"code":"bad_request","message":"verification was used"}},"Invalid Verification":{"value":{"code":"bad_request","message":"invalid verification"}},"Invalid Type":{"value":{"code":"bad_request","message":"invalid type"}},"Invalid Code":{"value":{"code":"bad_request","message":"code not valid"}}}}}},"409":{"description":"Conflict (user activated, expired, already confirmed, failed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"User Activated":{"value":{"code":"conflict","message":"user activated"}},"Verification Expired":{"value":{"code":"conflict","message":"verification expired"}},"Phone Already Confirmed":{"value":{"code":"conflict","message":"this phone already confirmed"}},"Verification Failed":{"value":{"code":"conflict","message":"verification by call failed. need new verification"}}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"429":{"description":"Too many requests or attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Max Attempts":{"value":{"code":"too_many_requests","message":"max verification attempts"}},"Too Many Requests":{"value":{"code":"too_many_requests","message":"await next attempt"}}}}}}}}},"/registration/verification/start/email":{"post":{"summary":"Отправка кода на почту пользователя.","tags":["registration"],"security":[],"description":"Отправляет подвтерждение на указанный пользователем почтовый адрес\n\nNotes:\n* Для повторной отправки кода на указанный email, достаточно выполнить еще один запрос с теми же данными\n* Для смены почты (при ошибке), указывается новый почтовый адрес\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_verification_id","email"],"properties":{"user_verification_id":{"description":"Verification ID из предыдущего шага (/verification/start/phone)","type":"string"},"email":{"description":"Email адрес пользователя","type":"string"}}},"example":{"user_verification_id":"9d5e3797-f5e1-4750-abd2-35b5419b4be8","email":"user@example.com"}}}},"responses":{"200":{"description":"Verification sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success"]}}},"example":{"status":"success"}}}},"400":{"description":"Bad request (verification used, not found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Verification Was Used":{"value":{"code":"bad_request","message":"verification was used"}},"Verification Not Found":{"value":{"code":"bad_request","message":"verification not found"}}}}}},"409":{"description":"Conflict (user activated, expired, phone not confirmed, email exists)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"User Activated":{"value":{"code":"conflict","message":"user activated"}},"Verification Expired":{"value":{"code":"conflict","message":"verification expired"}},"Phone Not Confirmed":{"value":{"code":"conflict","message":"phone not confirmed"}},"Email Exists":{"value":{"code":"conflict","message":"email already exists"}}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"429":{"description":"Too many requests or attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Max Attempts":{"value":{"code":"too_many_requests","message":"max verification attempts"}},"Too Many Requests":{"value":{"code":"too_many_requests","message":"await next attempt"}}}}}}}}},"/registration/verification/confirm/email":{"post":{"summary":"Подтверждение почты пользователя","tags":["registration"],"security":[],"description":"Подтверждение почты пользователя с помощью кода\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_verification_id","email_code"],"properties":{"user_verification_id":{"description":"Verification ID","type":"string"},"email_code":{"description":"Код отправленный на почту","type":"string"}}},"example":{"user_verification_id":"9d5e3797-f5e1-4750-abd2-35b5419b4be8","email_code":"654321"}}}},"responses":{"200":{"$ref":"#/components/responses/TokenResponse"},"400":{"description":"Bad request (verification used, invalid, incorrect code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Verification Was Used":{"value":{"code":"bad_request","message":"verification was used"}},"Invalid Verification":{"value":{"code":"bad_request","message":"invalid verification"}},"Incorrect Code":{"value":{"code":"bad_request","message":"incorrect code"}}}}}},"409":{"description":"Conflict (user activated, expired, phone not confirmed, email confirmed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"User Activated":{"value":{"code":"conflict","message":"user activated"}},"Verification Expired":{"value":{"code":"conflict","message":"verification expired"}},"Phone Not Confirmed":{"value":{"code":"conflict","message":"phone not confirmed"}},"Email Confirmed":{"value":{"code":"conflict","message":"email confirmed"}}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"429":{"description":"Too many requests or attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Max Attempts":{"value":{"code":"too_many_requests","message":"max verification attempts"}},"Too Many Requests":{"value":{"code":"too_many_requests","message":"await next attempt"}}}}}}}}},"/registration/verification/call":{"post":{"summary":"Get verification call details","tags":["registration"],"security":[],"description":"Retrieve details for a verification call (check ID and call phone).\n\nNotes:\n* Used for call-based verification.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_verification_id":{"type":"string","description":"Verification ID","example":"9d5e3797-f5e1-4750-abd2-35b5419b4be8"}},"required":["user_verification_id"]}}}},"responses":{"200":{"description":"Call details retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"check_id":{"type":"string"},"call_phone":{"type":"string"}}},"example":{"check_id":"202533-34780794","call_phone":"+74995555555"}}}},"409":{"description":"Conflict (call not found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"conflict","message":"user call not found"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/account":{"get":{"summary":"User account","tags":["account"],"responses":{"200":{"description":"User account information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"$ref":"#/components/responses/401Error"}}},"put":{"summary":"Update account","tags":["account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"The new account name","type":"string"}}}}}},"responses":{"200":{"description":"Successful account name change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}},"delete":{"summary":"Remove account","tags":["account"],"responses":{"200":{"description":"Successful account remove"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"description":"Can't remove user - sites own by user"}}}},"/account/password":{"put":{"summary":"Change password","tags":["account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["current_password","new_password","new_password_confirm"],"properties":{"current_password":{"description":"The current user password","type":"string"},"new_password":{"description":"The new user password","type":"string"},"new_password_confirm":{"description":"The confirmation of new user password","type":"string"}}}}}},"responses":{"200":{"description":"Successful password change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"description":"Change password rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Invalid Password":{"description":"This error indicates that current password is invalid.\n","value":{"code":"password_invalid","message":"invalid password"}}}}}}}}},"/account/reset-password":{"post":{"summary":"Reset password request","tags":["account"],"security":[],"description":"Start the process of resetting the users account password by sending a request to the users email.<br/>\nThe user must confirm the password reset by clicking on the link from the letter received by email.<br/>\nAfter successfully confirming the password reset, a new account password will be generated and sent to the users email.\n\nNotes:\n* Reset password request expires in `24 hours`\n* Can only be used once\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"The user email","type":"string"}}},"example":{"email":"email@example.com"}}}},"responses":{"201":{"description":"Successful start of the password reset process","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"422":{"description":"Reset password request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Account Not Found":{"description":"User with this email address does not exist.\n","value":{"code":"account_not_found","message":"account not found"}}}}}}}}},"/account/email/start-change":{"post":{"summary":"Start account email change","tags":["account"],"description":"Start the account email change process by sending verification\ncodes to the user's phone number and new email address.\n\nNotes:\n* Email change request expired after `24 hours`\n* New email change can start no more than once every `3 minutes`\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"New email address","type":"string"},"phone_verification_method":{"$ref":"#/components/schemas/PhoneVerificationMethod"}}},"example":{"email":"email@example.com","phone_verification_method":"SMS"}}}},"responses":{"201":{"description":"Change process started","content":{"application/json":{"schema":{"type":"object","required":["verification_id"],"properties":{"verification_id":{"description":"Unique verification identifier.","type":"string","format":"uuid"}}},"example":{"verification_id":"b83abb5b-65bd-4021-ab1d-74c361f5b342"}}}},"422":{"description":"Email change request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Same As Original":{"description":"New email address is the same as the original one.","value":{"code":"email_same","message":"email is same as original"}},"Already Used":{"description":"New email address is already used.","value":{"code":"email_already_used","message":"email is already used"}},"Not Valid":{"description":"New email address is invalid.","value":{"code":"email_invalid","message":"email is invalid"}},"Too Many Requests":{"description":"New email address change request rejected by frequency.","value":{"code":"account_email_change_too_many_requests","message":"new email address change can start no more than once every 3 minutes"}}}}}}}}},"/account/email/confirm-change":{"post":{"summary":"Confirm account email change","tags":["account"],"description":"Confirm account email change with verification codes and verification ID\nfrom the `/account/email/start-change` endpoint.\n\nNotes:\n* maximum number of attempts to send verification codes is `5`\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["verification_id","email_code","phone_code"],"properties":{"verification_id":{"description":"Unique verification identifier.","type":"string","format":"uuid"},"email_code":{"description":"The code sent to the user email address","type":"string"},"phone_code":{"description":"The code sent to the user phone number","type":"string"}}},"example":{"verification_id":"b83abb5b-65bd-4021-ab1d-74c361f5b342","email_code":"836540","phone_code":"217436"}}}},"responses":{"200":{"description":"Successful change of the account email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"422":{"description":"Change rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Verification Not Found":{"description":"Verification not found by verification identifier","value":{"code":"account_email_change_not_found","message":"verification not found"}},"Verification Expired":{"description":"Verification expired or the number of errors exceeded.","value":{"code":"code_expired","message":"verification expired"}},"Invalid Codes":{"description":"Activation codes are invalid","value":{"code":"code_invalid","message":"codes are invalid"}},"Conflict":{"description":"The email address was used in another account.","value":{"code":"conflict","message":"The email address was used in another account"}}}}}}}}},"/account/phone/start-change":{"post":{"summary":"Start account phone change","tags":["account"],"description":"Start the account phont change process by sending verification\ncodes to the user's email address and new phone number.\n\nNotes:\n* Phone change request expired after `24 hours`\n* New phone change can start no more than once every `3 minutes`\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"description":"New phone number","type":"string"},"phone_verification_method":{"$ref":"#/components/schemas/PhoneVerificationMethod"}}},"example":{"phone":"+70000000000","phone_verification_method":"SMS"}}}},"responses":{"201":{"description":"Change process started","content":{"application/json":{"schema":{"type":"object","required":["verification_id"],"properties":{"verification_id":{"description":"Unique verification identifier.","type":"string","format":"uuid"}}},"example":{"verification_id":"b83abb5b-65bd-4021-ab1d-74c361f5b342"}}}},"422":{"description":"Phone change request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Same As Original":{"description":"New phone number is the same as the original one.","value":{"code":"phone_same","message":"phone is same as original"}},"Already Used":{"description":"New phone number is already used.","value":{"code":"phone_already_used","message":"phone is already used"}},"Not Valid":{"description":"New phone number is invalid.","value":{"code":"phone_invalid","message":"phone is invalid"}},"Too Many Requests":{"description":"New phone number change request rejected by frequency.","value":{"code":"account_phone_change_too_many_requests","message":"new phone number change can start no more than once every 3 minutes"}}}}}}}}},"/account/phone/confirm-change":{"post":{"summary":"Confirm account phone change","tags":["account"],"description":"Confirm account phone change with verification codes and verification ID\nfrom the `/account/phone/start-change` endpoint.\n\nNotes:\n* maximum number of attempts to send verification codes is `5`\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["verification_id","email_code","phone_code"],"properties":{"verification_id":{"description":"Unique verification identifier.","type":"string","format":"uuid"},"email_code":{"description":"The code sent to the user email address","type":"string"},"phone_code":{"description":"The code sent to the user phone number","type":"string"}}},"example":{"verification_id":"b83abb5b-65bd-4021-ab1d-74c361f5b342","email_code":"836540","phone_code":"217436"}}}},"responses":{"200":{"description":"Successful change of the account phone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"422":{"description":"Change rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Verification Not Found":{"description":"Verification not found by verification identifier","value":{"code":"account_phone_change_not_found","message":"verification not found"}},"Verification Expired":{"description":"Verification expired or the number of errors exceeded.","value":{"code":"code_expired","message":"verification expired"}},"Invalid Codes":{"description":"Activation codes are invalid","value":{"code":"code_invalid","message":"codes are invalid"}},"Conflict":{"description":"The phone number was used in another account.","value":{"code":"conflict","message":"The phone number was used in another account"}}}}}}}}},"/push-notifications":{"post":{"summary":"Registration of mobile and other devices","tags":["push-notifications"],"description":"Registering mobile and other devices to receive push notifications.\n\nSupported platforms and providers for push notifications.\n* __iOS__<br/>\n  - Apple Push Notification Service (APNS)\n  - Firebase Cloud Messaging (FCM)\n\n* __Android__<br/>\n  - Firebase Cloud Messaging (FCM)\n\n* __Huawei__<br/>\n  - Huawei Mobile Services (HMS)\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["platform","provider","token"],"properties":{"platform":{"description":"Push notification platform (OS)","type":"string","enum":["IOS","ANDROID","HUAWEI"]},"provider":{"description":"Push notification provider","type":"string","enum":["APNS","FCM","HMS"]},"token":{"description":"Unique device token of the push notification provider","type":"string"},"locale":{"description":"Locale of push messages for given device/token","type":"string","enum":["ru","en"]}}},"examples":{"iOS":{"description":"platform: iOS<br/>\nprovider: Apple Push Notification Service (APNS)\n","value":{"platform":"IOS","provider":"APNS","token":"176cced49328014395460a8c93d9c7a80a71dc44ff5a836a1b0febddfdd29306","locale":"en"}},"iOS (FCM)":{"description":"platform: iOS<br/>\nprovider: Firebase Cloud Messaging (FCM)\n","value":{"platform":"IOS","provider":"FCM","token":"f5iXQfCwLWA:APA91bEDJ1KofzG0pcnPzTa119_qFyRvzzaR-sDelix5--2Tsf0-ApMIfvw2xgtGyl3gp9Uzc4dIFohSOdXniyyGdFRTGwH4qJ486LB2WqgltIyo3CtMzCC3v-YVM6RYolRY3CRJrZQ4","locale":"en"}},"Android":{"description":"platform: Android<br/>\nprovider: Firebase Cloud Messaging (FCM)\n","value":{"platform":"ANDROID","provider":"FCM","token":"f5iXQfCwLWA:APA91bEDJ1KofzG0pcnPzTa119_qFyRvzzaR-sDelix5--2Tsf0-ApMIfvw2xgtGyl3gp9Uzc4dIFohSOdXniyyGdFRTGwH4qJ486LB2WqgltIyo3CtMzCC3v-YVM6RYolRY3CRJrZQ4","locale":"en"}},"Huawei":{"description":"platform: Huawei<br/>\nprovider: Huawei Mobile Services (HMS)\n","value":{"platform":"HUAWEI","provider":"HMS","token":"ANDmbp0JwPTftSc4tY90C2aW6xTGyKtTIY4idTf5GekYFfOKYmKTeqYlyKYUS0CQbf2xmUdkKWaYU6AoO1Ju6bL5lQgU7pmzQD_6cdIEABhHTLPYhMcsoF64B0tNAE_eBg","locale":"en"}}}}}},"responses":{"200":{"description":"Successful registration","content":{"application/json":{"schema":{"type":"object","required":["id","platform","provider","token"],"properties":{"id":{"description":"Unique registration identifier is system","type":"string","format":"uuid"},"platform":{"description":"Push notification platform (OS)","type":"string","enum":["IOS","ANDROID","HUAWEI"]},"provider":{"description":"Push notification provider","type":"string","enum":["APNS","FCM","HMS"]},"token":{"description":"Unique device token of the push notification provider","type":"string"}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/push-notifications/{id}":{"delete":{"summary":"Delete device registration","description":"Unregister the device to stop receiving push notifications from the server.\n","tags":["push-notifications"],"parameters":[{"name":"id","description":"Registration ID in system","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"}}}},"/push-notifications/{id}/send":{"post":{"summary":"Send a push notification to a device (Dev Only)","description":"Send a push notification to a device using the device`s registration ID in the system.\n","tags":["push-notifications"],"parameters":[{"name":"id","description":"Registration ID in system","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","message"],"properties":{"title":{"description":"Title of notification","type":"string"},"message":{"description":"Message for notification","type":"string"},"payload":{"description":"Expandable section for application data","type":"object"}}},"example":{"title":"RiHome","message":"Test Message"}}}},"responses":{"200":{"description":"Successful sending of push notification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{id}":{"get":{"summary":"Get controller by id","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Controller data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Controller"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update controller","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update controller","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"The controller name","type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Successful controller update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Controller"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Controller update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{id}/sim-number":{"put":{"summary":"Update controller SIM number","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update controller SIM number","required":true,"content":{"application/json":{"schema":{"type":"object","required":["sim_number"],"properties":{"sim_number":{"description":"The controller SIM number, e164 notation. Empty string allowed for clearing data.","type":"string","minLength":1,"maxLength":20}},"example":{"sim_number":"string"}}}}},"responses":{"200":{"description":"Successful controller update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Controller"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Controller update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{id}/online":{"get":{"summary":"Get online status of controller connection","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Online status","content":{"application/json":{"schema":{"type":"object","required":["online","channels"],"properties":{"online":{"description":"Current state of connection","type":"boolean"},"channels":{"description":"Current state of communication channels. Can be true (online), false (offline) or undefined (if there is no such channel)","type":"object","properties":{"gsm":{"description":"Current state of GSM connection","type":"boolean"},"wifi":{"description":"Current state of WiFi connection","type":"boolean"},"ethernet":{"description":"Current state of Ethernet connection","type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{id}/true-online":{"get":{"summary":"Получить онлайн-статус контроллера по запросу в контроллер","tags":["controllers"],"parameters":[{"name":"id","description":"ID контроллера","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Онлайн-статус контроллера","content":{"application/json":{"schema":{"type":"object","required":["online"],"properties":{"online":{"description":"Текущее состояние онлайна контроллера","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"500":{"$ref":"#/components/responses/500Error"}}}},"/controllers/{id}/issues":{"get":{"summary":"Get actual equipment issues","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"source","description":"The source type where the issue happened","required":false,"schema":{"type":"string","enum":["CONTROLLER","DEVICE","UNIT"]}},{"in":"query","name":"device_id","description":"The device identifier where the issue happened","required":false,"schema":{"type":"integer"}},{"in":"query","name":"unit_id","description":"The unit identifier where the issue happened","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful issue list generated","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Issue list generation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Room Forbidden":{"description":"This error indicates that the required room is forbidden.\n","value":{"code":"room_forbidden","message":"room forbidden"}},"Room Not Found":{"description":"This error indicates that the required room not found.\n","value":{"code":"room_not_found","message":"room not found"}}}}}}}}},"/controllers/{id}/wifi-networks":{"get":{"summary":"Get wifi networks in range","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful networks list generated","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WiFiNetwork"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"}}}}}}}},"/controllers/{id}/settings":{"get":{"summary":"Get controller settings","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful execution","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Set controller settings","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Controller parameters","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}},"example":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}}}},"responses":{"200":{"description":"Controller settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Settings applied rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{id}/server-settings":{"get":{"summary":"Get server-side controller settings","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful execution","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Set server-side controller settings","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Controller parameters","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}},"example":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}}}},"responses":{"200":{"description":"Controller settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Settings applied rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{id}/pairing":{"put":{"summary":"Enable pairing mode on the controller","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"202":{"description":"Successful task dispatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Enabling pairing mode rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}},"503":{"$ref":"#/components/responses/ErrorTransitInProgress"}}}},"/controllers/{id}/cancel-pairing":{"put":{"summary":"Disable pairing mode on the controller","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"202":{"description":"Successful task dispatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Disabling pairing mode rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{id}/config-update":{"put":{"summary":"Sends command to start download configuration data for controller","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"202":{"description":"Successful task dispatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"503":{"$ref":"#/components/responses/503Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/controllers/{id}/vendor-check":{"post":{"summary":"Check device-controller compatibility with vendor code","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update controller SIM number","required":true,"content":{"application/json":{"schema":{"type":"object","required":["vendor_code"],"properties":{"vendor_code":{"description":"Vendor code to check compatibility.","type":"string","minLength":1,"maxLength":20}},"example":{"vendor_code":"string"}}}}},"responses":{"200":{"description":"Successful compatibility check","content":{"application/json":{"schema":{"type":"object","properties":{"device_type":{"type":"integer","description":"device type if device compatible, 0 othervice"}}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/supported-list":{"get":{"summary":"List of controller ICERs supported at time with description.","tags":["controllers"],"responses":{"200":{"description":"Controllers list","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"icer":{"type":"string"},"description":{"type":"string"}}}},"example":[{"name":"Ri-Hub-2-bis","icer":"050B00FF0E050102","description":"Центр управления - сердце системы безопасности. Моментально оповещает пользователя о событиях на объекте и управляет работой подключенных устройств."},{"name":"Ri-Hub-2","icer":"050BFFFF0E050102","description":"Центр управления - сердце системы безопасности."}]}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"}}}},"/controllers/{id}/security-companies":{"get":{"summary":"List of security companies to which the controller is connected","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of security companies","content":{"application/json":{"schema":{"type":"object","properties":{"companies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"Super Private Security Company"},"active":{"type":"boolean","description":"Whether the company is receiving events from this controller"}}}}}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/firmware":{"get":{"summary":"Get a list of all the firmware versions","tags":["controllers-firmware"],"responses":{"200":{"description":"A list of firmware versions","content":{"application/json":{"schema":{"type":"object","properties":{"firmware":{"type":"array","items":{"$ref":"#/components/schemas/ControllerFirmware"}}}}}}}}}},"/controllers/{id}/firmware":{"get":{"summary":"Get the latest available and the current firmware versions","tags":["controllers-firmware"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The latest available and the current firmware versions","content":{"application/json":{"schema":{"type":"object","required":["current_firmware","newer_exist"],"properties":{"current_firmware":{"$ref":"#/components/schemas/ControllerFirmware"},"auto_update_enabled":{"type":"boolean","description":"Whether auto update of firmware is enabled for\nthis controller."},"newer_exist":{"type":"boolean","description":"Whether there is a new version of firmware available.\nIf false, it usually means the latest version is already installed.","example":true},"newer_firmware":{"$ref":"#/components/schemas/ControllerFirmware"}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{id}/firmware/available":{"get":{"summary":"Get a list of available firmware versions to install for specified controller","tags":["controllers-firmware"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A list of available firmware versions to install for specified controller","content":{"application/json":{"schema":{"type":"object","properties":{"firmware":{"type":"array","items":{"$ref":"#/components/schemas/ControllerFirmware"}}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{id}/firmware/update":{"post":{"summary":"Start controller update with given firmware version","tags":["controllers-firmware"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Version of the firmware to install","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firmware_version":{"type":"string","example":"1.1.119"}}}}}},"responses":{"200":{"description":"successful command execution","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"400":{"$ref":"#/components/responses/400Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"503":{"$ref":"#/components/responses/503Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/controllers/{id}/firmware/update-cancel":{"post":{"summary":"Stop controller update while file loading","tags":["controllers-firmware"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful command execution","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"400":{"$ref":"#/components/responses/400Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/controllers/{id}/security-schedule":{"get":{"summary":"Получить расписание для снятия контроллера с охраны","description":"Получить текущую конфигурацию расписания для контроллера.\nРасписание определяет временные окна для каждого дня недели, когда контроллер можно снять с охраны.\nЗначения времени указываются в минутах от начала суток (0-1439).\n\nЕсли записи расписания в базе ещё нет, сервер инициализирует расписание на контроллере значениями по умолчанию.\nЭта инициализация не выполняется, пока контроллер на охране (частичной, полной или ночной) - в этом случае возвращается ошибка 422 `reject_on_guard`.\n","tags":["controllers"],"parameters":[{"name":"id","description":"ID контроллера","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Расписание контроллера","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityScheduleResponse"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Инициализация расписания отклонена - контроллер на охране","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}},"500":{"$ref":"#/components/responses/500Error"}}},"put":{"summary":"Обновить расписание контроллера","description":"Обновить расписание для снятия контроллера с охраны.\nРасписание определяет временные окна для каждого дня недели, когда контроллер можно снять с охраны.\nЗначения времени должны быть указаны в минутах от начала суток (0-1439).\n\nДля каждого дня недели время начала и окончания должны быть указаны вместе, либо оба пропущены.\nВремя начала должно быть меньше времени окончания для каждого дня.\n\nПока контроллер на охране (частичной, полной или ночной), изменение расписания недоступно - возвращается ошибка 422 `reject_on_guard`.\n","tags":["controllers"],"parameters":[{"name":"id","description":"ID контроллера","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Параметры расписания для снятия с охраны.","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"start_monday":{"description":"Время начала для понедельника в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_monday":{"description":"Время окончания для понедельника в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_tuesday":{"description":"Время начала для вторника в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_tuesday":{"description":"Время окончания для вторника в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_wednesday":{"description":"Время начала для среды в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_wednesday":{"description":"Время окончания для среды в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_thursday":{"description":"Время начала для четверга в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_thursday":{"description":"Время окончания для четверга в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_friday":{"description":"Время начала для пятницы в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_friday":{"description":"Время окончания для пятницы в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_saturday":{"description":"Время начала для субботы в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_saturday":{"description":"Время окончания для субботы в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_sunday":{"description":"Время начала для воскресенья в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_sunday":{"description":"Время окончания для воскресенья в минутах от начала суток (0-1439)","type":"string","example":"1020"}},"example":{"start_monday":"480","end_monday":"1020","start_tuesday":"480","end_tuesday":"1020"}}}}},"responses":{"200":{"description":"Конфигурация расписания для снятия с охраны","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityScheduleResponse"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Ошибка валидации параметров расписания, либо операция отклонена - контроллер на охране (`reject_on_guard`).\nДля каждого дня должны быть указаны время начала и окончания вместе, и время начала должно быть меньше времени окончания.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/APIError"}]},"examples":{"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}},"500":{"$ref":"#/components/responses/500Error"}}}},"/controllers/{id}/registration-permissions":{"get":{"summary":"Get controller registration permissions","description":"This is the endpoint for managing controller permissions for\nre-registration on server after factory reset or any other problems.\n\n__Warning__: This endpoint can be dangerous from a security standpoint\nand should be used as a last resort.\n","tags":["controllers-danger-zone"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Controller registration permissions","content":{"application/json":{"schema":{"type":"object","required":["can_register"],"properties":{"can_register":{"description":"Permission to re-register the controller on the server","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update controller registration permissions","description":"This is the endpoint for managing controller permissions for\nre-registration on server after factory reset or any other problems.\n\n__Warning__: This endpoint can be dangerous from a security standpoint\nand should be used as a last resort.\n","tags":["controllers-danger-zone"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"New controller registration permissions","required":true,"content":{"application/json":{"schema":{"type":"object","required":["can_register"],"properties":{"can_register":{"description":"Permission to re-register the controller on the server","type":"boolean"}}}}}},"responses":{"200":{"description":"Controller registration permissions","content":{"application/json":{"schema":{"type":"object","required":["can_register"],"properties":{"can_register":{"description":"Permission to re-register the controller on the server","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}},"/controllers/{id}/factory-reset":{"put":{"summary":"Controller factory reset","description":"Clear all user data stored on controller. Rooms, devices, etc.","tags":["controllers-danger-zone"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"202":{"description":"Successful start of factory reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Factory reset rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{id}/reboot":{"put":{"summary":"Controller reboot","description":"Controller reboot needs for apply new controller settings as WiFi network, password, etc.","tags":["controllers-danger-zone"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"202":{"description":"Successful controller reboot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Reboot rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/controllers/{controllerID}/devices":{"get":{"summary":"List of controller devices","tags":["devices"],"parameters":[{"name":"controllerID","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of controller devices","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{controllerID}/devices/loggingEnable":{"put":{"summary":"Enable logging all device controller","tags":["devices"],"parameters":[{"name":"controllerID","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful"},"401":{"$ref":"#/components/responses/401Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{controllerID}/devices/loggingDisable":{"put":{"summary":"disable logging all device controller","tags":["devices"],"parameters":[{"name":"controllerID","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful"},"401":{"$ref":"#/components/responses/401Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{id}/params":{"get":{"summary":"Get parameters controller by id","tags":["controllers"],"parameters":[{"name":"id","description":"Controller ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Parameters controller data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParametersController"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/controllers/{id}/security-settings":{"get":{"summary":"Получить настройки","description":"Получить настройки для проверки целостности системы при постановке на охрану\n","tags":["controllers"],"parameters":[{"in":"path","name":"id","description":"ID контроллера","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Объект с настройками безопасности","content":{"application/json":{"schema":{"type":"object","properties":{"security_settings":{"$ref":"#/components/schemas/ControllerSecuritySettings"}},"required":["security_settings"]}}}},"400":{"$ref":"#/components/responses/400Error"},"404":{"$ref":"#/components/responses/404Error"},"504":{"$ref":"#/components/responses/ErrorControllerOffline"}}},"put":{"summary":"Обновить настройки безопасности","description":"Обновить настройки проверки целостности системы контроллера\n\nВсе настройки датчиков относятся только к охранным датчикам (grd_z=1), чтобы не происходило \nотмены постановки на охрану с датчиками не влияющими на помещение\n","tags":["controllers"],"parameters":[{"in":"path","name":"id","description":"ID контроллера","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControllerSecuritySettings"}}}},"responses":{"200":{"description":"Настройки успешно обновлены","content":{"application/json":{"schema":{"type":"object","properties":{"security_settings":{"$ref":"#/components/schemas/ControllerSecuritySettings"}},"required":["security_settings"]}}}},"400":{"$ref":"#/components/responses/400Error"},"409":{"$ref":"#/components/responses/409Error"},"504":{"$ref":"#/components/responses/ErrorControllerOffline"}}}},"/devices/{id}":{"get":{"summary":"Get device by id","tags":["devices"],"parameters":[{"name":"id","description":"Devices ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Devices data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update device","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update device","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"The device name","type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Successful device update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Device update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}},"delete":{"summary":"Delete device from controller","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"description":"Device delete rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}},"503":{"$ref":"#/components/responses/ErrorTransitInProgress"}}}},"/devices/{id}/room":{"put":{"summary":"Bind the device to room","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for binding","required":true,"content":{"application/json":{"schema":{"type":"object","required":["room_id"],"properties":{"room_id":{"description":"The room identifier. Must be on the same site as the controller.","type":"integer"}}}}}},"responses":{"200":{"description":"Successful task dispatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Device binding rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Room Not Found":{"description":"This error indicates that room does not exist on the server.\n","value":{"code":"room_not_found","message":"room not found"}},"Room Forbidden":{"description":"This error indicates that the user does not have access to the room.\n","value":{"code":"room_forbidden","message":"room forbidden"}},"Controller Not Associated with Site":{"description":"This error  indicates that controller is not associated with the site\n","value":{"code":"controller_not_associated_with_site","message":"controller is not associated with site"}},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}},"delete":{"summary":"Unbind the device from room","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Device unbind rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/devices/loggingEnable":{"post":{"summary":"enable logging device","tags":["devices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"List of device IDs"}},"example":{"device_ids":["123","321"]}}}}},"responses":{"200":{"description":"successfully"},"401":{"$ref":"#/components/responses/401Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/devices/loggingDisable":{"post":{"summary":"disable logging device","tags":["devices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"List of device IDs"}},"required":["device_ids"],"example":{"device_ids":["123","321"]}}}}},"responses":{"200":{"description":"successfully"},"401":{"$ref":"#/components/responses/401Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/devices/{id}/settings":{"get":{"summary":"Get device settings","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Device settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Set device settings","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Device parameters","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}},"example":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}}}},"responses":{"200":{"description":"Device settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Settings applied rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/devices/{id}/settings-with-units":{"put":{"summary":"Set device & zones settings","tags":["devices"],"parameters":[{"name":"id","description":"Device ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Device parameters","required":true,"content":{"application/json":{"schema":{"type":"object","required":["device_settings"],"properties":{"device_settings":{"description":"device settings array","type":"array","items":{"type":"object","required":["label","value"],"properties":{"label":{"description":"Description of available field value","type":"string"},"value":{"description":"Available field value","type":"string"}}}},"zones":{"description":"zone ID & settings array","type":"array","items":{"type":"object","required":["zone_id","zone_settings"],"properties":{"zone_id":{"description":"Device zone ID","type":"integer"},"zone_settings":{"description":"Available field value","type":"array","items":{"type":"object","required":["label","value"],"properties":{"label":{"description":"Description of available field value","type":"string"},"value":{"description":"Available field value","type":"string"}}}}}}}}},"example":{"device_settings":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"},"zones":[{"zone_id":111,"zone_settings":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}},{"zone_id":222,"zone_settings":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}}]}}}},"responses":{"200":{"description":"Device settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Settings applied rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/units/{id}":{"get":{"summary":"Get unit by id","tags":["units"],"parameters":[{"name":"id","description":"Unit ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Unit data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unit"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update unit","tags":["units"],"parameters":[{"name":"id","description":"Unit ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update unit","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"The unit name","type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Successful unit update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unit"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Unit update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/units/{id}/settings":{"get":{"summary":"Get unit settings","tags":["units"],"parameters":[{"name":"id","description":"Unit ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Unit settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Set unit settings","tags":["units"],"parameters":[{"name":"id","description":"Unit ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Unit parameters","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}},"example":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}}}},"responses":{"200":{"description":"Unit settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Settings applied rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/units/{id}/data-graph":{"get":{"summary":"Get values of the unit for a given period","tags":["units"],"parameters":[{"name":"id","description":"Unit ID","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"date_start","description":"The date since which values selected (RFC 3339)","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"date_end","description":"The date before which values selected (RFC 3339)<br/>\nNote: must be later than `date_start`\n","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"values of the unit for a given period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitGraph"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites":{"get":{"summary":"List of sites","tags":["sites"],"responses":{"200":{"description":"List of sites","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Site"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"}}},"post":{"summary":"Create new site and bind controller to user","tags":["sites"],"requestBody":{"description":"Required data for new site","required":true,"content":{"application/json":{"schema":{"type":"object","required":["site_name","controller_icer","controller_serial_number"],"properties":{"site_name":{"description":"The site name","type":"string","minLength":1,"maxLength":100},"controller_icer":{"description":"Controller type in hex format (length 16)","type":"string","pattern":"^[A-F0-9]{16}$","minLength":16,"maxLength":16},"controller_serial_number":{"description":"Controller serial number","type":"string","pattern":"^[1-9][0-9]*$"},"location_id":{"description":"The location identifier","type":"integer"}}}}}},"responses":{"201":{"description":"Successful site creation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"description":"Site creation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Not Found":{"description":"This error indicates that the new controller did not perform a self-initial\nregistration with the server, or simply does not exist on the server.\n","value":{"code":"new_controller_not_found","message":"controller not found"}},"Controller Offline":{"description":"This error indicates that the new controller is not connected to the server\nto check the registration permission.\n","value":{"code":"new_controller_offline","message":"controller is offline"}},"Controller is Already Registered":{"description":"This error indicates that the new controller is already registered on the server\nunder a different account.\n","value":{"code":"new_controller_registered","message":"controller is already registered"}},"Controller Registration Rejected":{"description":"This error indicates that the registration of the new controller has been rejected.\nPossible reasons may be a blocked or unsupported controller.\n","value":{"code":"new_controller_rejected","message":"registration of the new controller has been rejected"}},"Location Not Found":{"description":"This error indicates that location does not exist on the server.\n","value":{"code":"location_not_found","message":"location not found"}},"Location Forbidden":{"description":"This error indicates that the user does not have access to the location.\n","value":{"code":"location_forbidden","message":"location forbidden"}}}}}}}}},"/sites/detailed":{"get":{"summary":"List of sites with details, specific for current user","tags":["sites"],"parameters":[{"in":"query","name":"site_events_limit","description":"The amount of latest site events to list for each site","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"List of sites with details, specific for current user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SiteDetailed"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"}}}},"/sites/short":{"get":{"summary":"Краткий список домов пользователя","tags":["sites"],"parameters":[{"in":"query","name":"user_id","description":"Идентификатор пользователя. Доступно только администратору для просмотра чужих сайтов","schema":{"type":"integer","minimum":1},"required":false}],"responses":{"200":{"description":"Краткий список сайтов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortSitesInfoResponse"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"}}}},"/sites/{id}":{"get":{"summary":"Get site by ID","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Site data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update site","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update site","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"The site name","type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Successful site update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Site update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}},"delete":{"summary":"Delete site and unbind controller from user.","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"factory_reset","description":"Reset the controller to factory defaults before deleting.","required":false,"schema":{"type":"boolean"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"description":"Site delete rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/sites/{id}/detailed":{"get":{"summary":"Получить детальную информацию по дому","tags":["sites"],"parameters":[{"name":"id","description":"ID дома","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"user_id","description":"ID пользователя. Используется для просмотра данных другого пользователя (только админ)","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"include_issues","description":"Включать ли список проблем безопасности в блоке security.status_guard.issues. По умолчанию true","required":false,"schema":{"type":"boolean","default":true}},{"in":"query","name":"include_widgets","description":"Устаревший параметр. Сохранен для обратной совместимости","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"Детальная информация по дому","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteDetailedResponse"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{id}/status-issues":{"get":{"summary":"Получить краткий статус проблем безопасности по дому","tags":["sites"],"parameters":[{"name":"id","description":"ID дома","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"user_id","description":"ID пользователя. Используется для просмотра данных другого пользователя (только админ)","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Краткий статус проблем безопасности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteStatusIssuesResponse"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{id}/widgets":{"get":{"summary":"Получить виджеты дома, сгруппированные по комнатам","tags":["sites"],"parameters":[{"name":"id","description":"ID дома","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Список комнат дома с виджетами","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SiteRoomWidgetsResponse"}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{id}/location":{"put":{"summary":"New universal endpoint, replaces all location endpoints","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data to create new or update existing site location","required":true,"content":{"application/json":{"schema":{"required":["country","city","street","house"],"properties":{"country":{"description":"Country name","type":"string"},"city":{"description":"City name","type":"string"},"street":{"description":"street name","type":"string"},"house":{"description":"House number","type":"string"},"building":{"description":"building number","type":"string"},"flat":{"description":"flat number","type":"string"},"check_geo":{"description":"flag for check geodata for existing in database","type":"boolean"}}}}}},"responses":{"200":{"description":"Successful site location update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Site location update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Location Not Found":{"description":"This error indicates that location does not exist on the server.\n","value":{"code":"location_not_found","message":"location not found"}},"Location Forbidden":{"description":"This error indicates that the user does not have access to the location.\n","value":{"code":"location_forbidden","message":"location forbidden"}}}}}}}}},"/sites/{id}/commercial":{"put":{"summary":"Update site commercial purpose","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update site","required":true,"content":{"application/json":{"schema":{"type":"object","required":["is_commercial"],"properties":{"is_commercial":{"description":"The commercial purpose","type":"boolean"}}}}}},"responses":{"200":{"description":"Successful site update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Site update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/sites/{id}/guard":{"put":{"summary":"Site guard management","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"New guard action","required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"description":"Guard action type","type":"string","enum":["ARM","ARM_WITH_ISSUE","DISARM"]},"room_id":{"description":"Optional room identifier for apply guard action to room","type":"integer"},"site":{"description":"Returns updated site data with a successful response","type":"boolean"}}}}}},"responses":{"200":{"description":"Guard action result","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"description":"The status of the guard action execution","type":"boolean"},"issues":{"description":"Issues due to which the guard action cannot be executed","type":"array","items":{"$ref":"#/components/schemas/Issue"}},"site":{"description":"Updated site data (optional)","$ref":"#/components/schemas/Site"}}},"examples":{"Successful Guard Action":{"description":"The result of a successful guard action.\n","value":{"success":true}},"Successful Guard Action With Updated Site":{"description":"The result of a successful guard action with updated site.\n\n__Note:__ To get an updated site, the request must contain\n          a `site` field with a `true` value.\n","value":{"success":true,"site":{"id":0,"name":"string","user_id":0,"controller_id":0,"image_url":"string","guard_state":"NONE","alerts":["NONE"],"has_active_siren":true,"location":{"id":0,"user_id":0,"country":"string","city":"string","street":"string","house":"string","building":"string","flat":"string"},"rooms":[{"id":0,"name":"string","site_id":0,"image_url":"string","guard_state":"NONE","alerts":["NONE"],"has_active_siren":true,"widgets":[{"id":"string","type":"MALFUNCTION","title":"string","device_id":0,"unit_id":0}]}]}}},"Guard Action Issues":{"description":"Guard action was rejected with list of issues.\n\n__Note:__ For execution guard actions with ignoring any issues,\n          use action types with the suffix `WITH_ISSUE`.\n","value":{"success":false,"issues":[{"code":"connection_lost","message":"string","source":"CONTROLLER","controller_id":0,"device_id":0,"unit_id":0}]}}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Guard action rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Room Forbidden":{"description":"This error indicates that the required room is forbidden.\n","value":{"code":"room_forbidden","message":"room forbidden"}},"Room Not Found":{"description":"This error indicates that the required room not found.\n","value":{"code":"room_not_found","message":"room not found"}}}}}}}}},"/sites/{id}/disable-siren":{"put":{"summary":"Disable active sirens by site ID","tags":["sites"],"parameters":[{"name":"id","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"202":{"description":"Successful task dispatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorControllerOffline"}}}},"/sites/{siteID}/has-keypad":{"get":{"summary":"Checks of existense keyboard device in given site.","tags":["sites"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"keypad existense JSON tag","content":{"application/json":{"schema":{"type":"object","properties":[{"name":"site_id","type":"integer"},{"name":"has_keypad","type":"boolean"}],"example":{"site_id":"integer","has_keypad":"boolean"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/alarm":{"post":{"summary":"Causes a silent alarm for all users in the house","tags":["sites"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"New guard action","required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"siren":{"description":"Indicates whether an alarm with a siren is necessary","type":"boolean"},"coordinates":{"description":"Coordinates of the person who pushed the button","type":"string"}}}}}},"responses":{"200":{"description":"success"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/scripts":{"get":{"summary":"Get a list of scripts for this site","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success. Important: this list does NOT include the scripts themselves, only information about them.\nIn order to get a full information about a script, see the other endpoint, which uses specific script ID.","content":{"application/json":{"schema":{"type":"object","properties":{"scripts":{"type":"array","items":{"$ref":"#/components/schemas/SiteScript"}}}}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"500":{"$ref":"#/components/responses/500Error"}}},"post":{"summary":"Create a new script","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"New script","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"script":{"type":"object","properties":{"name":{"type":"string","description":"Name of the script","example":"Lights"},"script":{"type":"string","description":"JSON-encoded script","example":"{ ... }"}}}}}}}},"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"script":{"$ref":"#/components/schemas/SiteScriptFull"}}}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"500":{"$ref":"#/components/responses/500Error"}}}},"/sites/{siteID}/scripts/{id}":{"get":{"summary":"Get full information about a script by its ID, including the script itself","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"script":{"$ref":"#/components/schemas/SiteScriptFull"}}}}}}}},"put":{"summary":"Update the script","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"The updated script","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"script":{"type":"object","properties":{"name":{"type":"string","description":"Name of the script","example":"Lights"},"script":{"type":"string","description":"JSON-encoded script","example":"{ ... }"}}}}}}}},"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"script":{"$ref":"#/components/schemas/SiteScriptFull"}}}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"503":{"$ref":"#/components/responses/503Error"},"504":{"$ref":"#/components/responses/504Error"}}},"delete":{"summary":"Delete the script","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/scripts/{id}/load":{"put":{"summary":"Load the script to the controller","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"503":{"$ref":"#/components/responses/503Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/scripts/{id}/unload":{"put":{"summary":"Delete the script from the controller (it will remain on the server)","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/scripts/{id}/start":{"put":{"summary":"Start the script handler","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/scripts/{id}/stop":{"put":{"summary":"Stop the script handler","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/scripts/{id}/widgets/{widgetID}/trigger":{"post":{"summary":"Trigger the script execution","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Script ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"widgetID","description":"Script Widget ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/script-constraints":{"get":{"summary":"Get a list of constraints for scripts for this site","tags":["scripts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"constraints":{"description":"Possible constraints:\n<ul>\n  <li>file_version - Supported version of script file format</li>\n  <li>comp_lev_max - Maximum supported level of script complexity</li>\n  <li>file_size_max - Maximum size of script file in bytes</li>\n  <li>files_num_max - Maximum amount of scripts in the hub</li>\n</ul>","type":"object","additionalProperties":{"type":"string"}}}}}}},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/422Error"},"500":{"$ref":"#/components/responses/500Error"},"504":{"$ref":"#/components/responses/504Error"}}}},"/sites/{siteID}/rooms":{"get":{"summary":"List of site rooms","tags":["rooms"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of rooms","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Room"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"post":{"summary":"Create a new room on site","tags":["rooms"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Room properties","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The room name","type":"string","minLength":1,"maxLength":100},"site_user_ids":{"description":"List of site user IDs ( can be null )","type":"array","items":{"type":"integer","nullable":true},"uniqueItems":true}}}}}},"responses":{"201":{"description":"Data of new room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Room creation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"},"Max Count Reached":{"description":"This error indicates that the maximum number of rooms has been reached on the site.\n","value":{"code":"room_max_count_reached","message":"maximum number of rooms reached"}}}}}}}}},"/rooms/{id}":{"get":{"summary":"Get room by id","tags":["rooms"],"parameters":[{"name":"id","description":"Room ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Room data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update room","tags":["rooms"],"parameters":[{"name":"id","description":"Room ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update room","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"The room name","type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Successful room update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Controller update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}},"delete":{"summary":"Delete room by id","tags":["rooms"],"parameters":[{"name":"id","description":"Room ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"description":"Room delete rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/rooms/{id}/settings":{"get":{"summary":"Get room settings","tags":["rooms"],"parameters":[{"name":"id","description":"Room ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Room settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Set room settings","tags":["rooms"],"parameters":[{"name":"id","description":"Room ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Room parameters","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}},"example":{"field_key_1":"string","field_key_2":"string","field_key_3":"string"}}}},"responses":{"200":{"description":"Room settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Settings applied rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Reject On Guard":{"$ref":"#/components/examples/APIError_RejectOnGuard"}}}}}}}},"/sites/{siteID}/events":{"get":{"summary":"List of site events","tags":["events"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"class","description":"The event class for the filter result.\n","required":false,"schema":{"type":"array","items":{"type":"string","enum":["INFO","GUARD","MALFUNCTION","CONTROL","ALERT"]}},"style":"form","explode":true},{"in":"query","name":"after_id","description":"The event id after which the list should be returned","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"limit","description":"The event list size (max 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"date_start","description":"The date since which the events happened (RFC 3339)","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"date_end","description":"The date before which the events happened (RFC 3339)<br/>\n\nNote: must be later than `date_start`\n","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"room_id","description":"The room identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"controller_id","description":"The controller identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"device_id","description":"The device identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"unit_id","description":"The unit identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"unread","description":"Filter to get only unread events","required":false,"schema":{"type":"boolean","enum":[true]}}],"responses":{"200":{"description":"List of events","headers":{"Link":{"schema":{"type":"string"},"description":"Links to related resources, in the format defined by\n[RFC 5988](https://tools.ietf.org/html/rfc5988#section-5).\nThis will include a link with relation type `next` to the\nnext page, if there is a next page.\n"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserSiteEvent"}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/sites/{siteID}/events-export":{"get":{"summary":"export list of site events to user email","tags":["events"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"class","description":"The event class for the filter result.\n","required":false,"schema":{"type":"array","items":{"type":"string","enum":["INFO","GUARD","MALFUNCTION","CONTROL","ALERT"]}},"style":"form","explode":true},{"in":"query","name":"after_id","description":"The event id after which the list should be returned","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"limit","description":"The event list size (max 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"date_start","description":"The date since which the events happened (RFC 3339)","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"date_end","description":"The date before which the events happened (RFC 3339)<br/>\n\nNote: must be later than `date_start`\n","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"room_id","description":"The room identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"controller_id","description":"The controller identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"device_id","description":"The device identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"unit_id","description":"The unit identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"unread","description":"Filter to get only unread events","required":false,"schema":{"type":"boolean","enum":[true]}},{"in":"query","name":"exp_type","description":"Type of export result (xls, csv). If ommited, defaults to xls","required":false,"schema":{"type":"array","items":{"type":"string","enum":["xls","csv"]}}},{"in":"query","name":"tz_offset","description":"TimeZone offset in hours, for converting UTC times to user's local time. UTC if ommited.","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successfully start of export task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/events":{"get":{"summary":"List of events (DEPRECATED)","tags":["events"],"parameters":[{"in":"query","name":"class","description":"The event class for the filter result.\n","required":false,"schema":{"type":"array","items":{"type":"string","enum":["INFO","GUARD","MALFUNCTION","CONTROL","ALERT"]}},"style":"form","explode":true},{"in":"query","name":"after_id","description":"The event id after which the list should be returned","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"limit","description":"The event list size (max 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"date_start","description":"The date since which the events happened (RFC 3339)","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"date_end","description":"The date before which the events happened (RFC 3339)<br/>\n\nNote: must be later than `date_start`\n","required":false,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"site_id","description":"The site identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"room_id","description":"The room identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"controller_id","description":"The controller identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"device_id","description":"The device identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"unit_id","description":"The unit identifier where the event happened","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"unread","description":"Filter to get only unread events","required":false,"schema":{"type":"boolean","enum":[true]}}],"responses":{"200":{"description":"List of events","headers":{"Link":{"schema":{"type":"string"},"description":"Links to related resources, in the format defined by\n[RFC 5988](https://tools.ietf.org/html/rfc5988#section-5).\nThis will include a link with relation type `next` to the\nnext page, if there is a next page.\n"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserSiteEvent"}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/unread-events":{"get":{"summary":"Number of unread events","tags":["events"],"description":"Endpoint for getting the number of unread events with a filter.\n\nFilter logic:\n- __without any params__: All unread events on all sites\n- __with `site_id`__: Unread events on one site\n","parameters":[{"in":"query","name":"site_id","description":"Site ID for getting unread events by site","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Number of unread events","content":{"application/json":{"schema":{"type":"object","required":["count"],"properties":{"count":{"description":"Number of unread events","type":"integer"}}},"example":{"count":15}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/unread-events/read":{"put":{"summary":"Mark events as read","tags":["events"],"description":"Endpoint for marking events as read with different read types.</br>\nIf the user has already read or does not have access to the site event, they will be skipped.\n\nSupported read types:\n* Read by event IDs (ids)\n* Read by site cursor - all after event ID (site_cursor).\n","requestBody":{"description":"Required data for mark event as read","required":true,"content":{"application/json":{"schema":{"oneOf":[{"description":"Mark as read by array of event IDs","type":"object","required":["read_type","ids"],"properties":{"read_type":{"type":"string","enum":["ids"]},"ids":{"description":"List of events IDs","type":"array","items":{"type":"integer","minimum":1}}}},{"description":"Mark as read by site cursor","type":"object","required":["read_type","site_id","start_id"],"properties":{"read_type":{"type":"string","enum":["site_cursor"]},"site_id":{"description":"Site ID where the event happened","type":"integer","minimum":1},"start_id":{"description":"Starting event ID","type":"integer","minimum":1}}}]},"examples":{"ids":{"description":"Mark as read by array of event IDs","value":{"read_type":"ids","ids":[30,31,32,33]}},"site_cursor":{"description":"Mark as read by site cursor","value":{"read_type":"site_cursor","site_id":10,"start_id":33}}}}}},"responses":{"200":{"description":"Successfully mark events as read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/sites/{siteID}/alerts":{"get":{"summary":"List of site alerts","tags":["site-alerts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"in":"query","name":"after_id","description":"The site alert id after which the list should be returned","required":false,"schema":{"type":"integer","minimum":1}},{"in":"query","name":"limit","description":"The site alerts list size (max 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"List of site alerts","headers":{"Link":{"schema":{"type":"string"},"description":"Links to related resources, in the format defined by\n[RFC 5988](https://tools.ietf.org/html/rfc5988#section-5).\nThis will include a link with relation type `next` to the\nnext page, if there is a next page.\n"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SiteAlert"}}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/sites/{siteID}/alerts/{id}":{"get":{"summary":"Get site alert","tags":["site-alerts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site Alert ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Site alert data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteAlert"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/alerts/reset":{"put":{"summary":"Reset site alarm","tags":["site-alerts"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for reset alarms at the site","required":true,"content":{"application/json":{"schema":{"oneOf":[{"description":"Reset site alerts by array of site alert IDs","type":"object","required":["reset_type","ids"],"properties":{"reset_type":{"type":"string","enum":["ids"]},"ids":{"description":"List of site alert IDs","type":"array","items":{"type":"integer","minimum":1}}}},{"description":"Reset site alerts by alert type and site alert cursor","type":"object","required":["reset_type","alert_type","start_id"],"properties":{"reset_type":{"type":"string","enum":["alert_type_cursor"]},"alert_type":{"$ref":"#/components/schemas/AlertType"},"start_id":{"description":"Starting site alert ID","type":"integer","minimum":1}}}]},"examples":{"ids":{"description":"Reset site alerts by array of site alert IDs","value":{"reset_type":"ids","ids":[30,31,32,33]}},"alert_type_cursor":{"description":"Reset site alerts by alert type and site alert cursor","value":{"reset_type":"alert_type_cursor","alert_type":"MOVE","start_id":33}}}}}},"responses":{"200":{"description":"Successful site alarm reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"400":{"$ref":"#/components/responses/400Error"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorControllerOffline"}}}},"/sites/{siteID}/user":{"get":{"summary":"Get current site user","tags":["site-users"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Information about the current site user for the site, his role and permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUser"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/users":{"get":{"summary":"List of active site users","tags":["site-users"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of site users, their roles and permissions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SiteUser"}}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"post":{"summary":"Create new site user","tags":["site-users"],"description":"__Note:__ This endpoint used only for creating new local site users with phone number as contact.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for new site user","required":true,"content":{"application/json":{"schema":{"type":"object","required":["role","username","contact"],"properties":{"role":{"description":"User role for the site","type":"string","enum":["LOCAL_USER"]},"username":{"description":"Username","type":"string"},"contact":{"description":"User contact (it can be an email or a phone)","type":"string"}}},"examples":{"Local Site User":{"value":{"role":"LOCAL_USER","username":"Nick Fury","contact":"+70000000000"}}}}}},"responses":{"201":{"description":"New site user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUser"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Creation of a new invitation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"}}}}}}}},"/sites/{siteID}/users/{id}":{"put":{"summary":"Update site user","tags":["site-users"],"description":"__Note:__\n* The site owner can only update by himself.\n* The site owner permissions cannot be changed, they will always be enabled all.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update site user","required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","permissions"],"properties":{"username":{"description":"Username for the site","type":"string","minLength":1,"maxLength":100},"permissions":{"$ref":"#/components/schemas/SiteUserPermissions"},"partitions":{"description":"list of parts(rooms) id that user has access","type":"array","items":{"type":"integer","nullable":true,"uniqueItems":true}},"key_chain":{"description":"key chain id tha user has access","type":"integer","nullable":true}}}}}},"responses":{"200":{"description":"Successful site user update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUser"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Site user update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"}}}}}}},"delete":{"summary":"Delete site user","tags":["site-users"],"description":"__Note:__\n* Site owner cannot delete himself.\n* User can delete himself without additional permissions.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Deletion of site user rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Owner Cannot Be Deleted":{"description":"This error indicates that the site owner cannot be deleted from site users.\n","value":{"code":"owner_cannot_be_deleted_from_site_users","message":"owner cannot be deleted from site users"}}}}}}}}},"/sites/{siteID}/users/{id}/make-owner":{"post":{"summary":"Make the site owner","tags":["site-users"],"description":"__Note:__\n* Only the site owner can make a site user the new site owner.\n* Local user cannot be site owner.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful change of site owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Change site owner is rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Local User Cannot Be Site Owner":{"description":"This error indicates that the local user cannot be the site owner.\n","value":{"code":"local_user_cannot_be_site_owner","message":"local user cannot be site owner"}}}}}}}}},"/sites/{siteID}/users/{id}/access-code":{"put":{"summary":"Set access code for site user","tags":["site-users"],"description":"__Note:__\n* The server user can set the code only for himself.\n* For the local user, the code can be set by the server user with permissions for that.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["new_code","new_code_confirm"],"properties":{"new_code":{"description":"The new code","type":"string","pattern":"^[0-9]$","maxLength":6,"minLength":4},"new_code_confirm":{"description":"The confirmation of new code","type":"string","pattern":"^[0-9]$","maxLength":6,"minLength":4}}}}}},"responses":{"200":{"description":"Successful change of access code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Change access code is rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Invalid Code":{"description":"This error indicates that current password is invalid.\n","value":{"code":"site_user_code_invalid","message":"access code is invalid"}},"Code Already In Use":{"description":"This error indicates that the site user code is already in use.\n","value":{"code":"site_user_code_already_in_use","message":"access code is already in use"}}}}}}}}},"/sites/{siteID}/users/{id}/duress-code":{"put":{"summary":"Set duress code for site user","tags":["site-users"],"description":"__Note:__\n* The server user can set the code only for himself.\n* For the local user, the code can be set by the server user with permissions for that.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["new_code","new_code_confirm"],"properties":{"new_code":{"description":"The new code","type":"string","pattern":"^[0-9]$","maxLength":6,"minLength":4},"new_code_confirm":{"description":"The confirmation of new code","type":"string","pattern":"^[0-9]$","maxLength":6,"minLength":4}}}}}},"responses":{"200":{"description":"Successful change of duress code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Change duress code is rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Invalid Code":{"description":"This error indicates that current password is invalid.\n","value":{"code":"site_user_code_invalid","message":"duress code is invalid"}},"Code Already In Use":{"description":"This error indicates that the site user code is already in use.\n","value":{"code":"site_user_code_already_in_use","message":"duress code is already in use"}}}}}}}}},"/sites/{siteID}/users/{id}/codes-check":{"get":{"summary":"Checks access code for site user is set","tags":["site-users"],"description":"__Note:__\n* The server user can check the code set only for himself.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful check of access code","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"access_set":{"description":"Code set check result","type":"boolean"},"duress_set":{"description":"Code set check result","type":"boolean"}}}},"example":{"access_set":true,"duress_set":true}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/users/{id}/access-code-check":{"get":{"summary":"Checks access code for site user is set","tags":["site-users"],"description":"__Note:__\n* The server user can check the code set only for himself.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful check of access code","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"code_set":{"description":"Code set check result","type":"boolean"}}}},"example":{"code_set":true}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/users/{id}/codes":{"delete":{"summary":"Clear all user codes if exists","tags":["site-users"],"description":"__Note:__\n* The server user can clear the code only for himself.\n* For the local user, the code can be cleared by the server user with permissions for that.\n","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful clear","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"success"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/sites/{siteID}/users/{id}/notifications":{"get":{"summary":"Get current site user notifications","tags":["site-users"],"description":"Only Push notifications works now. Call & SMS will be realised in controller.","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUserNotifications"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"put":{"summary":"Update site user notifications","tags":["site-users"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update site user","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUserNotifications"}}}},"responses":{"200":{"description":"Successful site user notifications update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUserNotifications"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Site user update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"}}}}}}}},"/sites/{siteID}/users/{id}/sms-locale":{"put":{"summary":"Update site user locale.","tags":["site-users"],"description":"Update site user locale. This info uses in controller to send SMS localised.","parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site User ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for update site user","required":true,"content":{"application/json":{"schema":{"type":"object","required":["sms_locale"],"properties":{"sms_locale":{"description":"Locale code for user & hub","type":"string"}}}}}},"responses":{"200":{"description":"Successful site user update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteUser"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Site user locale update rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"}}}}}}}},"/sites/{siteID}/monitoring-info":{"get":{"summary":"get information about request or connection to chop","tags":["surgard"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"monitoring_request":{"$ref":"#/components/schemas/Request"},"security_company":{"$ref":"#/components/schemas/SecurityCompanySurgard"}}}}}},"201":{"content":{"application/json":{"schema":{"properties":{"monitoring":{"type":"string"},"security_company":{"$ref":"#/components/schemas/SecurityCompanySurgard"}}}}}}}}},"/sites/{siteID}/invitations":{"get":{"summary":"List of outgoing site invitations","tags":["site-invitations"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of site invitations","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","site_id","username","contact","created_at"],"properties":{"id":{"description":"Site invitation ID","type":"integer"},"site_id":{"description":"Site ID","type":"integer"},"username":{"description":"Username for invitation","type":"string"},"contact":{"description":"User contact (it can be an email or a phone)","type":"string"},"was_rejected":{"description":"Indicator that the invitation was rejected by the invited user.","type":"boolean"},"created_at":{"description":"Date and time the invitation was created","type":"string","format":"date-time"}}}},"example":[{"id":123,"site_id":94,"username":"Ivan Ivanov","contact":"email@example.com","created_at":"2021-04-06T13:13:35.774Z"},{"id":124,"site_id":94,"username":"Nick Fury","contact":"+70000000000","was_rejected":true,"created_at":"2021-04-06T13:13:35.774Z"}]}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}},"post":{"summary":"Create new site invitation","tags":["site-invitations"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"description":"Required data for new site invitation","required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","contact"],"properties":{"username":{"description":"Username for invitation","type":"string"},"contact":{"description":"User contact (it can be an email or a phone)","type":"string"}}},"examples":{"Invite By Email":{"value":{"username":"Ivan Ivanov","contact":"email@example.com"}},"Invite By Phone":{"value":{"username":"Nick Fury","contact":"+70000000000"}}}}}},"responses":{"201":{"description":"New site invitation","content":{"application/json":{"schema":{"type":"object","required":["id","site_id","username","contact","created_at"],"properties":{"id":{"description":"Site invitation ID","type":"integer"},"site_id":{"description":"Site ID","type":"integer"},"username":{"description":"Username for invitation","type":"string"},"contact":{"description":"User contact (it can be an email or a phone)","type":"string"},"was_rejected":{"description":"Indicator that the invitation was rejected by the invited user.","type":"boolean"},"created_at":{"description":"Date and time the invitation was created","type":"string","format":"date-time"}}},"example":{"id":123,"site_id":94,"username":"Ivan Ivanov","contact":"email@example.com","created_at":"2021-04-06T13:13:35.774Z"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Creation of a new invitation rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"},"User Already Invited":{"description":"This error indicates that the user has already been invited.\n","value":{"code":"user_already_invited","message":"user already invited"}},"Site Invitation Already Exists":{"description":"This error indicates that the site invitation already created for provided site and contact.\n","value":{"code":"site_invitation_already_exists","message":"site invitation already exists"}}}}}}}}},"/sites/{siteID}/invitations/{id}":{"delete":{"summary":"Delete site invitation","tags":["site-invitations"],"parameters":[{"name":"siteID","description":"Site ID","in":"path","required":true,"schema":{"type":"integer"}},{"name":"id","description":"Site Invitation ID","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/site-invitations":{"get":{"summary":"List of incoming site invitations","tags":["site-invitations"],"responses":{"200":{"description":"List of site invitations","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","from_user","to_site","site_id"],"properties":{"id":{"description":"Site invitation ID","type":"integer"},"from_user":{"description":"Username who sent the invitation","type":"string"},"to_site":{"description":"Site name where the user is invited","type":"string"},"site_id":{"description":"Site ID","type":"integer"}}}},"example":[{"id":13,"from_user":"Ivan Ivanov","to_site":"Bathhouse","site_id":27},{"id":14,"from_user":"Nick Fury","to_site":"Helicarrier","site_id":32}]}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"}}}},"/site-invitations/{id}":{"post":{"summary":"Accept or reject incoming site invitation","tags":["site-invitations"],"description":"Action effects:\n- **ACCEPT** – The user will get access to the site at the site invitation.\n- **REJECT** – The sender of the invitation is the recipient of information about the rejection of the invitation.\n\n__Note:__ After processing incoming site invitation will be hide from user.\n","parameters":[{"name":"id","description":"Incoming Site Invitation ID","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Required data to apply action to incoming site invitation","required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"description":"Action type","type":"string","enum":["ACCEPT","REJECT"]}}},"examples":{"Accept":{"value":{"action":"ACCEPT"}},"Reject":{"value":{"action":"REJECT"}}}}}},"responses":{"204":{"$ref":"#/components/responses/204Response"},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"}}}},"/widgets/{id}/action":{"put":{"summary":"Apply widget action","tags":["widgets"],"description":"Information about supported widget actions can be found in the widget description.</br>\nIn general, the actions of a widget depend on the type of widget.\n","parameters":[{"name":"id","description":"Widget ID","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Required data to apply the widget action","required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"description":"Action type","type":"string"},"duration_seconds":{"description":"Duration of an action in seconds. Default is 0, which means forever.","type":"integer","required":false}}}}}},"responses":{"202":{"description":"Successful action dispatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"status":"accepted"}}}},"401":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"description":"Widget action rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"},"Unsupported Action":{"description":"This error indicates that widget does not support the requested action.\n","value":{"code":"widget_not_support_action","message":"widget does not support action"}}}}}}}}},"/catalog/devices":{"get":{"summary":"Get the company device catalog","tags":["catalog"],"security":[],"responses":{"200":{"description":"Device information list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CatalogDevice"}}}}}}}},"/apps/supported":{"get":{"summary":"Get information about supported versions of frontend apps","tags":["apps"],"security":[],"responses":{"200":{"description":"Information about supported versions of frontend apps","content":{"application/json":{"schema":{"type":"object","properties":{"min_android_version":{"type":"string","example":"1.1.25"},"min_ios_version":{"type":"string","example":"1.1.2"}}}}}}}}},"/feedback":{"post":{"summary":"Send feedback","tags":["feedback"],"description":"Send feedback about some problem with RiDom","requestBody":{"description":"Feedback content","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"object","required":["topic","text"],"properties":{"site_id":{"description":"Site ID where the problem occured (optional)","type":"integer","example":12},"client_version":{"description":"Client information and version","type":"string","maxLength":100,"example":"Android app; prod; 1.1.112"},"topic":{"description":"Topic of the feedback","type":"string","maxLength":100,"example":"The guard mode is not working"},"text":{"description":"Detailed description of the problem","type":"string","example":"I clicked something and everything crashed"}}}}}}}},"responses":{"200":{"description":"Sent feedback content","content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"object","required":["topic","text"],"properties":{"site_id":{"description":"Site ID where the problem occured (optional)","type":"integer","example":12},"client_version":{"description":"Client information and version","type":"string","maxLength":100,"example":"Android app; prod; 1.1.112"},"topic":{"description":"Topic of the feedback","type":"string","maxLength":100,"example":"The guard mode is not working"},"text":{"description":"Detailed description of the problem","type":"string","example":"I clicked something and everything crashed"}}}}}}}},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}}},"/news":{"get":{"summary":"View news","tags":["news"],"description":"View a list of news received","parameters":[{"in":"query","name":"limit","required":false,"description":"Sets the limit of the news list","schema":{"type":"integer"}},{"in":"query","name":"locale","required":false,"description":"Indicates in which language to show the news","schema":{"type":"string","enum":["en","ru"]}},{"in":"query","name":"dateBefore","required":false,"description":"Indicates the date after which no news will be shown","schema":{"type":"string","format":"date"}},{"in":"query","name":"dateAfter","required":false,"description":"Indicates the date from which to display news","schema":{"type":"string","format":"date"}},{"in":"query","name":"read","required":false,"description":"Whether or not the news is read","schema":{"type":"boolean"}},{"in":"query","name":"screen","required":false,"description":"Whether the news should be displayed on the home screen","schema":{"type":"boolean"}},{"in":"query","name":"type","required":false,"description":"Type of message","schema":{"type":"string","enum":["NEWS","INFORMATION","TECHNICAL","NOTIFICATION"]}},{"in":"query","name":"offset","description":"offset of the list should be returned","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List news","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/News"}}}}},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}}},"/news/{id}/read":{"put":{"summary":"Read the news","tags":["news"],"description":"Read the selected news","parameters":[{"in":"path","name":"id","required":true,"description":"Id News"}],"responses":{"200":{"description":"News readed"},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}}},"/news/unread":{"get":{"summary":"Number of unread news items","tags":["news"],"description":"Number of unread news from the user","responses":{"200":{"description":"Number of unread news from the user","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"500":{"$ref":"#/components/responses/500Error"}}}},"/news/{id}":{"get":{"summary":"Get news","tags":["news"],"description":"View news received","responses":{"200":{"description":"news","content":{"application/json":{"schema":{"$ref":"#/components/schemas/News"}}}},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}}},"/sites/{id}/request":{"get":{"summary":"Просмотр существующих заявок","tags":["surgard"],"description":"Просмотр существующих заявок","parameters":[{"in":"path","name":"id","required":true,"description":"id дома"}],"responses":{"200":{"description":"request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}}}},"post":{"summary":"Создание заявки","description":"Создание заявки","tags":["surgard"],"parameters":[{"in":"path","name":"id","required":true,"description":"id дома"}],"requestBody":{"description":"request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCreate"}}}},"responses":{"201":{"description":"request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}}}},"delete":{"summary":"Удаление заявок","description":"удаление заявок","tags":["surgard"],"parameters":[{"in":"path","name":"id","required":true,"description":"id дома"}],"requestBody":{"description":"request","content":{"application/json":{"schema":{"properties":{"req_id":{"type":"integer","description":"request id"}}}}}},"responses":{"204":{"description":"request"}}}},"/companies":{"get":{"summary":"Просмотр компаний","description":"Просмотр компаний","tags":["surgard"],"responses":{"201":{"description":"request","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SecurityCompanySurgard"}}}}}}}},"/stories":{"get":{"summary":"Получение списка доступных сторис","tags":["stories"],"description":"Получение списка доступных сторис","parameters":[{"in":"query","name":"template_id","required":true,"description":"Индивидуальный идентификатор шаблона скрипта","schema":{"type":"integer"}}],"responses":{"200":{"description":"Доступные сторис","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stories"}}}},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}},"put":{"summary":"Изменение статуса сторис на \"Просмотрено\"","tags":["stories"],"description":"зменение статуса сторис на \"Просмотрено\"","parameters":[{"in":"query","name":"story_id","required":true,"description":"Индивидуальный идентификатор  подсказки-сторис","schema":{"type":"integer"}}],"responses":{"204":{"description":"Статус успешно изменен"},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}}},"/stories/template":{"get":{"summary":"Получение версии и id скрипта","tags":["stories"],"description":"Получение версии и id скрипта","parameters":[{"in":"query","name":"type","required":true,"description":"Тип template","schema":{"type":"integer"}},{"in":"query","name":"app_ver","required":true,"description":"Версия приложения","schema":{"type":"string"}},{"in":"query","name":"hub_ver","required":true,"description":"Версия хаба","schema":{"type":"string"}},{"in":"query","name":"en","required":true,"description":"язык локализации","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Информация о темплайте","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateScript"}}}},"400":{"$ref":"#/components/responses/401Error"},"403":{"$ref":"#/components/responses/403Error"},"404":{"$ref":"#/components/responses/404Error"},"422":{"$ref":"#/components/responses/ErrorValidationFailed"},"500":{"$ref":"#/components/responses/500Error"}}}},"/sites/{siteID}/custom/scripts":{"post":{"summary":"Upload custom scripts for a specific site","tags":["custom_scripts"],"description":"Upload custom scripts associated with a specific site by its `siteID`.","parameters":[{"name":"siteID","in":"path","required":true,"description":"Unique identifier of the site","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomTemplateV1"}}}},"responses":{"200":{"description":"Script uploaded successfully. No content is returned.","content":{}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified siteID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Site not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}}},"/sites/{siteID}/custom/scripts/{id}":{"get":{"summary":"Get custom script by ID for a specific site","tags":["custom_scripts"],"description":"Retrieve a custom script by its ID associated with a specific site.","parameters":[{"name":"siteID","in":"path","required":true,"description":"Unique identifier of the site","schema":{"type":"integer"}},{"name":"id","in":"path","required":true,"description":"Unique identifier of the script","schema":{"type":"integer"}}],"responses":{"200":{"description":"Custom script retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomTemplateV1"}}}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified script ID or siteID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Script not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}},"put":{"summary":"Update custom script by ID for a specific site","tags":["custom_scripts"],"description":"Update an existing custom script by its ID associated with a specific site.","parameters":[{"name":"siteID","in":"path","required":true,"description":"Unique identifier of the site","schema":{"type":"integer"}},{"name":"id","in":"path","required":true,"description":"Unique identifier of the script","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomTemplateV1"}}}},"responses":{"200":{"description":"Script updated successfully. No content is returned.","content":{}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified script ID or siteID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Script not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}}},"/custom/scripts/templates/{id}":{"get":{"summary":"Get a custom script template","tags":["custom_scripts"],"description":"Retrieve a custom script template by its ID with additional query parameters.","parameters":[{"name":"id","in":"path","required":true,"description":"Unique identifier of the script template","schema":{"type":"integer"}},{"name":"type","in":"query","required":false,"description":"Type of the template","schema":{"type":"integer"}},{"name":"app_ver","in":"query","required":false,"description":"Version of the app","schema":{"type":"string"}},{"name":"hub_ver","in":"query","required":false,"description":"Version of the hub","schema":{"type":"string"}},{"name":"en","in":"query","required":false,"description":"Additional parameter `en`","schema":{"type":"string"}}],"responses":{"200":{"description":"Custom script template retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomTemplateV1"}}}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified script template ID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Script template not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}}},"/sites/{siteID}/humidifier/scripts":{"post":{"summary":"Upload humidifier scripts for a specific site","tags":["humidifier_scripts"],"description":"Upload humidifier scripts associated with a specific site by its `siteID`.","parameters":[{"name":"siteID","in":"path","required":true,"description":"Unique identifier of the site","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumidifierTemplateV1"}}}},"responses":{"200":{"description":"Script uploaded successfully. No content is returned.","content":{}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified siteID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Site not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}}},"/sites/{siteID}/humidifier/scripts/{id}":{"get":{"summary":"Get humidifier script by ID for a specific site","tags":["humidifier_scripts"],"description":"Retrieve a humidifier script by its ID associated with a specific site.","parameters":[{"name":"siteID","in":"path","required":true,"description":"Unique identifier of the site","schema":{"type":"integer"}},{"name":"id","in":"path","required":true,"description":"Unique identifier of the script","schema":{"type":"integer"}}],"responses":{"200":{"description":"humidifier script retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumidifierTemplateV1"}}}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified script ID or siteID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Script not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}},"put":{"summary":"Update humidifier script by ID for a specific site","tags":["humidifier_scripts"],"description":"Update an existing humidifier script by its ID associated with a specific site.","parameters":[{"name":"siteID","in":"path","required":true,"description":"Unique identifier of the site","schema":{"type":"integer"}},{"name":"id","in":"path","required":true,"description":"Unique identifier of the script","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumidifierTemplateV1"}}}},"responses":{"200":{"description":"Script updated successfully. No content is returned.","content":{}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified script ID or siteID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Script not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}}},"/humidifier/scripts/templates/{id}":{"get":{"summary":"Get a humidifier script template","tags":["humidifier_scripts"],"description":"Retrieve a humidifier script template by its ID with additional query parameters.","parameters":[{"name":"id","in":"path","required":true,"description":"Unique identifier of the script template","schema":{"type":"integer"}},{"name":"type","in":"query","required":false,"description":"Type of the template","schema":{"type":"integer"}},{"name":"app_ver","in":"query","required":false,"description":"Version of the app","schema":{"type":"string"}},{"name":"hub_ver","in":"query","required":false,"description":"Version of the hub","schema":{"type":"string"}},{"name":"en","in":"query","required":false,"description":"Additional parameter `en`","schema":{"type":"string"}}],"responses":{"200":{"description":"Humidifier script template retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumidifierTemplateV1"}}}},"400":{"description":"Bad request. The input data is invalid or missing required fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid input data."}}}}}},"401":{"description":"Unauthorized. Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorized."}}}}}},"403":{"description":"Forbidden. The user does not have permission to perform this action.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied."}}}}}},"404":{"description":"Not found. The specified script template ID does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Script template not found."}}}}}},"500":{"description":"Internal server error. An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"An unexpected error occurred."}}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"APIError":{"description":"This response is sent back to the client in case of an error in the API call.\n","type":"object","required":["code","message"],"properties":{"code":{"description":"The field will contain one of the constants defined by the server.","type":"string"},"message":{"description":"The field will contain a message from the server about error.","type":"string"},"errors":{"description":"Array of validation errors.\n\nUsed with `invalid_data` code.\n","type":"array","items":{"type":"object","required":["code","field","message"],"properties":{"code":{"description":"The field will contain one of the validation code constants defined by the server.","type":"string"},"field":{"description":"The field will contain the name of the field from the original request.","type":"string"},"message":{"description":"The field will contain a message from the server about validation error.","type":"string"}}}}}},"ValidationError":{"type":"object","required":["code","message","errors"],"properties":{"code":{"type":"string","description":"Код ошибки, указывающий тип проблемы (например, invalid_data)","example":"invalid_data"},"message":{"type":"string","description":"Общее сообщение об ошибке","example":"validation failed"},"errors":{"type":"array","description":"Список конкретных ошибок валидации","items":{"type":"object","required":["code","field","message"],"properties":{"code":{"type":"string","description":"Код конкретной ошибки валидации (например, min, required)","example":"min"},"field":{"type":"string","description":"Поле, к которому относится ошибка","example":"user_verification_id"},"message":{"type":"string","description":"Описание ошибки для конкретного поля","example":"must be at least 36 characters in length"}}}}}},"SecurityScheduleResponse":{"description":"Конфигурация расписания для контроллера.\nОпределяет временные окна для каждого дня недели, когда контроллер может быть снять с охраны.\nЗначения времени указываются в минутах от начала суток (0-1439).\nПоля упорядочены по дням недели, для каждого дня сначала идет время начала, затем время окончания.\n","type":"object","properties":{"start_monday":{"description":"Время начала для понедельника в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_monday":{"description":"Время окончания для понедельника в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_tuesday":{"description":"Время начала для вторника в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_tuesday":{"description":"Время окончания для вторника в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_wednesday":{"description":"Время начала для среды в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_wednesday":{"description":"Время окончания для среды в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_thursday":{"description":"Время начала для четверга в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_thursday":{"description":"Время окончания для четверга в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_friday":{"description":"Время начала для пятницы в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_friday":{"description":"Время окончания для пятницы в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_saturday":{"description":"Время начала для субботы в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_saturday":{"description":"Время окончания для субботы в минутах от начала суток (0-1439)","type":"string","example":"1020"},"start_sunday":{"description":"Время начала для воскресенья в минутах от начала суток (0-1439)","type":"string","example":"480"},"end_sunday":{"description":"Время окончания для воскресенья в минутах от начала суток (0-1439)","type":"string","example":"1020"}}},"Request":{"description":"заявки для подключения мониторинга","properties":{"id":{"description":"id","type":"integer"},"site_id":{"description":"site id","type":"integer"},"company_id":{"description":"company id","type":"integer"},"time_create":{"description":"время создания заявки","type":"string","format":"date-time"},"type":{"type":"string","enum":["DELETE","MONITORING"]}}},"RequestCreate":{"description":"заявки для подключения мониторинга","properties":{"company_id":{"description":"company id","type":"integer"},"type":{"type":"string","enum":["DELETE","MONITORING"]}}},"SecurityCompanySurgard":{"description":"securityCompany","type":"object","properties":{"id":{"description":"id","type":"integer"},"name":{"description":"name","type":"string"},"city":{"description":"city","type":"array","items":{"type":"string"}},"number":{"description":"number of security","type":"string"},"email":{"description":"email","type":"string"},"host":{"description":"host","type":"string"},"port":{"description":"port","type":"string"},"site":{"description":"company website","type":"string"},"img":{"description":"img of company","type":"string"},"uuid":{"description":"уникальный номер компании","type":"string"}}},"SecurityCompanySurgardPost":{"description":"securityCompany","type":"object","properties":{"name":{"description":"name","type":"string"},"city":{"description":"city","type":"array","items":{"type":"string"}},"number":{"description":"number of security","type":"string"},"email":{"description":"email","type":"string"},"host":{"description":"host","type":"string"},"port":{"description":"port","type":"string"},"site":{"description":"company website","type":"string"},"img":{"description":"img of company","type":"string"}}},"Status":{"description":"Status information.","type":"object","required":["status"],"properties":{"status":{"description":"Status information value","type":"string"}}},"TokenPasswordGrant":{"type":"object","required":["grant_type","username","password"],"properties":{"grant_type":{"type":"string","enum":["password"]},"username":{"type":"string"},"password":{"type":"string"}}},"ConfirmAuthRequest":{"type":"object","required":["user_verification_id","verification_type"],"properties":{"user_verification_id":{"type":"string","description":"ID верификации пользователя"},"verification_type":{"type":"string","enum":["SMS","EMAIL","CALL_TO_PHONE"]},"code":{"type":"string","description":"Код подтверждения"}}},"StartAuthRequest":{"oneOf":[{"$ref":"#/components/schemas/StartAuthRequestAuthorizationCode"},{"$ref":"#/components/schemas/StartAuthRequestRefreshToken"}],"discriminator":{"propertyName":"grant_type","mapping":{"authorization_code":"#/components/schemas/StartAuthRequestAuthorizationCode","refresh_token":"#/components/schemas/StartAuthRequestRefreshToken"}}},"StartAuthResponse":{"oneOf":[{"$ref":"#/components/schemas/StartAuthResponseAuthorizationCode"},{"$ref":"#/components/schemas/StartAuthResponseRefreshToken"}],"discriminator":{"propertyName":"grant_type","mapping":{"authorization_code":"#/components/schemas/StartAuthResponseAuthorizationCode","refresh_token":"#/components/schemas/StartAuthResponseRefreshToken"}},"examples":{"authorization_code":{"summary":"Пример ответа при grant_type=authorization_code","value":{"grant_type":"authorization_code","verification_id":"abc123","status":"success"}},"refresh_token":{"summary":"Пример ответа при grant_type=refresh_token","value":{"grant_type":"refresh_token","token_type":"Bearer","access_token":"eyJhbGciOiJIUzI1NiIs...","refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6...","expires_in":3600,"created_at":1696420000}}}},"StartAuthRequestAuthorizationCode":{"type":"object","required":["grant_type","username","verification_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["authorization_code"]},"username":{"type":"string","description":"Имя пользователя (email или номер телефона)"},"verification_type":{"type":"string","enum":["SMS","EMAIL","CALL_TO_PHONE"]},"client_id":{"type":"string"},"client_secret":{"type":"string"}},"example":{"verification_id":"test"}},"StartAuthRequestRefreshToken":{"type":"object","required":["grant_type","refresh_token","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["refresh_token"]},"refresh_token":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"}}},"StartAuthResponseAuthorizationCode":{"type":"object","required":["verification_id","status"],"properties":{"verification_id":{"type":"string"},"status":{"type":"string"}}},"StartAuthResponseRefreshToken":{"$ref":"#/components/schemas/TokenResponse"},"PSCUser":{"type":"object","required":["id","login","email","name","phone","company_id","created_at","updated_at","role"],"properties":{"id":{"description":"Идентификатор пользователя ЧОП","type":"integer","format":"int32","minimum":1},"login":{"description":"Логин пользователя ЧОП","type":"string"},"email":{"description":"Email пользователя ЧОП","type":"string"},"name":{"description":"Имя пользователя ЧОП","type":"string"},"phone":{"description":"Телефон пользователя ЧОП","type":"string"},"company_id":{"description":"Идентификатор охранной компании","type":"integer","format":"int32","minimum":1},"created_at":{"description":"Дата создания пользователя ЧОП","type":"string","format":"date-time"},"updated_at":{"description":"Дата последнего обновления пользователя ЧОП","type":"string","format":"date-time"},"role":{"description":"Название назначенной роли пользователя ЧОП","type":"string"}}},"NewPSCUser":{"type":"object","required":["login","name","phone","password","re_password","company_id","role"],"properties":{"login":{"description":"Логин пользователя ЧОП","type":"string","maxLength":50},"email":{"description":"Email пользователя ЧОП","type":"string","format":"email"},"name":{"description":"Имя пользователя ЧОП","type":"string","maxLength":50},"phone":{"description":"Телефон пользователя ЧОП в формате E.164","type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"password":{"description":"Пароль пользователя ЧОП","type":"string","minLength":8,"maxLength":100},"re_password":{"description":"Повтор пароля пользователя ЧОП","type":"string","minLength":8,"maxLength":100},"company_id":{"description":"Идентификатор охранной компании","type":"integer","format":"int32","minimum":1},"role":{"description":"Роль пользователя ЧОП","type":"string"}}},"TokenResponse":{"type":"object","required":["token_type","access_token","refresh_token","expires_in","created_at"],"properties":{"token_type":{"type":"string","description":"Тип токена (\"Bearer\")"},"access_token":{"type":"string"},"refresh_token":{"type":"string"},"expires_in":{"type":"integer","format":"int64"},"created_at":{"type":"integer","format":"int64"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"TokenRefreshTokenGrant":{"type":"object","required":["grant_type","refresh_token"],"properties":{"grant_type":{"type":"string","enum":["refresh_token"]},"refresh_token":{"type":"string"}}},"AuthConfirmNotConfirmedResponse":{"type":"object","properties":{"status":{"description":"Статус","type":"string"},"message":{"description":"Сообщение","type":"string"}},"example":{"status":"phone_not_confirmed","message":"phone number not yet confirmed"}},"Token":{"type":"object","required":["token_type","access_token","refresh_token","expires_in","created_at"],"properties":{"token_type":{"description":"The type of the token issued.","type":"string","enum":["bearer"]},"access_token":{"description":"The access token issued by the authorization server","type":"string"},"refresh_token":{"description":"The refresh token, which can be used to obtain new access tokens\nusing the same authorization grant.\n","type":"string"},"expires_in":{"description":"The lifetime in seconds of the access token.","type":"integer"},"created_at":{"description":"The unix timestamp of token creation.","type":"integer"}},"example":{"token_type":"Bearer","access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","expires_in":3600,"created_at":1608495620}},"TokenError":{"description":"### Available errors:\n* __invalid_request__ <br/>\n  The request is missing a required parameter, includes an unsupported\n  parameter value (other than grant type), repeats a parameter, includes\n  multiple credentials, utilizes more than one mechanism for authenticating\n  the client, or is otherwise malformed.\n* __invalid_client__ <br/>\n  Client authentication failed (e.g., unknown client, no client\n  authentication included, or unsupported authentication method).\n  The authorization server MAY return an HTTP 401 (Unauthorized)\n  status code to indicate which HTTP authentication schemes\n  are supported. If the client attempted to authenticate via\n  the \"Authorization\" request header field, the authorization\n  server MUST respond with an HTTP 401 (Unauthorized) status code\n  and include the \"WWW-Authenticate\" response header field matching\n  the authentication scheme used by the client.\n* __invalid_grant__ <br/>\n  The provided authorization grant (e.g., authorization code, resource owner\n  credentials) or refresh token is invalid, expired, revoked, does not match\n  the redirection URI used in the authorization request, or was issued to\n  another client.\n* __unauthorized_client__ <br/>\n  The authenticated client is not authorized to use this authorization\n  grant type.\n* __unsupported_grant_type__ <br/>\n  The authorization grant type is not supported by the authorization server.\n","type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","invalid_grant","unauthorized_client","unsupported_grant_type"]}}},"Version":{"type":"object","required":["appName","version","revision","branch","commit","buildDate","goVersion"],"properties":{"appName":{"type":"string"},"version":{"type":"string"},"revision":{"type":"string"},"branch":{"type":"string"},"buildDate":{"type":"string"},"goVersion":{"type":"string"}}},"User":{"type":"object","required":["id","name","email","phone","activated","avatar_url"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"activated":{"type":"boolean"},"avatar_url":{"type":"string"}}},"Controller":{"description":"The controller is a device that connects to the Rielta server via the Internet","type":"object","required":["id","name","icer","serial_number","fw_version","devices"],"properties":{"id":{"description":"The controller identifier","type":"integer"},"name":{"description":"The controller name","type":"string","minLength":0,"maxLength":100},"icer":{"description":"The controller type in hex format (length 16)","type":"string","pattern":"^[A-F0-9]{16}$","minLength":16,"maxLength":16},"serial_number":{"description":"The serial number of controller","type":"string","pattern":"^[1-9][0-9]*$"},"connection_lost":{"description":"Indicator of loss of connection between controller and server","type":"boolean"},"connection_lost_at":{"description":"Time of loss of connection between controller and server","type":"string","format":"date-time"},"fw_version":{"description":"Controller firmware version","type":"string"},"radio_module":{"description":"Information about the radio module","type":"string"},"user_id":{"description":"The controller owner identifier","type":"integer","nullable":true},"site_id":{"description":"The site identifier associated with the controller","type":"integer","nullable":true},"factory_name":{"description":"Factory name of the controller","type":"string"},"summary":{"description":"Brief information about the device","type":"string"},"image_url":{"description":"The controller image URL","type":"string","format":"uri"},"product_url":{"description":"Link to product on website","type":"string","format":"uri"},"description":{"description":"Brief description about the controller","type":"string"},"has_malfunction":{"description":"Controller malfunction indicator","type":"boolean"},"sim_number":{"description":"phone number for installed SIM card","type":"string"},"in_transit":{"description":"This field indicates that there is some process going on","type":"string","enum":["GUARD_ON","GUARD_OFF","DEVICE_ADDING","DEVICE_REMOVING","CONTROLLER_SETTINGS_CHANGE"]},"indications":{"description":"Array of controller indications","type":"array","items":{"$ref":"#/components/schemas/Indication"}},"devices":{"description":"Devices connected to the controller","type":"array","items":{"$ref":"#/components/schemas/Device"}}}},"ParametersController":{"description":"Parameters controller","type":"object","required":["port_1","port_2","serv_1","serv_2","st_srv_1","en_srv_1","en_srv_2"],"properties":{"port_1":{"description":"Порт сервера, на котором развернут Ri-Coder (куда контроллер будет слать события по основному каналу)","type":"string"},"port_2":{"description":"Порт сервера, на котором развернут Ri-Coder (куда контроллер будет слать события по резервному каналу)","type":"string"},"serv_1":{"description":"Хост сервера, на котором развернут Ri-Coder (куда контроллер будет слать события по основному каналу)","type":"string"},"serv_2":{"description":"Хост сервера, на котором развернут Ri-Coder (куда контроллер будет слать события по резервному каналу)","type":"string"},"st_srv_1":{"description":"Статус подключения к серверу, на котором развернут Ri-Coder","type":"string"},"en_srv_1":{"description":"Включена ли передача событий с контроллера по основному (wi-fi) каналу","type":"string"},"en_srv_2":{"description":"Включена ли передача событий с контроллера по резервному (gsm) каналу","type":"string"}}},"Device":{"description":"A device is a device that connects to the controller over a wireless or wired network.","type":"object","required":["id","name","device_type","serial_number","fw_version","controller_id","units"],"properties":{"id":{"description":"The device identifier","type":"integer"},"name":{"description":"The device name","type":"string","minLength":0,"maxLength":100},"device_type":{"description":"The device type is a type in hex format (length 8)","type":"string","pattern":"^[A-F0-9]{8}$","minLength":8,"maxLength":8},"serial_number":{"description":"The serial number of device","type":"string","pattern":"^[1-9][0-9]*$"},"ecp_address":{"description":"ECP address","type":"integer"},"ecp_subaddress":{"description":"ECP subaddress","type":"integer"},"connection_lost":{"description":"Indicator of loss of connection between device and controller","type":"boolean"},"connection_lost_at":{"description":"Time of loss of connection between device and controller","type":"string","format":"date-time"},"fw_version":{"description":"Controller firmware version","type":"string"},"controller_id":{"description":"The controller identifier to which the device is bound","type":"integer"},"room_id":{"description":"The room identifier associated with the device","type":"integer","nullable":true},"factory_name":{"description":"Factory name of the device","type":"string"},"summary":{"description":"Brief information about the device","type":"string"},"image_url":{"description":"The device image URL","type":"string","format":"uri"},"product_url":{"description":"Link to product on website","type":"string","format":"uri"},"description":{"description":"Brief description about the device","type":"string"},"has_malfunction":{"description":"Device malfunction indicator","type":"boolean"},"in_transit":{"description":"This field indicates that there is some process going on","type":"string","enum":["GUARD_ON","GUARD_OFF","DEVICE_REMOVING","NO_DATA"]},"indications":{"description":"Array of device indications","type":"array","items":{"$ref":"#/components/schemas/Indication"}},"units":{"description":"Sensors and actuators of the device","type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"ControllerFirmware":{"type":"object","required":["firmware_version","release_date"],"properties":{"firmware_version":{"type":"string","description":"Firmware version","example":"1.1.119"},"release_date":{"type":"string","description":"Release date (ISO 8601)","example":"2022-11-02T00:00:00Z"},"description":{"type":"string","description":"Release description","example":"Improved everything, fixed all the bugs"}}},"CatalogDevice":{"description":"Detailed information about the device from the company's catalog.","type":"object","required":["device_type","factory_name","summary","image_url","description","instruction_pairing","instruction_installation"],"properties":{"device_type":{"description":"The device type is a type in hex format (length 8)","type":"string","pattern":"^[A-F0-9]{8}$","minLength":8,"maxLength":8},"factory_name":{"description":"Factory name of the device","type":"string"},"summary":{"description":"Brief information about the device","type":"string"},"image_url":{"description":"The device image URL","type":"string","format":"uri"},"product_url":{"description":"Link to product on website","type":"string","format":"uri"},"description":{"description":"Brief description about the device","type":"string"},"instruction_pairing":{"description":"Device pairing instructions","type":"string"},"instruction_installation":{"description":"Device installation instructions","type":"string"}}},"Unit":{"description":"Sensor or actuator information","type":"object","required":["id","name","controller_id"],"properties":{"id":{"description":"The unit identifier","type":"integer"},"name":{"description":"The unit name","type":"string","minLength":0,"maxLength":100},"controller_id":{"description":"The controller identifier","type":"integer"},"device_id":{"description":"The device identifier","type":"integer"},"gcp_zone":{"description":"GCP zone","type":"integer"},"gcp_part":{"description":"GCP part","type":"integer"},"ecp_address":{"description":"ECP address","type":"integer"},"ecp_subaddress":{"description":"ECP subaddress","type":"integer"},"ecp_channel":{"description":"ECP channel","type":"integer"},"alert":{"$ref":"#/components/schemas/AlertType"},"has_widget":{"description":"Indicator that the unit has a widget","type":"boolean"},"has_malfunction":{"description":"Unit malfunction indicator","type":"boolean"},"in_transit":{"description":"This field indicates that there is some process going on","type":"string","enum":["SWITCH_ON","SWITCH_OFF"]},"script_types":{"description":"The list of script types for which this unit is available.","type":"array","items":{"type":"string","description":"Possible values:\n\n - THERMOSTAT_CAUSE: Thermostat script (sensor for condition)\n - THERMOSTAT_EXEC: Thermostat script (executing device)\n - ON_OFF_CAUSE: On/off script (sensor for condition)\n - ON_OFF_EXEC: On/off script (executing device)\n - HUMIDIFIER_CAUSE: Humidifier script (sensor for condition)\n - HUMIDIFIER_EXEC: Humidifier script (executing device)\n - PUMP_CAUSE: Pump script (sensor for condition)\n - PUMP_EXEC: Pump script (executing device)"}},"indications":{"description":"Array of unit indications","type":"array","items":{"$ref":"#/components/schemas/Indication"}}}},"Site":{"type":"object","required":["id","name","user_id","controller_id","online","guard_state","alerts","rooms"],"properties":{"id":{"description":"The site identifier","type":"integer"},"name":{"description":"The site name","type":"string","minLength":0,"maxLength":100},"user_id":{"description":"The user identifier (owner)","type":"integer"},"controller_id":{"description":"The controller identifier","type":"integer"},"online":{"description":"Online status of controller connection","type":"boolean"},"offline_at":{"description":"Time of loss of connection between controller and server","type":"string","format":"date-time"},"image_url":{"description":"The site image URL","type":"string","format":"uri"},"guard_state":{"$ref":"#/components/schemas/GuardType"},"alerts":{"description":"Array of site alerts.</br>\nIf empty, there are no alerts on the site.\n","type":"array","items":{"$ref":"#/components/schemas/AlertType"}},"alert_state":{"type":"string","enum":["","ALERT","MALFUNCTION"]},"has_active_siren":{"description":"Indicator of active sirens on the site","type":"boolean"},"is_commercial":{"description":"Indicator of commercial purpose of the site","type":"boolean"},"in_transit":{"description":"This field indicates that there is some process going on","type":"string","enum":["GUARD_ON","GUARD_OFF","DEVICE_ADDING","DEVICE_REMOVING","CONTROLLER_SETTINGS_CHANGE"]},"location":{"$ref":"#/components/schemas/Location"},"rooms":{"description":"Site rooms","type":"array","items":{"$ref":"#/components/schemas/Room"}},"status_guard":{"$ref":"#/components/schemas/StatusGuard"}}},"ShortSitesInfoResponse":{"type":"object","description":"Ответ при запросе краткой информации о домах пользователя","required":["sites","sites_count"],"properties":{"sites":{"description":"Список домов в кратком формате","type":"array","items":{"$ref":"#/components/schemas/ShortSite"}},"sites_count":{"description":"Количество домов в списке","type":"integer"}}},"ShortSite":{"type":"object","description":"Краткая информация по дому с группировкой данных","required":["id","name","controller","guard","events","devices"],"properties":{"id":{"description":"ID дома","type":"integer"},"name":{"description":"Название дома","type":"string"},"controller":{"$ref":"#/components/schemas/ShortSiteController"},"guard":{"$ref":"#/components/schemas/ShortSiteGuard"},"events":{"$ref":"#/components/schemas/ShortSiteEvents"},"devices":{"$ref":"#/components/schemas/ShortSiteDevices"}}},"ShortSiteController":{"type":"object","description":"Информация о контроллере для данного дома","required":["id","serial_number","online"],"properties":{"id":{"description":"ID контроллера","type":"integer"},"serial_number":{"description":"Серийный номер контроллера","type":"string"},"online":{"description":"Онлайн статус контроллера","type":"boolean"}}},"ShortSiteGuard":{"type":"object","description":"Состояние охраны дома","required":["state","alert_state"],"properties":{"state":{"description":"Текущее состояние охраны","type":"string","enum":["NONE","FULL","PARTIAL","NIGHT"]},"alert_state":{"description":"Агрегированное состояние тревог по непрочитанным событиям (site_alerts с processed=false)","type":"string","enum":["","ALERT","MALFUNCTION"]},"status_guard":{"description":"Оценка состояния охраны без детального списка проблем","allOf":[{"$ref":"#/components/schemas/ShortStatusGuard"}],"nullable":true}}},"ShortStatusGuard":{"type":"object","description":"Краткая оценка состояния охраны","required":["color","percent","recommendations"],"properties":{"color":{"$ref":"#/components/schemas/Color"},"percent":{"description":"Процент целостности системы","type":"integer"},"recommendations":{"description":"Рекомендации пользователю по улучшению состояния дома","type":"string"}}},"ShortSiteEvents":{"type":"object","description":"Группа данных по событиям дома","required":["unread_count"],"properties":{"unread_count":{"description":"Количество непрочитанных событий в доме","type":"integer"}}},"ShortSiteDevices":{"type":"object","description":"Группа данных по устройствам дома","required":["count"],"properties":{"count":{"description":"Количество устройств в доме","type":"integer"}}},"SiteDetailedResponse":{"type":"object","description":"Сгруппированная детальная информация по дому","required":["site","controller","security","location","relations","activity"],"properties":{"site":{"$ref":"#/components/schemas/SiteInfo"},"controller":{"$ref":"#/components/schemas/ControllerInfo"},"security":{"$ref":"#/components/schemas/SecurityInfo"},"location":{"$ref":"#/components/schemas/LocationInfo"},"relations":{"$ref":"#/components/schemas/SiteRelations"},"activity":{"$ref":"#/components/schemas/SiteActivityInfo"}}},"SiteStatusIssuesResponse":{"type":"object","description":"Краткий статус проблем безопасности по дому","required":["issues","recommendations"],"properties":{"issues":{"description":"Список проблем безопасности","type":"array","items":{"$ref":"#/components/schemas/Issue"}},"recommendations":{"description":"Рекомендации пользователю по улучшению состояния дома","type":"string"}}},"SiteRoomWidgetsResponse":{"type":"object","description":"Список виджетов для комнаты","required":["id","name","widgets"],"properties":{"id":{"description":"ID комнаты","type":"integer"},"name":{"description":"Название комнаты","type":"string"},"widgets":{"description":"Виджеты комнаты","type":"array","items":{"$ref":"#/components/schemas/Widget"}}}},"SiteInfo":{"type":"object","description":"Базовая информация о доме","required":["id","name","user_id","is_commercial"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"user_id":{"type":"integer"},"is_commercial":{"type":"boolean"}}},"ControllerInfo":{"type":"object","description":"Информация о контроллере дома","required":["id","name","online","devices_count"],"properties":{"id":{"type":"integer"},"name":{"description":"Название контроллера","type":"string"},"online":{"type":"boolean"},"devices_count":{"type":"integer"}}},"SecurityInfo":{"type":"object","description":"Информация по безопасности дома","required":["guard_state","alert_state","has_active_siren","alerts","status_guard"],"properties":{"guard_state":{"description":"Текущее состояние охраны","type":"string"},"alert_state":{"description":"Текущее агрегированное состояние тревог","type":"string"},"has_active_siren":{"description":"Признак активной сирены","type":"boolean"},"alerts":{"description":"Активные тревоги дома, сгруппированные по типу alert. Внутри каждой группы порядок по created_at по убыванию","type":"array","items":{"$ref":"#/components/schemas/SiteAlertGroup"}},"status_guard":{"$ref":"#/components/schemas/StatusGuard"}}},"SiteAlertGroup":{"type":"object","description":"Группа тревог по типу alert","required":["type","alert_group","items","items_count"],"properties":{"type":{"description":"Тип тревоги (значение поля alert)","type":"string"},"alert_group":{"$ref":"#/components/schemas/SiteAlertGroupInfo"},"items":{"description":"Список тревог указанного типа","type":"array","items":{"$ref":"#/components/schemas/SiteAlertItem"}},"items_count":{"description":"Количество тревог в группе","type":"integer"}}},"SiteAlertGroupInfo":{"type":"object","description":"Информация о группе тревог","required":["name","type","icon"],"properties":{"name":{"description":"Локализованное название группы тревоги","type":"string"},"type":{"$ref":"#/components/schemas/AlertGroupType"},"icon":{"$ref":"#/components/schemas/AlertGroupIcon"}}},"SiteAlertItem":{"type":"object","description":"Короткая информация о тревоге","required":["id","message","message_second","created_at"],"properties":{"id":{"type":"integer"},"message":{"type":"string"},"message_second":{"description":"Дополнительное сообщение тревоги","type":"string"},"created_at":{"description":"Время создания тревоги в формате RFC3339","type":"string"}}},"LocationInfo":{"type":"object","description":"Информация о местоположении дома","required":["address","latitude","longitude","timezone"],"properties":{"address":{"description":"Адрес дома одной строкой","type":"string"},"latitude":{"description":"Широта","type":"number","format":"double"},"longitude":{"description":"Долгота","type":"number","format":"double"},"timezone":{"description":"Таймзона","type":"string"}}},"SiteRelations":{"type":"object","description":"Связанные сущности дома","required":["rooms","site_user","users"],"properties":{"rooms":{"type":"array","items":{"$ref":"#/components/schemas/Room"}},"site_user":{"$ref":"#/components/schemas/SiteUser"},"users":{"type":"array","items":{"$ref":"#/components/schemas/UserShort"}}}},"RoomShort":{"type":"object","description":"Короткая информация о помещении","required":["id","name"],"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"UserShort":{"type":"object","description":"Короткая информация о пользователе дома","required":["id","name","role"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"role":{"type":"string"}}},"SiteActivityInfo":{"type":"object","description":"Информация об активности дома","required":["events"],"properties":{"events":{"$ref":"#/components/schemas/SiteEventsInfo"}}},"SiteEventsInfo":{"type":"object","description":"Информация о событиях дома","required":["last","unread_count"],"properties":{"last":{"type":"array","items":{"$ref":"#/components/schemas/SiteEvent"}},"unread_count":{"type":"integer"}}},"SiteDetailed":{"type":"object","description":"Detailed site information for a specific user. \nNOTE: fields last_events and unread_events can be missing if the user does not have proper permissions","required":["id","name","user_id","controller_id","online","guard_state","alerts","rooms"],"properties":{"id":{"description":"The site identifier","type":"integer"},"name":{"description":"The site name","type":"string","minLength":0,"maxLength":100},"user_id":{"description":"The user identifier (owner)","type":"integer"},"controller_id":{"description":"The controller identifier","type":"integer"},"online":{"description":"Online status of controller connection","type":"boolean"},"offline_at":{"description":"Time of loss of connection between controller and server","type":"string","format":"date-time"},"image_url":{"description":"The site image URL","type":"string","format":"uri"},"guard_state":{"$ref":"#/components/schemas/GuardType"},"alerts":{"description":"Array of site alerts.</br>\nIf empty, there are no alerts on the site.\n","type":"array","items":{"$ref":"#/components/schemas/AlertType"}},"alert_state":{"type":"string","enum":["","ALERT","MALFUNCTION"]},"has_active_siren":{"description":"Indicator of active sirens on the site","type":"boolean"},"is_commercial":{"description":"Indicator of commercial purpose of the site","type":"boolean"},"in_transit":{"description":"This field indicates that there is some process going on","type":"string","enum":["GUARD_ON","GUARD_OFF","DEVICE_ADDING","DEVICE_REMOVING","CONTROLLER_SETTINGS_CHANGE"]},"location":{"$ref":"#/components/schemas/Location"},"rooms":{"description":"Site rooms","type":"array","items":{"$ref":"#/components/schemas/Room"}},"site_user":{"$ref":"#/components/schemas/SiteUser"},"last_events":{"type":"array","items":{"$ref":"#/components/schemas/SiteEvent"}},"unread_events":{"type":"integer"},"status_guard":{"$ref":"#/components/schemas/StatusGuard"}}},"Color":{"description":"Color to paint the element with","type":"object","properties":{"R":{"type":"integer"},"G":{"type":"integer"},"B":{"type":"integer"},"A":{"type":"integer"}}},"StatusGuard":{"type":"object","properties":{"color":{"$ref":"#/components/schemas/Color"},"persent":{"description":"Percentage of facility security","type":"integer"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"recommendations":{"description":"field with recommendations for the user","type":"string"}}},"Room":{"type":"object","required":["id","name","site_id","guard_state","alerts","widgets"],"properties":{"id":{"description":"The room identifier","type":"integer"},"name":{"description":"The room name","type":"string","minLength":0,"maxLength":100},"site_id":{"description":"The site identifier","type":"integer"},"gcp_part":{"description":"GCP part","type":"integer"},"image_url":{"description":"The room image URL","type":"string","format":"uri"},"guard_state":{"$ref":"#/components/schemas/GuardType"},"alerts":{"description":"Array of room alerts.</br>\nIf empty, there are no alerts on the room.\n","type":"array","items":{"$ref":"#/components/schemas/AlertType"}},"has_active_siren":{"description":"Indicator of active sirens on the site","type":"boolean"},"widgets":{"type":"array","items":{"$ref":"#/components/schemas/Widget"}}}},"Widget":{"type":"object","required":["id","type","title","value"],"properties":{"id":{"description":"The widget identifier","type":"string"},"type":{"description":"The widget type","type":"string","enum":["MALFUNCTION","CONNECTION_LOST","NO_DATA","TEMPERATURE","ON_OFF"]},"title":{"description":"The widget title","type":"string"},"device_id":{"description":"The device identifier to which the widget is bound (optional)","type":"integer"},"unit_id":{"description":"The unit identifier to which the widget is bound (optional)","type":"integer"},"unit_has_graph":{"description":"Whether the unit has graph to display (see /units/{id}/data-graph)","type":"boolean"},"in_transit":{"description":"This field indicates that there is some process going on","type":"string","enum":["SWITCH_ON","SWITCH_OFF"]},"value":{"description":"Type-specific widget data","oneOf":[{"description":"Empty","type":"object"},{"description":"Sensor","type":"object","required":["value","units"],"properties":{"value":{"description":"Sensor value","type":"string"},"units":{"description":"Sensor value unit","type":"string"}}},{"description":"Actuator","type":"object","required":["state","actions"],"properties":{"state":{"description":"Current state of the actuator","type":"string"},"actions":{"description":"Available actions for the actuator","type":"array","items":{"type":"string"}}}}]}},"description":"## Available types and their values\n__type__: MALFUNCTION<br/>\n__value__: Empty<br/>\n\n__type__: CONNECTION_LOST<br/>\n__value__: Empty<br/>\n\n__type__: NO_DATA<br/>\n__value__: Empty<br/>\n\n__type__: TEMPERATURE<br/>\n__value__: Sensor<br/>\n\n__type__: ON_OFF<br/>\n__value__: Actuator<br/>\n"},"Location":{"type":"object","required":["user_id","country","city","street","house"],"properties":{"id":{"description":"The location identifier","type":"integer"},"user_id":{"description":"The user identifier (owner)","type":"integer"},"country":{"description":"Country name","type":"string"},"city":{"description":"City name","type":"string"},"street":{"description":"street name","type":"string"},"house":{"description":"House number","type":"string"},"building":{"description":"building number","type":"string"},"flat":{"description":"flat number","type":"string"}}},"Issue":{"type":"object","required":["code","message","source","controller_id"],"properties":{"code":{"description":"The code of issue","type":"string","enum":["connection_lost","case_open","power_main_failure","power_backup_failure","not_ready","file_loading"]},"message":{"description":"Text description of the issue","type":"string"},"source":{"description":"Issue source identifier","type":"string","enum":["CONTROLLER","DEVICE","UNIT"]},"controller_id":{"description":"Controller identifier","type":"integer"},"device_id":{"description":"Device identifier","type":"integer"},"unit_id":{"description":"Unit identifier","type":"integer"}},"description":"## Available issue codes:\n- __connection_lost__\n- __case_open__\n- __power_main_failure__\n- __power_backup_failure__\n- __not_ready__\n- __file_loading__\n"},"SiteEvent":{"type":"object","required":["id","site_id","code","class","message","icon","time"],"properties":{"id":{"description":"The event identifier","type":"integer","minimum":1},"site_id":{"description":"The site identifier where the event happened","type":"integer","minimum":1},"code":{"description":"The equipment event code","type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"class":{"description":"The class of event","type":"string","enum":["NONE","INFO","GUARD","MALFUNCTION","CONTROL","ALERT"]},"title":{"description":"The event title","type":"string"},"message":{"description":"The event body message","type":"string"},"message_second":{"description":"Second row of body message","type":"string"},"message_tooltip":{"description":"Дополнительная информация к сообщению в старом формате (строка). Может отсутствовать.","type":"string"},"message_tooltip_v2":{"description":"Дополнительная информация к сообщению в новом формате.\nКлюч - имя источника события, может содержать служебный суффикс с идентификатором (например, \"ID\" или \"Unit\").\nЗначение - массив сообщений.\nДля обычных событий используется ключ \"message\".\n","type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"icon":{"description":"The event icon","type":"string","enum":["RUN","FIRE","FLOODING","TEMPERATURE","GLASS","DOOR_OPEN","DOOR_CLOSE","NOTIFY","BATT_DISCARGE","BATT_OK","CASE_OK","CASE_OPEN","MAIN_OK","MAIN_DISCONNECT","CLOUD_DISCONNECT","CLOUD_CONNECT","WARNING","LOCK","UNLOCK","DEVICE_ON","DEVICE_OFF","LAMP_ON","LAMP_OFF","SOUND_ON","SOUND_OFF","NETWORK","HOME","DELAY","ENABLED","SETTINGS","HUMIDITY","ALARM"]},"time":{"description":"The server event time","type":"string","format":"date-time"},"local_time":{"description":"The local event time (optional)","type":"string","format":"date-time"},"room_id":{"description":"The room identifier where the event happened (optional)","type":"integer","minimum":1},"controller_id":{"description":"The controller identifier where the event happened (optional)","type":"integer","minimum":1},"device_id":{"description":"The device identifier where the event happened (optional)","type":"integer","minimum":1},"unit_id":{"description":"The unit identifier where the event happened (optional)","type":"integer","minimum":1},"metadata":{"description":"Сode-specific site event metadata.","type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"integer"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object"}]}},"source_type":{"description":"The source type where the event happened","type":"string","enum":["SITE","ROOM","CONTROLLER","DEVICE","UNIT"]},"controller_name":{"description":"Hub name where the event happened.","type":"string"},"site_name":{"description":"Site name where the event happened.","type":"string"},"room_name":{"description":"Room name where the event happened. May be empty.","type":"string"},"device_name":{"description":"Device name where the event happened. May be empty.","type":"string"},"unit_name":{"description":"Unit name where the event happened. May be empty.","type":"string"}},"example":{"id":123,"site_id":120,"code":"0.2.1","class":"ALERT","title":"Alarm","message":"Penetration into the living room of the house","message_second":"Device Ri-Door 1 in Main Room","message_tooltip":"Door opening fixed by device","message_tooltip_v2":{"message":["Door opening fixed by device"]},"icon":"RUN","time":"2021-04-06T13:13:35.774Z"}},"UserSiteEvent":{"allOf":[{"$ref":"#/components/schemas/SiteEvent"},{"type":"object","properties":{"unread":{"description":"Indicator of unread event by user","type":"boolean"}}}]},"SiteAlert":{"type":"object","required":["id","site_id","alert","event"],"properties":{"id":{"description":"The site alert identifier","type":"integer","minimum":1},"site_id":{"description":"The site identifier where the alert happened","type":"integer","minimum":1},"alert":{"$ref":"#/components/schemas/AlertType"},"alert_group":{"description":"The name of the group this alert belongs to","type":"string"},"alert_group_type":{"description":"Type of the alert group","type":"string","enum":["ALERT","MALFUNCTION"]},"alert_group_icon":{"description":"Icon of the alert group","type":"string","enum":["NONE","MOVE","DOOR","GLASS","FIRE","WATER","TEMPERATURE","MALFUNCTION"]},"processed":{"description":"Indicator that the alert has been processed (optional)","type":"boolean"},"processed_at":{"description":"time that the alert has been processed (optional)","type":"string","format":"date-time"},"room_id":{"description":"The room identifier where the alert happened (optional)","type":"integer","minimum":1},"event":{"$ref":"#/components/schemas/SiteEvent"}},"example":{"id":504,"site_id":120,"alert":"MOVE","alert_group":"Climate","alert_group_type":"ALERT","alert_group_icon":"TEMPERATURE","event":{"id":123,"site_id":120,"code":"0.2.1","class":"ALERT","title":"Alarm","message":"Penetration into the living room of the house","icon":"RUN","time":"2021-04-06T13:13:35.774Z"}}},"GuardType":{"type":"string","enum":["NONE","FULL","PARTIAL","NIGHT"]},"AlertType":{"type":"string","enum":["NONE","MOVE","DOOR","GLASS","FIRE","PANIC","WATER","TEMPERATURE","MALFUNCTION","LINK"]},"Indication":{"type":"object","required":["label","type","value"],"properties":{"label":{"description":"Description of indication","type":"string"},"type":{"description":"Indication type","type":"string"},"value":{"description":"Indication value","type":"string"},"units":{"description":"Indication value units","type":"string"},"show_on_dashboard":{"description":"Should the indication be displayed on the dashboard","type":"boolean"},"unit_has_graph":{"description":"(Only for unit indications) Whether the unit has graph to display (see /units/{id}/data-graph)","type":"boolean"}},"description":"## Available types and their values\n__types__: POWER_COMMON<br/>\n__values__: OK, DISCHARGED, REPLACE_NEED<br/>\n\n__types__: POWER_MAIN, POWER_BACKUP<br/>\n__values__: OK, MALFUNCTION, DISCONNECTED<br/>\n\n__types__: POWER_BATTERY, POWER_BATTERY_MAIN, POWER_BATTERY_BACKUP<br/>\n__values__: OK, MALFUNCTION, DISCHARGED<br/>\n\n__types__: SIGNAL_LEVEL, SIGNAL_LEVEL_GSM, SIGNAL_LEVEL_WIFI, SIGNAL_LEVEL_RADIO_CHANNEL<br/>\n__values__: '{level}; {quality}'<br/>\n__units__: dB<br/>\n_level_: Signal level value in dB<br/>\n_quality_: Signal level quality<br/>\n  * 0 - no signal\n  * 1 - bad signal\n  * 2 - weak signal\n  * 3 - average signal\n  * 4 - good signal\n  * 5 - great signal\n\n__type__: CASE<br/>\n__values__: OPEN, CLOSE<br/>\n\n__type__: ON_OFF<br/>\n__values__: ON, OFF<br/>\n\n__type__: TEMPERATURE<br/>\n__values__: -55..+125<br/>\n__units__: °C<br/>\n\n__types__: MOVE, FIRE, WATER<br/>\n__values__: TRUE, FALSE<br/>\n"},"Setting":{"type":"object","required":["key","label","field_type","value_type","value"],"properties":{"key":{"description":"The identifier of the field with the specified scope.<br/>\nThe key used to apply the field settings.\n","type":"string"},"label":{"description":"Description of settings field","type":"string"},"field_type":{"description":"Setting field type","type":"string","enum":["TEXT","CHECKBOX","COMBOBOX","DOUBLEDECKER","WHEEL"]},"hint":{"description":"Hint for settings field","type":"string"},"value_type":{"description":"Value type of settings field","type":"string","enum":["BOOLEAN","TEXT","NUMBER","DECIMAL"]},"value":{"description":"Current value of settings field","type":"string"},"value_min":{"description":"Minimum value for settings field. Applicable only for value type \"NUMBER\".","type":"string"},"value_max":{"description":"Maximum value for settings field. Applicable only for value type \"NUMBER\".","type":"string"},"values":{"description":"Available values of settings field (optional).<br/>\nValues are of the same value type as in `value_type`\n","type":"array","items":{"type":"object","required":["label","value"],"properties":{"label":{"description":"Description of available field value","type":"string"},"value":{"description":"Available field value","type":"string"}}}}}},"SiteUser":{"description":"Site user is a user who has access to the site with role and permissions settings.\n","type":"object","required":["id","site_id","username","role","permissions"],"properties":{"id":{"description":"The site user identifier","type":"integer","minimum":1},"site_id":{"description":"The site identifier","type":"integer","minimum":1},"user_id":{"description":"The user identifier","type":"integer","minimum":1},"username":{"description":"Username for the site","type":"string"},"contact":{"description":"User contact (it can be an email or a phone)","type":"string"},"role":{"description":"User role for the site","type":"string","enum":["OWNER","LOCAL_USER","USER"]},"permissions":{"$ref":"#/components/schemas/SiteUserPermissions"},"access_code_prefix":{"description":"Prefix for the user's access code to the site.\nUsed to authenticate the user for keyboard interactions.\n","type":"string"},"partitions":{"description":"All rooms of the site with user permissions.\n","type":"array","items":{"$ref":"#/components/schemas/Partition"}},"key_chain":{"description":"user key chain for the site.\n","type":"object","properties":{"id":{"description":"Id in db","type":"integer"},"device_id":{"description":"Device identifier","type":"integer"},"device_name":{"description":"Device name","type":"string"}}}}},"SiteUserPermissions":{"description":"Site user permission settings","type":"object","required":["alerts","configuration","controller","events","guard_actions","notifications_from_controller","scenarios","user_management","widget_actions","guard_from_app"],"properties":{"alerts":{"description":"Access to view and reset site alerts.\nAlso allows you to disable the active siren.\n","type":"boolean"},"configuration":{"description":"Access to change any site configuration.\nEntities names, settings and site structure.\n","type":"boolean"},"controller":{"description":"Access to view information about controllers and devices.\n","type":"boolean"},"events":{"description":"Access to view information about site events.\n","type":"boolean"},"guard_actions":{"description":"Access to manage the guard state of the site.\n","type":"boolean"},"notifications_from_controller":{"description":"Access to configure and receive notifications from the controller\nvia phone calls and sms messages.\n","type":"boolean"},"scenarios":{"description":"Access to manage scenarios on the controller.\n","type":"boolean"},"user_management":{"description":"Access to manage users on the site and configure their roles and permissions.\n","type":"boolean"},"widget_actions":{"description":"Access for any actions with site widgets.\n","type":"boolean"},"guard_from_app":{"description":"Access to setup guard from app\n","type":"boolean"}}},"Partition":{"description":"Partition is a room of the site with user permissions.\n","type":"object","properties":{"name":{"description":"Name","type":"string"},"part_id":{"description":"room(part) id","type":"integer"},"permission":{"description":"User permission","type":"boolean"}}},"SiteUserNotifications":{"description":"Site user notifications settings","type":"object","required":["guard","alert","event","malfunction","scenarios"],"properties":{"guard":{"description":"Notifications for guard events (guard on/off for room or whole site)","$ref":"#/components/schemas/SiteUserNotificationsChunk"},"alert":{"description":"Notifications for alerts","$ref":"#/components/schemas/SiteUserNotificationsChunk"},"event":{"description":"Notifications for events","$ref":"#/components/schemas/SiteUserNotificationsChunk"},"malfunction":{"description":"Notifications for alerts","$ref":"#/components/schemas/SiteUserNotificationsChunk"},"scenarios":{"description":"Notifications for alerts","$ref":"#/components/schemas/SiteUserNotificationsChunk"}}},"SiteUserNotificationsChunk":{"description":"Site user notifications element","type":"object","properties":{"push":{"description":"Notifications via push to mobile","type":"boolean"},"call":{"description":"Notifications via call","type":"boolean"},"sms":{"description":"Notifications via SMS","type":"boolean"}}},"WiFiNetwork":{"type":"object","required":["name","signal_level","auth_type"],"properties":{"name":{"description":"The name of network","type":"string"},"signal_level":{"description":"Network signal level in dB","type":"integer"},"auth_type":{"description":"Network authenticate type","type":"string","enum":["Open","WEP","WPA_PSK","WPA2_PSK","WPA_WPA2_PSK","WPA2_ENTERPRISE","WPA3_PSK","WPA2_WPA3_PSK","WAPI_PSK"]}}},"SiteScript":{"type":"object","properties":{"id":{"type":"integer","description":"Unique ID of the script","example":54},"name":{"type":"string","description":"Name of the script","example":"Lights"},"loaded":{"type":"boolean","description":"Whether the script is loaded into controller"},"state":{"$ref":"#/components/schemas/SiteScriptState"},"in_transit":{"$ref":"#/components/schemas/SiteScriptTransit"},"created_at":{"type":"string","description":"When did the script was first created","format":"date-time"},"updated_at":{"type":"string","description":"When did the script was last updated","format":"date-time"}}},"SiteScriptFull":{"type":"object","properties":{"id":{"type":"integer","description":"Unique ID of the script","example":54},"name":{"type":"string","description":"Name of the script","example":"Lights"},"loaded":{"type":"boolean","description":"Whether the script is loaded into controller"},"state":{"$ref":"#/components/schemas/SiteScriptState"},"in_transit":{"$ref":"#/components/schemas/SiteScriptTransit"},"created_at":{"type":"string","description":"When did the script was first created","format":"date-time"},"updated_at":{"type":"string","description":"When did the script was last updated","format":"date-time"},"server_script":{"type":"string","description":"JSON-encoded script. This script is the newest version which is currently on the server. It might be different from `controller_script`, for example, if it has recently been edited by a user and hasn't been uploaded to the controller yet.","example":"{ ... }"},"controller_script":{"type":"string","description":"JSON-encoded script. This script is the version which is currently stored on the controller. Might be empty if the script is not loaded to the controller yet.","example":"{ ... }"}}},"SiteScriptState":{"description":"State of the script on the controller","type":"string","enum":["UNKNOWN","ACTIVE","INACTIVE","ERROR"]},"SiteScriptTransit":{"description":"This field indicates that something is in process","type":"array","items":{"type":"string","enum":["SCRIPT_START","SCRIPT_STOP","SCRIPT_LOAD","SCRIPT_UNLOAD"]}},"News":{"description":"News structure","type":"object","properties":{"news_id":{"description":"News id","type":"integer"},"created_at":{"description":"Date and time when the news was created","type":"string","format":"date-time"},"news_text":{"$ref":"#/components/schemas/NewsText"},"read":{"description":"Shows that the news has been read","type":"boolean"},"home_screen":{"type":"boolean","description":"Whether the news should be displayed on the home screen"},"type_message":{"description":"News type","type":"string","enum":["NEWS","INFORMATION","TECHNICAL","NOTIFICATION"]},"user_id":{"description":"The ID of the user to whom the news is addressed","type":"integer"},"color":{"$ref":"#/components/schemas/Color"}}},"NewsCreate":{"description":"Structure to create a news story","type":"object","properties":{"ids":{"description":"The ID of the users to whom the news is assigned","type":"array","required":true,"items":{"type":"integer"}},"localizations":{"type":"array","required":true,"items":{"$ref":"#/components/schemas/NewsText"}},"push":{"type":"boolean","required":true,"description":"Whether or not notice is necessary"},"home_screen":{"type":"boolean","required":true,"description":"Whether the news should be displayed on the home screen"},"type_message":{"description":"News type","type":"string","enum":["NEWS","INFORMATION","TECHNICAL","NOTIFICATION"]}}},"NewsText":{"description":"Information about text","type":"object","properties":{"locale":{"description":"Information about the localization text","type":"string","required":true},"title":{"description":"News headline","type":"string","required":true},"message":{"description":"News text","type":"string","required":true}}},"UnitGraph":{"description":"Information about the graph","type":"object","properties":{"controller_id":{"description":"Controller ID","type":"integer","required":true},"zone_id":{"description":"zone ID","type":"integer","required":true},"date_start":{"description":"The date since which values selected (RFC 3339)","type":"string","format":"date-time","required":true},"date_end":{"description":"The date to which values selected (RFC 3339)","type":"string","format":"date-time","required":true},"unit_suffix":{"description":"Suffix which is added to the unit","type":"string","example":"°C","required":true},"fixed_min_y":{"description":"Fixed bottom bound of the graph","type":"integer","example":0},"fixed_max_y":{"description":"Fixed top bound of the graph","type":"integer","example":100},"plot":{"description":"data points array","type":"array","required":true,"items":{"type":"object","properties":{"date":{"description":"The date of data point","type":"string","format":"date-time"},"value":{"description":"Value of data point","type":"integer"}}}},"min_value":{"description":"Minimum value for the given period","type":"integer","example":16},"min_value_at":{"description":"Timestamp of minimum value","type":"string","format":"date-time"},"max_value":{"description":"Maximum value for the given period","type":"integer","example":23},"max_value_at":{"description":"Timestamp of maximum value","type":"string","format":"date-time"}}},"PhoneVerificationMethod":{"description":"Phone verification method (leave empty for auto choice)","type":"string","enum":["CALL","SMS"]},"TemplateScript":{"description":"Информация о темлейте","type":"object","properties":{"id":{"description":"ID темплейта","type":"integer"},"version":{"description":"Версия скрипта","type":"integer"},"count":{"description":"кол-во записей в stories для этого template_id","type":"integer"}}},"Stories":{"description":"Массив обьектов сторис","type":"array","items":{"$ref":"#/components/schemas/Storis"}},"Storis":{"description":"Структура сторис","type":"object","properties":{"id":{"description":"ID сторис","type":"integer"},"images":{"description":"Картинки в сторис","type":"array","items":{"$ref":"#/components/schemas/image"}},"cover":{"description":"Картинка обложки скрипта","type":"string","format":"byte"},"top_color":{"description":"Верхний цвет градиента для фона скрипта","type":"string"},"bottom_color":{"description":"Нижний цвет градиента для фона скрипт","type":"string"},"viewed":{"description":"Флаг просмотрена ли подсказка-сторис пользователем","type":"boolean"}}},"image":{"description":"Структура картинки","type":"object","properties":{"id":{"description":"Индивидуальный идентификатор картинки в сторис","type":"integer"},"pic":{"description":"Картинка в сторис","type":"string","format":"byte"}}},"CustomTemplateV1":{"type":"object","properties":{"schedule":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}},"if":{"$ref":"#/components/schemas/If"},"then":{"$ref":"#/components/schemas/Then"},"settings":{"$ref":"#/components/schemas/Settings"}}},"If":{"type":"object","properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/CustomDevice"}},"security":{"type":"array","items":{"$ref":"#/components/schemas/Security"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}},"Then":{"type":"object","properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/CustomDevice"}}}},"Schedule":{"type":"object","properties":{"start":{"type":"string"},"stop":{"type":"string"},"days":{"type":"integer","format":"int32"}}},"CustomDevice":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer","format":"int32"},"id_device":{"type":"integer","format":"int32"},"controller_part_name":{"type":"string"},"site_user_name":{"type":"string"},"zone":{"type":"array","items":{"$ref":"#/components/schemas/Zone"}},"type":{"type":"integer"}}},"Zone":{"type":"object","properties":{"id_zone":{"type":"integer","format":"int32"},"name":{"type":"string"},"turn":{"type":"boolean","nullable":true},"temp":{"$ref":"#/components/schemas/Temp","nullable":true},"humidity":{"$ref":"#/components/schemas/Humidity","nullable":true},"key":{"$ref":"#/components/schemas/Key","nullable":true},"digital":{"$ref":"#/components/schemas/Digital","nullable":true}}},"HumidifierTemplateV1":{"type":"object","properties":{"schedule":{"type":"array","items":{"$ref":"#/components/schemas/HumidifierSchedule"}},"if":{"$ref":"#/components/schemas/HumidifierIf"},"then":{"$ref":"#/components/schemas/HumidifierThen"},"settings":{"$ref":"#/components/schemas/Settings"}}},"HumidifierIf":{"type":"object","properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/HumidifierDevice"}},"security":{"type":"array","items":{"$ref":"#/components/schemas/Security"}}}},"HumidifierThen":{"type":"object","properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/HumidifierDevice"}}}},"HumidifierSchedule":{"type":"object","properties":{"start":{"type":"string"},"stop":{"type":"string"},"days":{"type":"integer","format":"int32"}}},"HumidifierDevice":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"integer","format":"int32"},"id_device":{"type":"integer","format":"int32"},"controller_part_name":{"type":"string"},"site_user_name":{"type":"string"},"zone":{"type":"array","items":{"$ref":"#/components/schemas/HumidifierZone"}},"type":{"type":"integer"}}},"HumidifierZone":{"type":"object","properties":{"id_zone":{"type":"integer","format":"int32"},"name":{"type":"string"},"turn":{"type":"boolean","nullable":true},"humidity":{"$ref":"#/components/schemas/Humidity","nullable":true}}},"Temp":{"type":"object","properties":{"oa":{"type":"integer","format":"int32"},"gis":{"type":"integer","format":"int32"},"v0":{"type":"integer","format":"int32"},"v1":{"type":"integer","format":"int32"}}},"Humidity":{"type":"object","properties":{"oa":{"type":"integer","format":"int32"},"gis":{"type":"integer","format":"int32"},"v0":{"type":"integer","format":"int32"},"v1":{"type":"integer","format":"int32"}}},"Key":{"type":"object","properties":{"oa":{"type":"integer","format":"int32"},"button":{"type":"integer","format":"int32"}}},"Digital":{"type":"object","properties":{"oa":{"type":"integer","format":"int32"},"state":{"type":"boolean"}}},"Security":{"type":"object","properties":{"oa":{"type":"integer","format":"int32"},"stat":{"type":"integer","format":"int32"}}},"Event":{"type":"object","properties":{"name":{"type":"string"},"id_device":{"type":"integer","format":"int32"},"controller_part_name":{"type":"string"},"oa":{"type":"integer","format":"int32"}}},"Settings":{"type":"object","properties":{"name":{"type":"string"},"push":{"type":"boolean"},"dir":{"type":"integer","format":"int32"},"state":{"$ref":"#/components/schemas/State"}}},"State":{"type":"object","properties":{"stop":{"type":"boolean"},"br_in":{"type":"boolean"},"br_out":{"type":"boolean"}}},"ControllerSecuritySettings":{"type":"object","properties":{"guard_check_enabled":{"type":"boolean","description":"Проверка целостности системы","example":true},"allow_with_error":{"type":"boolean","description":"Постановка с ошибками","example":false},"battery_low":{"type":"boolean","description":"Проверка заряда батареи контроллера","example":false},"external_power":{"type":"boolean","description":"Проверка внешнего питания","example":true},"case_open":{"type":"boolean","description":"Проверка вскрытия корпуса","example":true},"server_link":{"type":"boolean","description":"Проверка соединения с сервером","example":false},"device_fault":{"type":"boolean","description":"Наличие неисправностей датчиков","example":false},"device_lost":{"type":"boolean","description":"Потеря датчиков","example":false},"device_battery_low":{"type":"boolean","description":"Разряд батареи датчиков","example":false},"device_case_open":{"type":"boolean","description":"Открытие корпуса охранного датчика","example":false},"ricoder_connection":{"type":"boolean","description":"Соединение с RiCoder","example":false}},"required":["guard_check_enabled","allow_with_error","battery_low","external_power","case_open","server_link","device_fault","device_lost","device_battery_low","device_case_open"]}},"responses":{"204Response":{"description":"No Content"},"400Error":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"bad_request","message":"error information"}}}},"401Error":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"unauthorized","message":"Unauthorized"}}}},"403Error":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"forbidden","message":"Forbidden"}}}},"404Error":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"not_found","message":"Not Found"}}}},"409Error":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"conflict","message":"Conflict"}}}},"422Error":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"unprocessable_entity","message":"Unprocessable Entity"}}}},"500Error":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"internal_server_error","message":"Internal Server Error"}}}},"503Error":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"service_unavailable","message":"Service Unavailable"}}}},"504Error":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"example":{"code":"gateway_timeout","message":"Gateway Timeout"}}}},"TokenResponse":{"description":"Successful response with access token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"TokenErrorResponse400":{"description":"Unsuccessful response to token request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenError"},"examples":{"invalid_request":{"value":{"error":"invalid_request"}},"invalid_grant":{"value":{"error":"invalid_grant"}},"unauthorized_client":{"value":{"error":"unauthorized_client"}},"unsupported_grant_type":{"value":{"error":"unsupported_grant_type"}}}}}},"TokenErrorResponse401":{"description":"Client authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenError"},"examples":{"invalid_client":{"value":{"error":"invalid_client"}}}}}},"ErrorValidationFailed":{"description":"Validation Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Validation Failed":{"$ref":"#/components/examples/APIError_ValidationFailed"}}}}},"ErrorControllerOffline":{"description":"Controller Offline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Controller Offline":{"$ref":"#/components/examples/APIError_ControllerOffline"}}}}},"ErrorTransitInProgress":{"description":"Transit In Progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIError"},"examples":{"Transit In Progress":{"$ref":"#/components/examples/APIError_TransitInProgress"}}}}}},"examples":{"APIError_ValidationFailed":{"description":"This error indicates that the client made a valid request, but the data could not be processed.\n","value":{"code":"invalid_data","message":"validation failed","errors":[{"code":"string","field":"string","message":"string"}]}},"APIError_ControllerOffline":{"description":"This error indicates that the controller is not connected to the server.\n","value":{"code":"controller_offline","message":"controller is not connected to server"}},"APIError_RejectOnGuard":{"description":"This error indicates that the action was rejected because the linked site has\nan activated guard state.\n","value":{"code":"reject_on_guard","message":"action is rejected at guarded site"}},"APIError_SiteNotReadyForArming":{"description":"This error indicates that the site is not ready for arming.\n","value":{"code":"not_ready_for_arming","message":"site is not ready for arming"}},"APIError_TransitInProgress":{"description":"This error indicates that there is a transit going on right now which forbids this action\n","value":{"code":"transit_in_progress","message":"action is rejected because of transit state"}}}}}