{
  "version": "2026.11",
  "base_url": "https://info.eaplfm.com",
  "groups": [
    {
      "id": "playback",
      "title": {
        "ru": "Эфир и музыка",
        "en": "Airplay & music"
      },
      "description": {
        "ru": "Потоки, композиции и история эфира.",
        "en": "Streams, tracks and airplay history."
      },
      "icon": "radio"
    },
    {
      "id": "community",
      "title": {
        "ru": "Реакции и комментарии",
        "en": "Reactions & comments"
      },
      "description": {
        "ru": "Обратная связь слушателей.",
        "en": "Listener feedback."
      },
      "icon": "message"
    },
    {
      "id": "analytics",
      "title": {
        "ru": "Аналитика",
        "en": "Analytics"
      },
      "description": {
        "ru": "Эфиры услуг и отчёты аудитории.",
        "en": "Service airplays and audience reports."
      },
      "icon": "chart"
    },
    {
      "id": "auth",
      "title": {
        "ru": "Авторизация",
        "en": "Authentication"
      },
      "description": {
        "ru": "Вход, первый пароль и выход.",
        "en": "Sign-in, initial password setup and sign-out."
      },
      "icon": "key"
    },
    {
      "id": "profiles",
      "title": {
        "ru": "Профили и исполнители",
        "en": "Profiles & artists"
      },
      "description": {
        "ru": "Данные аккаунтов и исполнителей.",
        "en": "Account profiles and artist records."
      },
      "icon": "user"
    },
    {
      "id": "apps",
      "title": {
        "ru": "Приложения",
        "en": "Apps"
      },
      "description": {
        "ru": "Устройства, уведомления и технические работы.",
        "en": "Devices, notifications and maintenance."
      },
      "icon": "phone"
    }
  ],
  "endpoints": [
    {
      "id": "player-streams",
      "group": "playback",
      "method": "GET",
      "path": "/api.pleer.php",
      "title": {
        "ru": "Потоки для плеера",
        "en": "Player streams"
      },
      "summary": {
        "ru": "Активные потоки с адресами трансляций и названиями на двух языках.",
        "en": "Active streams with playback URLs and names in both languages."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {},
      "body": {},
      "params": [],
      "response_kind": "json",
      "response": {
        "status": "ok",
        "cache_generated_at": "2026-11-20 12:00:00",
        "cache_file_time": "2026-11-20 12:00:00",
        "streams": [
          {
            "id": 3,
            "sort_order": 1,
            "slug": "top",
            "name_ru": "Топ",
            "name_en": "TOP",
            "stream_url": "https://listen.eaplfm.com/top.mp3"
          }
        ]
      },
      "fields": [
        {
          "name": "streams",
          "type": "array",
          "description": {
            "ru": "Потоки в порядке sort_order.",
            "en": "Streams ordered by sort_order."
          }
        },
        {
          "name": "streams[].stream_url",
          "type": "string",
          "description": {
            "ru": "Адрес трансляции для плеера.",
            "en": "Broadcast URL for the player."
          }
        },
        {
          "name": "cache_generated_at",
          "type": "string | null",
          "description": {
            "ru": "Время создания сохранённого списка.",
            "en": "Time when the cached list was generated."
          }
        }
      ],
      "notes": [
        {
          "ru": "Оба названия name_ru и name_en возвращаются в одном ответе.",
          "en": "Both name_ru and name_en are included in the same response."
        }
      ],
      "errors": [
        {
          "status": 200,
          "code": "status=error",
          "description": {
            "ru": "Кэш потоков отсутствует или повреждён.",
            "en": "The stream cache is missing or invalid."
          }
        }
      ]
    },
    {
      "id": "now",
      "group": "playback",
      "method": "GET",
      "path": "/api.php?action=now",
      "title": {
        "ru": "Текущая композиция",
        "en": "Current track"
      },
      "summary": {
        "ru": "Последняя фактически вышедшая композиция выбранного потока и её реакции.",
        "en": "The latest track recorded on the selected stream and its reactions."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "stream": "top",
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "stream",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код потока: 2–64 символа a–z, 0–9, _ или -.",
            "en": "Stream code: 2–64 characters using a–z, 0–9, _ or -."
          },
          "default": "top"
        },
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "ru — русский; остальные языки используют EN.",
            "en": "ru selects Russian; other languages use EN."
          },
          "default": "ru"
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "item": {
            "id": 42,
            "name": "Artist - Track",
            "artist": "Artist",
            "title": "Track",
            "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "service_id": null,
            "played_at": "2026-11-20 12:00:00",
            "allow_listen": 1,
            "is_ai": 0,
            "file_path": null
          },
          "stats": {
            "likes": 40,
            "dislikes": 3,
            "stars": 8,
            "score": 45
          },
          "label": "new",
          "source": "airplay_history",
          "timezone": "Europe/Moscow"
        }
      },
      "fields": [
        {
          "name": "data.item",
          "type": "object | null",
          "description": {
            "ru": "Композиция; null, если в потоке ещё нет истории.",
            "en": "The track, or null if the stream has no airplay history."
          }
        },
        {
          "name": "data.item.name",
          "type": "string | null",
          "description": {
            "ru": "Название для показа в формате «исполнитель - композиция».",
            "en": "Display name in the format “artist - track”."
          }
        },
        {
          "name": "data.item.hash",
          "type": "string",
          "description": {
            "ru": "Ключ композиции для истории, реакций и комментариев.",
            "en": "Track key used for history, reactions and comments."
          }
        },
        {
          "name": "data.stats",
          "type": "object",
          "description": {
            "ru": "Реакции: likes, dislikes, stars и итог score.",
            "en": "Reactions: likes, dislikes, stars and the resulting score."
          }
        },
        {
          "name": "data.label",
          "type": "string | null",
          "description": {
            "ru": "new первые 72 часа, затем дата первого эфира DD.MM.YYYY.",
            "en": "new for the first 72 hours, then the first airplay date as DD.MM.YYYY."
          }
        },
        {
          "name": "data.item.allow_listen",
          "type": "integer",
          "description": {
            "ru": "1 — прослушивание разрешено; 0 — запрещено.",
            "en": "1 allows playback; 0 disables it."
          }
        },
        {
          "name": "data.item.is_ai",
          "type": "integer",
          "description": {
            "ru": "1 — композиция отмечена как созданная с ИИ; 0 — нет.",
            "en": "1 marks a track as AI-created; 0 does not."
          }
        },
        {
          "name": "data.item.file_path",
          "type": "string | null",
          "description": {
            "ru": "Временная HTTPS-ссылка на MP3 или null.",
            "en": "A temporary HTTPS link to the MP3, or null."
          }
        }
      ],
      "notes": [
        {
          "ru": "Если name пусто, оно собирается из исполнителя и названия с подстановкой недостающих полей другого языка.",
          "en": "When name is empty, artist and title are combined, with missing components taken from the other language."
        },
        {
          "ru": "priority_en=1 выбирает EN при любом lang; иначе ru использует RU, остальные языки — EN.",
          "en": "priority_en=1 selects EN for every lang; otherwise ru uses RU and other languages use EN."
        },
        {
          "ru": "72 часа для label отсчитываются от первого выхода композиции по всей станции.",
          "en": "The 72-hour label window starts at the track’s first airplay across the station."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        }
      ]
    },
    {
      "id": "history",
      "group": "playback",
      "method": "GET",
      "path": "/api.php?action=history",
      "title": {
        "ru": "История эфира",
        "en": "Airplay history"
      },
      "summary": {
        "ru": "Фактические выходы композиций с поиском, фильтрами времени и страницами.",
        "en": "Recorded track plays with search, time filters and pagination."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "stream": "top",
        "limit": 5,
        "page": 1,
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "stream",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код потока: 2–64 символа a–z, 0–9, _ или -.",
            "en": "Stream code: 2–64 characters using a–z, 0–9, _ or -."
          },
          "default": "top"
        },
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "ru — русский; остальные языки используют EN.",
            "en": "ru selects Russian; other languages use EN."
          },
          "default": "ru"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Количество записей: от 1 до 200.",
            "en": "Number of records, from 1 to 200."
          },
          "default": 200
        },
        {
          "name": "page",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Номер страницы от 1 до 1 000 000.",
            "en": "Page number from 1 to 1,000,000."
          },
          "default": 1
        },
        {
          "name": "q",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Исполнитель, название, hash или номер услуги; до 1024 байт и 12 слов.",
            "en": "Artist, title, hash or service ID; up to 1,024 bytes and 12 words."
          }
        },
        {
          "name": "date",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Дата YYYY-MM-DD по Москве.",
            "en": "Date in YYYY-MM-DD format, Moscow time."
          }
        },
        {
          "name": "from",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Начало интервала HH:MM по Москве.",
            "en": "Interval start in HH:MM format, Moscow time."
          }
        },
        {
          "name": "to",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Конец интервала HH:MM; последняя минута включается.",
            "en": "Interval end in HH:MM format; the final minute is included."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "items": [
            {
              "id": 42,
              "name": "Artist - Track",
              "played_at": "2026-11-20 12:00:00",
              "allow_listen": 1,
              "file_path": null,
              "likes": 40,
              "dislikes": 3,
              "stars": 8,
              "score": 45,
              "is_ai": 0
            }
          ],
          "page": 1,
          "limit": 5,
          "has_more": false,
          "next_page": null,
          "source": "airplay_history",
          "timezone": "Europe/Moscow"
        }
      },
      "fields": [
        {
          "name": "data.items",
          "type": "array",
          "description": {
            "ru": "Отдельные выходы в эфир; повторные выходы имеют разные id.",
            "en": "Individual airplays; repeat plays have different IDs."
          }
        },
        {
          "name": "data.items[].played_at",
          "type": "string",
          "description": {
            "ru": "Дата и время выхода YYYY-MM-DD HH:MM:SS, МСК.",
            "en": "Airplay time as YYYY-MM-DD HH:MM:SS, Moscow time."
          }
        },
        {
          "name": "data.items[].file_path",
          "type": "string | null",
          "description": {
            "ru": "Ссылка доступна только в первые 48 часов после этого выхода.",
            "en": "A link is available only within 48 hours of this airplay."
          }
        },
        {
          "name": "data.has_more",
          "type": "boolean",
          "description": {
            "ru": "Есть ли следующая страница.",
            "en": "Whether another page is available."
          }
        },
        {
          "name": "data.next_page",
          "type": "integer | null",
          "description": {
            "ru": "Номер следующей страницы или null.",
            "en": "The next page number, or null."
          }
        }
      ],
      "notes": [
        {
          "ru": "Через 48 часов file_path становится null даже при allow_listen=1.",
          "en": "After 48 hours, file_path is null even when allow_listen=1."
        },
        {
          "ru": "Без date фильтры from и to выбирают время суток во всех датах.",
          "en": "Without date, from and to filter the time of day across all dates."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        },
        {
          "status": 400,
          "code": "invalid_date",
          "description": {
            "ru": "Некорректная дата.",
            "en": "Invalid date."
          }
        },
        {
          "status": 400,
          "code": "invalid_time",
          "description": {
            "ru": "Некорректное время.",
            "en": "Invalid time."
          }
        },
        {
          "status": 400,
          "code": "query_too_long",
          "description": {
            "ru": "Поисковый запрос слишком длинный.",
            "en": "Search query is too long."
          }
        },
        {
          "status": 400,
          "code": "invalid_query",
          "description": {
            "ru": "Некорректный поисковый запрос.",
            "en": "Invalid search query."
          }
        },
        {
          "status": 400,
          "code": "too_many_search_words",
          "description": {
            "ru": "В поиске больше 12 слов.",
            "en": "The search contains more than 12 words."
          }
        }
      ]
    },
    {
      "id": "top",
      "group": "playback",
      "method": "GET",
      "path": "/api_top.php?action=list",
      "title": {
        "ru": "ТОП-300",
        "en": "Top 300"
      },
      "summary": {
        "ru": "Рейтинг композиций за период по всей станции или выбранному потоку.",
        "en": "Track rankings for a period across the station or a selected stream."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "type": "today",
        "stream": "top",
        "lang": "ru",
        "page": 1,
        "per_page": 10
      },
      "body": {},
      "params": [
        {
          "name": "type",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Период рейтинга.",
            "en": "Ranking period."
          },
          "default": "today",
          "enum": [
            "today",
            "week",
            "month",
            "all"
          ]
        },
        {
          "name": "stream",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код потока; all или отсутствие — вся станция.",
            "en": "Stream code; all or no value selects the entire station."
          }
        },
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "ru — русский; остальные языки используют EN.",
            "en": "ru selects Russian; other languages use EN."
          },
          "default": "ru"
        },
        {
          "name": "page",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Номер страницы, начиная с 1.",
            "en": "Page number, starting at 1."
          },
          "default": 1
        },
        {
          "name": "per_page",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Количество композиций: от 1 до 200.",
            "en": "Number of tracks, from 1 to 200."
          },
          "default": 30
        },
        {
          "name": "q",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Поиск среди композиций рейтинга.",
            "en": "Search within the ranked tracks."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "page": 1,
        "pages": 1,
        "per_page": 30,
        "total": 1,
        "items": [
          {
            "id": 42,
            "name": "Artist - Track",
            "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "rank": 1,
            "plays": 5,
            "likes": 40,
            "dislikes": 3,
            "stars": 8,
            "score": 45,
            "is_ai": 0,
            "file_path": null
          }
        ],
        "generated_at": "2026-11-20 12:00:00",
        "next_update": "2026-11-20 12:30:00",
        "error": null,
        "type": "today",
        "stream": null,
        "lang": "ru",
        "timezone": "Europe/Moscow",
        "cache_stale": false,
        "cache_status": "fresh"
      },
      "fields": [
        {
          "name": "items",
          "type": "array",
          "description": {
            "ru": "Композиции и реакции на текущей странице.",
            "en": "Tracks and their reactions on the current page."
          }
        },
        {
          "name": "items[].rank",
          "type": "integer",
          "description": {
            "ru": "Место в полном рейтинге, сохраняется при поиске.",
            "en": "Position in the full ranking, retained when searching."
          }
        },
        {
          "name": "total",
          "type": "integer",
          "description": {
            "ru": "Количество найденных композиций, не более 300.",
            "en": "Number of matching tracks, at most 300."
          }
        },
        {
          "name": "pages",
          "type": "integer",
          "description": {
            "ru": "Количество страниц результата.",
            "en": "Number of result pages."
          }
        },
        {
          "name": "generated_at",
          "type": "string | null",
          "description": {
            "ru": "Время расчёта рейтинга.",
            "en": "Time when the ranking was calculated."
          }
        },
        {
          "name": "next_update",
          "type": "string | null",
          "description": {
            "ru": "Плановое время обновления.",
            "en": "Scheduled refresh time."
          }
        },
        {
          "name": "error",
          "type": "string | null",
          "description": {
            "ru": "Описание ошибки; null при успешном ответе.",
            "en": "Error description, or null for a successful response."
          }
        }
      ],
      "notes": [
        {
          "ru": "Сортировка: stars, затем likes, затем plays — по убыванию.",
          "en": "Sorted by stars, then likes, then plays, in descending order."
        },
        {
          "ru": "Периоды считаются по Москве; неделя начинается в понедельник.",
          "en": "Periods use Moscow time; the week starts on Monday."
        },
        {
          "ru": "Рейтинг обычно обновляется каждые 30 минут; результат находится в корне JSON.",
          "en": "The ranking normally refreshes every 30 minutes; results are at the JSON root."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 400,
          "code": "unknown_stream",
          "description": {
            "ru": "Поток не найден.",
            "en": "Stream not found."
          }
        },
        {
          "status": 400,
          "code": "unknown_action",
          "description": {
            "ru": "Действие не найдено.",
            "en": "Unknown action."
          }
        },
        {
          "status": 503,
          "code": "cache_unavailable",
          "description": {
            "ru": "Кэш рейтинга недоступен.",
            "en": "The ranking cache is unavailable."
          }
        },
        {
          "status": 503,
          "code": "cache_busy",
          "description": {
            "ru": "Рейтинг обновляется; повторите запрос позже.",
            "en": "The ranking is being refreshed; retry later."
          }
        },
        {
          "status": 503,
          "code": "cache_retry_later",
          "description": {
            "ru": "Повторите запрос рейтинга позже.",
            "en": "Retry the ranking request later."
          }
        },
        {
          "status": 503,
          "code": "top_temporarily_unavailable",
          "description": {
            "ru": "Рейтинг временно недоступен.",
            "en": "The ranking is temporarily unavailable."
          }
        }
      ]
    },
    {
      "id": "audio",
      "group": "playback",
      "method": "GET",
      "path": "/song_audio.php",
      "title": {
        "ru": "Прослушать запись",
        "en": "Play a recording"
      },
      "summary": {
        "ru": "Получить MP3 по защищённой ссылке из поля file_path.",
        "en": "Retrieve an MP3 using the signed link in file_path."
      },
      "auth": "signed",
      "run": false,
      "format": "none",
      "query": {},
      "body": {},
      "params": [
        {
          "name": "id",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "ID записи из готовой ссылки.",
            "en": "Recording ID from the issued link."
          }
        },
        {
          "name": "expires",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Срок действия из готовой ссылки.",
            "en": "Expiration value from the issued link."
          }
        },
        {
          "name": "scope",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Область доступа из готовой ссылки.",
            "en": "Access scope from the issued link."
          },
          "enum": [
            "public",
            "history"
          ]
        },
        {
          "name": "signature",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Подпись из готовой ссылки.",
            "en": "Signature from the issued link."
          }
        },
        {
          "name": "Range",
          "in": "header",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Один диапазон байтов, например bytes=0-1023.",
            "en": "One byte range, for example bytes=0-1023."
          }
        }
      ],
      "response_kind": "audio",
      "response": {},
      "fields": [
        {
          "name": "Content-Type",
          "type": "header",
          "description": {
            "ru": "audio/mpeg; тело ответа содержит аудиофайл.",
            "en": "audio/mpeg; the response body contains the audio file."
          }
        },
        {
          "name": "Accept-Ranges",
          "type": "header",
          "description": {
            "ru": "bytes — доступно частичное чтение.",
            "en": "bytes indicates support for partial reads."
          }
        },
        {
          "name": "Content-Length",
          "type": "header",
          "description": {
            "ru": "Размер ответа в байтах.",
            "en": "Response size in bytes."
          }
        }
      ],
      "notes": [
        {
          "ru": "Используйте file_path целиком: ссылка действует до 15 минут, а запись истории доступна только первые 48 часов после эфира.",
          "en": "Use file_path unchanged: links last up to 15 minutes, and history recordings are available only within 48 hours of airplay."
        },
        {
          "ru": "При file_path=null воспроизведение недоступно.",
          "en": "Playback is unavailable when file_path is null."
        },
        {
          "ru": "Поддерживаются GET, HEAD и одиночный Range; частичный ответ имеет статус 206.",
          "en": "GET, HEAD and a single Range are supported; partial responses use status 206."
        }
      ],
      "errors": [
        {
          "status": 404,
          "code": "",
          "description": {
            "ru": "Ссылка истекла, недействительна или запись недоступна.",
            "en": "The link is expired or invalid, or the recording is unavailable."
          }
        },
        {
          "status": 405,
          "code": "",
          "description": {
            "ru": "Метод HTTP не поддерживается.",
            "en": "The HTTP method is not supported."
          }
        },
        {
          "status": 416,
          "code": "",
          "description": {
            "ru": "Запрошенный диапазон байтов недоступен.",
            "en": "The requested byte range is not available."
          }
        },
        {
          "status": 503,
          "code": "",
          "description": {
            "ru": "Временная ошибка сервера.",
            "en": "Temporary server error."
          }
        }
      ]
    },
    {
      "id": "streams",
      "group": "playback",
      "method": "GET",
      "path": "/api.php?action=streams",
      "title": {
        "ru": "Справочник потоков",
        "en": "Stream directory"
      },
      "summary": {
        "ru": "Коды и названия потоков радиостанции.",
        "en": "Radio stream codes and names."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {},
      "body": {},
      "params": [],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "items": [
            {
              "slug": "top",
              "name_ru": "Топ",
              "name_en": "TOP"
            }
          ]
        }
      },
      "fields": [
        {
          "name": "data.items",
          "type": "array",
          "description": {
            "ru": "Все записи справочника потоков.",
            "en": "All entries in the stream directory."
          }
        },
        {
          "name": "data.items[].slug",
          "type": "string",
          "description": {
            "ru": "Код для параметра stream.",
            "en": "Code to pass as the stream parameter."
          }
        }
      ],
      "notes": [
        {
          "ru": "Для воспроизведения используйте адреса из api.pleer.php.",
          "en": "Use the URLs returned by api.pleer.php for playback."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        }
      ]
    },
    {
      "id": "ping",
      "group": "playback",
      "method": "GET",
      "path": "/api.php?action=ping",
      "title": {
        "ru": "Проверка API",
        "en": "API health check"
      },
      "summary": {
        "ru": "Проверить доступность основного API.",
        "en": "Check availability of the main API."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {},
      "body": {},
      "params": [],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "pong": true
        }
      },
      "fields": [
        {
          "name": "data.pong",
          "type": "boolean",
          "description": {
            "ru": "true — API ответил на запрос.",
            "en": "true means the API responded to the request."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        }
      ]
    },
    {
      "id": "comments",
      "group": "community",
      "method": "GET",
      "path": "/api.php?action=comment.list",
      "title": {
        "ru": "Комментарии к треку",
        "en": "Track comments"
      },
      "summary": {
        "ru": "Последние комментарии к композиции по её hash.",
        "en": "Recent comments for a track identified by its hash."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      "body": {},
      "params": [
        {
          "name": "hash",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Hash композиции из now или history.",
            "en": "Track hash returned by now or history."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "items": [
            {
              "id": 12,
              "name": "Слушатель",
              "text": "Отличная композиция!",
              "created_at": "2026-11-20 12:00:00"
            }
          ]
        }
      },
      "fields": [
        {
          "name": "data.items",
          "type": "array",
          "description": {
            "ru": "Последние 5 комментариев, от новых к старым.",
            "en": "The latest 5 comments, newest first."
          }
        },
        {
          "name": "data.items[].created_at",
          "type": "string",
          "description": {
            "ru": "Время публикации YYYY-MM-DD HH:MM:SS.",
            "en": "Publication time in YYYY-MM-DD HH:MM:SS format."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        },
        {
          "status": 400,
          "code": "hash_required",
          "description": {
            "ru": "Не передан hash композиции.",
            "en": "The track hash is required."
          }
        }
      ]
    },
    {
      "id": "like",
      "group": "community",
      "method": "POST",
      "path": "/api.php?action=like",
      "title": {
        "ru": "Поставить лайк",
        "en": "Like a track"
      },
      "summary": {
        "ru": "Сохранить реакцию на композицию выбранного потока.",
        "en": "Save a reaction to a track on the selected stream."
      },
      "auth": "public",
      "run": false,
      "format": "form",
      "query": {},
      "body": {
        "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "stream": "top",
        "lang": "ru"
      },
      "params": [
        {
          "name": "hash",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Hash композиции.",
            "en": "Track hash."
          }
        },
        {
          "name": "stream",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код потока.",
            "en": "Stream code."
          },
          "default": "top"
        },
        {
          "name": "lang",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык ответа.",
            "en": "Response language."
          },
          "default": "ru"
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "stats": {
            "likes": 40,
            "dislikes": 3,
            "stars": 8,
            "score": 45
          }
        }
      },
      "fields": [
        {
          "name": "data.stats",
          "type": "object",
          "description": {
            "ru": "Реакции: likes, dislikes, stars и итог score.",
            "en": "Reactions: likes, dislikes, stars and the resulting score."
          }
        }
      ],
      "notes": [
        {
          "ru": "Передавайте тело как application/x-www-form-urlencoded или FormData.",
          "en": "Send the body as application/x-www-form-urlencoded or FormData."
        },
        {
          "ru": "Пауза между повторными реакциями с одного IP на трек в потоке — 5 минут.",
          "en": "Repeat reactions from one IP for the same track and stream require a 5-minute interval."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        },
        {
          "status": 400,
          "code": "hash_required",
          "description": {
            "ru": "Не передан hash композиции.",
            "en": "The track hash is required."
          }
        },
        {
          "status": 400,
          "code": "vote_failed",
          "description": {
            "ru": "Реакция не сохранена.",
            "en": "The reaction could not be saved."
          }
        },
        {
          "status": 429,
          "code": "",
          "description": {
            "ru": "Повторное голосование слишком скоро; error содержит текст на выбранном языке.",
            "en": "Another vote was submitted too soon; error contains a message in the selected language."
          }
        }
      ]
    },
    {
      "id": "dislike",
      "group": "community",
      "method": "POST",
      "path": "/api.php?action=dislike",
      "title": {
        "ru": "Поставить дизлайк",
        "en": "Dislike a track"
      },
      "summary": {
        "ru": "Сохранить реакцию на композицию выбранного потока.",
        "en": "Save a reaction to a track on the selected stream."
      },
      "auth": "public",
      "run": false,
      "format": "form",
      "query": {},
      "body": {
        "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "stream": "top",
        "lang": "ru"
      },
      "params": [
        {
          "name": "hash",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Hash композиции.",
            "en": "Track hash."
          }
        },
        {
          "name": "stream",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код потока.",
            "en": "Stream code."
          },
          "default": "top"
        },
        {
          "name": "lang",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык ответа.",
            "en": "Response language."
          },
          "default": "ru"
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "stats": {
            "likes": 40,
            "dislikes": 3,
            "stars": 8,
            "score": 45
          }
        }
      },
      "fields": [
        {
          "name": "data.stats",
          "type": "object",
          "description": {
            "ru": "Реакции: likes, dislikes, stars и итог score.",
            "en": "Reactions: likes, dislikes, stars and the resulting score."
          }
        }
      ],
      "notes": [
        {
          "ru": "Передавайте тело как application/x-www-form-urlencoded или FormData.",
          "en": "Send the body as application/x-www-form-urlencoded or FormData."
        },
        {
          "ru": "Пауза между повторными реакциями с одного IP на трек в потоке — 5 минут.",
          "en": "Repeat reactions from one IP for the same track and stream require a 5-minute interval."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        },
        {
          "status": 400,
          "code": "hash_required",
          "description": {
            "ru": "Не передан hash композиции.",
            "en": "The track hash is required."
          }
        },
        {
          "status": 400,
          "code": "vote_failed",
          "description": {
            "ru": "Реакция не сохранена.",
            "en": "The reaction could not be saved."
          }
        },
        {
          "status": 429,
          "code": "",
          "description": {
            "ru": "Повторное голосование слишком скоро; error содержит текст на выбранном языке.",
            "en": "Another vote was submitted too soon; error contains a message in the selected language."
          }
        }
      ]
    },
    {
      "id": "comment-add",
      "group": "community",
      "method": "POST",
      "path": "/api.php?action=comment.add",
      "title": {
        "ru": "Добавить комментарий",
        "en": "Add a comment"
      },
      "summary": {
        "ru": "Опубликовать комментарий к выбранной композиции.",
        "en": "Publish a comment on the selected track."
      },
      "auth": "public",
      "run": false,
      "format": "form",
      "query": {},
      "body": {
        "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "name": "Listener",
        "text": "Great track!",
        "stream": "top",
        "lang": "ru"
      },
      "params": [
        {
          "name": "hash",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Hash композиции.",
            "en": "Track hash."
          }
        },
        {
          "name": "text",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Текст комментария.",
            "en": "Comment text."
          }
        },
        {
          "name": "name",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Имя автора.",
            "en": "Author name."
          },
          "default": "Anon"
        },
        {
          "name": "stream",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код потока.",
            "en": "Stream code."
          },
          "default": "top"
        },
        {
          "name": "lang",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык ответа.",
            "en": "Response language."
          },
          "default": "ru"
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "items": [
            {
              "id": 12,
              "name": "Слушатель",
              "text": "Отличная композиция!",
              "created_at": "2026-11-20 12:00:00"
            }
          ]
        }
      },
      "fields": [
        {
          "name": "data.items",
          "type": "array",
          "description": {
            "ru": "Обновлённый список последних комментариев.",
            "en": "Updated list of recent comments."
          }
        }
      ],
      "notes": [
        {
          "ru": "Передавайте тело как application/x-www-form-urlencoded или FormData.",
          "en": "Send the body as application/x-www-form-urlencoded or FormData."
        },
        {
          "ru": "Пауза между комментариями с одного IP к одному треку — 5 минут.",
          "en": "Comments from one IP on the same track require a 5-minute interval."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "invalid_stream",
          "description": {
            "ru": "Некорректный код потока.",
            "en": "Invalid stream code."
          }
        },
        {
          "status": 503,
          "code": "api_temporarily_unavailable",
          "description": {
            "ru": "API временно недоступен.",
            "en": "The API is temporarily unavailable."
          }
        },
        {
          "status": 400,
          "code": "comment_invalid",
          "description": {
            "ru": "Укажите hash и текст комментария.",
            "en": "Provide the track hash and comment text."
          }
        },
        {
          "status": 400,
          "code": "comment_failed",
          "description": {
            "ru": "Комментарий не сохранён.",
            "en": "The comment could not be saved."
          }
        },
        {
          "status": 429,
          "code": "too_often",
          "description": {
            "ru": "Повторный комментарий отправлен слишком быстро.",
            "en": "Another comment was submitted too soon."
          }
        }
      ]
    },
    {
      "id": "client-statistics",
      "group": "analytics",
      "method": "GET",
      "path": "/userstatic/api/stats_service.php",
      "title": {
        "ru": "Аналитика услуги",
        "en": "Service analytics"
      },
      "summary": {
        "ru": "Эфиры, реакции, графики и достижения по номеру услуги.",
        "en": "Airplays, reactions, charts and achievements for a service."
      },
      "auth": "service",
      "run": false,
      "format": "none",
      "query": {
        "service_id": "SERVICE_ID",
        "mode": "week",
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "service_id",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Номер вашей услуги; передавайте строкой.",
            "en": "Your service ID, sent as a string."
          }
        },
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "ru — русский; остальные языки используют EN.",
            "en": "ru selects Russian; other languages use EN."
          },
          "default": "ru"
        },
        {
          "name": "mode",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Период отчёта.",
            "en": "Report period."
          },
          "default": "today",
          "enum": [
            "today",
            "yesterday",
            "week",
            "date",
            "months",
            "year"
          ]
        },
        {
          "name": "date",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Дата YYYY-MM-DD для mode=date.",
            "en": "Date as YYYY-MM-DD for mode=date."
          }
        },
        {
          "name": "m1",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Месяц YYYY-MM для mode=months.",
            "en": "Month as YYYY-MM for mode=months."
          }
        },
        {
          "name": "year",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Год для mode=year.",
            "en": "Year for mode=year."
          }
        },
        {
          "name": "details_page",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Страница отдельных выходов, начиная с 1.",
            "en": "Individual airplay page, starting at 1."
          },
          "default": 1
        },
        {
          "name": "details_limit",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Выходов на странице: от 1 до 2000.",
            "en": "Airplays per page, from 1 to 2,000."
          },
          "default": 2000
        },
        {
          "name": "airplays_page",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Страница сгруппированных композиций, начиная с 1.",
            "en": "Grouped track page, starting at 1."
          },
          "default": 1
        },
        {
          "name": "airplays_limit",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Композиций на странице: от 1 до 2000.",
            "en": "Tracks per page, from 1 to 2,000."
          },
          "default": 2000
        },
        {
          "name": "top_limit",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Композиций в analysis: от 1 до 30.",
            "en": "Tracks in analysis, from 1 to 30."
          },
          "default": 10
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "service_id": "SERVICE_ID",
        "language": "ru",
        "timezone": "Europe/Moscow",
        "data_source": "songs",
        "totals_complete": true,
        "total_plays": 0,
        "kpi": {
          "plays": 0,
          "unique_tracks": 0,
          "likes": 0,
          "dislikes": 0,
          "stars": 0,
          "reach": 0
        },
        "rows": [],
        "track_airplays": [],
        "analysis": []
      },
      "fields": [
        {
          "name": "kpi",
          "type": "object",
          "description": {
            "ru": "Итоги за весь выбранный период.",
            "en": "Totals for the entire selected period."
          }
        },
        {
          "name": "kpi_prev",
          "type": "object",
          "description": {
            "ru": "Итоги предыдущего периода для сравнения.",
            "en": "Totals for the previous comparison period."
          }
        },
        {
          "name": "rows",
          "type": "array",
          "description": {
            "ru": "Отдельные выходы в эфир.",
            "en": "Individual airplays."
          }
        },
        {
          "name": "rows_pagination",
          "type": "object",
          "description": {
            "ru": "Параметры страниц отдельных выходов.",
            "en": "Pagination information for individual airplays."
          }
        },
        {
          "name": "track_airplays",
          "type": "array",
          "description": {
            "ru": "Композиции с количеством выходов.",
            "en": "Tracks with their airplay counts."
          }
        },
        {
          "name": "track_airplays_pagination",
          "type": "object",
          "description": {
            "ru": "Параметры страниц композиций.",
            "en": "Pagination information for grouped tracks."
          }
        },
        {
          "name": "analysis",
          "type": "array",
          "description": {
            "ru": "Популярные композиции за период.",
            "en": "Leading tracks for the period."
          }
        },
        {
          "name": "links.details_csv",
          "type": "string",
          "description": {
            "ru": "Ссылка на полный CSV выбранного отчёта.",
            "en": "Link to the full CSV export of the selected report."
          }
        }
      ],
      "notes": [
        {
          "ru": "week — последние 7 календарных дней, включая сегодня, по Москве.",
          "en": "week covers the last 7 calendar days including today, in Moscow time."
        },
        {
          "ru": "Итоги за период не зависят от выбранной страницы.",
          "en": "Period totals are independent of the selected page."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "Missing service_id",
          "description": {
            "ru": "Не передан номер услуги.",
            "en": "The service ID is required."
          }
        },
        {
          "status": 404,
          "code": "Invalid service_id",
          "description": {
            "ru": "Услуга не найдена.",
            "en": "Service not found."
          }
        },
        {
          "status": 400,
          "code": "Invalid statistics parameters",
          "description": {
            "ru": "Некорректные параметры периода или страниц.",
            "en": "Invalid period or pagination parameters."
          }
        },
        {
          "status": 500,
          "code": "Server error",
          "description": {
            "ru": "Временная ошибка сервера.",
            "en": "Temporary server error."
          }
        }
      ]
    },
    {
      "id": "client-csv",
      "group": "analytics",
      "method": "GET",
      "path": "/userstatic/api/stats_service.php?export=csv",
      "title": {
        "ru": "Экспорт истории услуги",
        "en": "Export service history"
      },
      "summary": {
        "ru": "Скачать все выходы услуги за выбранный период в CSV.",
        "en": "Download all airplays for a service and period as CSV."
      },
      "auth": "service",
      "run": false,
      "format": "none",
      "query": {
        "service_id": "SERVICE_ID",
        "mode": "week",
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "service_id",
          "in": "query",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Номер вашей услуги; передавайте строкой.",
            "en": "Your service ID, sent as a string."
          }
        },
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "ru — русский; остальные языки используют EN.",
            "en": "ru selects Russian; other languages use EN."
          },
          "default": "ru"
        },
        {
          "name": "mode",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Период отчёта.",
            "en": "Report period."
          },
          "default": "today",
          "enum": [
            "today",
            "yesterday",
            "week",
            "date",
            "months",
            "year"
          ]
        },
        {
          "name": "date",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Дата YYYY-MM-DD для mode=date.",
            "en": "Date as YYYY-MM-DD for mode=date."
          }
        },
        {
          "name": "m1",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Месяц YYYY-MM для mode=months.",
            "en": "Month as YYYY-MM for mode=months."
          }
        },
        {
          "name": "year",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Год для mode=year.",
            "en": "Year for mode=year."
          }
        },
        {
          "name": "as_of",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Верхняя граница времени YYYY-MM-DD HH:MM:SS из ссылки отчёта.",
            "en": "Airplay time cutoff as YYYY-MM-DD HH:MM:SS from the report link."
          }
        }
      ],
      "response_kind": "csv",
      "response": {},
      "fields": [
        {
          "name": "track_name",
          "type": "CSV column",
          "description": {
            "ru": "Название композиции.",
            "en": "Track display name."
          }
        },
        {
          "name": "stream",
          "type": "CSV column",
          "description": {
            "ru": "Код потока.",
            "en": "Stream code."
          }
        },
        {
          "name": "played_at",
          "type": "CSV column",
          "description": {
            "ru": "Время выхода в эфир.",
            "en": "Airplay time."
          }
        },
        {
          "name": "period_play_count",
          "type": "CSV column",
          "description": {
            "ru": "Выходов этой композиции за период.",
            "en": "Airplay count for this track within the period."
          }
        },
        {
          "name": "likes, dislikes, stars, reach",
          "type": "CSV columns",
          "description": {
            "ru": "Реакции и охват.",
            "en": "Reactions and reach."
          }
        }
      ],
      "notes": [
        {
          "ru": "Используйте готовую ссылку links.details_csv из аналитики услуги.",
          "en": "Use the ready-made links.details_csv URL from service analytics."
        },
        {
          "ru": "Ответ — CSV в UTF-8 с BOM и разделителем «;», без ограничения одной страницей.",
          "en": "The response is UTF-8 CSV with a BOM and semicolon separator, without a single-page limit."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "Missing service_id",
          "description": {
            "ru": "Не передан номер услуги.",
            "en": "The service ID is required."
          }
        },
        {
          "status": 404,
          "code": "Invalid service_id",
          "description": {
            "ru": "Услуга не найдена.",
            "en": "Service not found."
          }
        },
        {
          "status": 500,
          "code": "Server error",
          "description": {
            "ru": "Временная ошибка сервера.",
            "en": "Temporary server error."
          }
        }
      ]
    },
    {
      "id": "audience-day",
      "group": "analytics",
      "method": "GET",
      "path": "/api_static.php?action=day",
      "title": {
        "ru": "Аудитория за день",
        "en": "Daily audience"
      },
      "summary": {
        "ru": "Почасовой отчёт аудитории по потокам за выбранную дату.",
        "en": "Hourly audience report by stream for a selected date."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык названий в отчёте.",
            "en": "Language of report labels."
          },
          "default": "ru",
          "enum": [
            "ru",
            "en"
          ]
        },
        {
          "name": "date",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Дата YYYY-MM-DD; по умолчанию сегодня.",
            "en": "Date as YYYY-MM-DD; defaults to today."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "from_cache": true,
        "cached_at": "2026-11-20 12:00:00",
        "timezone": "Europe/Moscow",
        "lang": "ru",
        "action": "day",
        "data": [
          {
            "stat_date": "2026-11-20",
            "stat_hour": 12,
            "stream_slug": "top",
            "stream_name": "Топ",
            "listeners": 120
          }
        ]
      },
      "fields": [
        {
          "name": "data",
          "type": "array",
          "description": {
            "ru": "Сохранённые значения аудитории по потокам.",
            "en": "Cached audience values by stream."
          }
        },
        {
          "name": "cached_at",
          "type": "string | null",
          "description": {
            "ru": "Время обновления отчёта.",
            "en": "Time when the report was updated."
          }
        },
        {
          "name": "summary.total_listeners",
          "type": "integer",
          "description": {
            "ru": "Суммарное значение за выбранный период.",
            "en": "Aggregate value for the selected period."
          }
        },
        {
          "name": "summary.unique_listeners",
          "type": "integer",
          "description": {
            "ru": "Расчётная оценка уникальной аудитории.",
            "en": "Estimated unique audience."
          }
        }
      ],
      "notes": [
        {
          "ru": "Отчёт использует сохранённые данные аудитории.",
          "en": "The report uses cached audience data."
        },
        {
          "ru": "unique_listeners — оценка, а не точное число отдельных людей.",
          "en": "unique_listeners is an estimate, not an exact count of individual people."
        }
      ],
      "errors": [
        {
          "status": 200,
          "code": "ok=false",
          "description": {
            "ru": "Сохранённый отчёт отсутствует или недоступен.",
            "en": "The cached report is missing or unavailable."
          }
        }
      ]
    },
    {
      "id": "audience-month",
      "group": "analytics",
      "method": "GET",
      "path": "/api_static.php?action=month",
      "title": {
        "ru": "Аудитория за месяц",
        "en": "Monthly audience"
      },
      "summary": {
        "ru": "Ежедневные показатели аудитории по потокам за месяц.",
        "en": "Daily audience values by stream for a month."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык названий в отчёте.",
            "en": "Language of report labels."
          },
          "default": "ru",
          "enum": [
            "ru",
            "en"
          ]
        },
        {
          "name": "month",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Месяц YYYY-MM; по умолчанию текущий.",
            "en": "Month as YYYY-MM; defaults to the current month."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "from_cache": true,
        "cached_at": "2026-11-20 12:00:00",
        "timezone": "Europe/Moscow",
        "lang": "ru",
        "action": "month",
        "data": [
          {
            "date": "2026-11-20",
            "stream_slug": "top",
            "stream_name": "Топ",
            "listeners": 120
          }
        ]
      },
      "fields": [
        {
          "name": "data",
          "type": "array",
          "description": {
            "ru": "Сохранённые значения аудитории по потокам.",
            "en": "Cached audience values by stream."
          }
        },
        {
          "name": "cached_at",
          "type": "string | null",
          "description": {
            "ru": "Время обновления отчёта.",
            "en": "Time when the report was updated."
          }
        },
        {
          "name": "summary.total_listeners",
          "type": "integer",
          "description": {
            "ru": "Суммарное значение за выбранный период.",
            "en": "Aggregate value for the selected period."
          }
        },
        {
          "name": "summary.unique_listeners",
          "type": "integer",
          "description": {
            "ru": "Расчётная оценка уникальной аудитории.",
            "en": "Estimated unique audience."
          }
        }
      ],
      "notes": [
        {
          "ru": "Отчёт использует сохранённые данные аудитории.",
          "en": "The report uses cached audience data."
        },
        {
          "ru": "unique_listeners — оценка, а не точное число отдельных людей.",
          "en": "unique_listeners is an estimate, not an exact count of individual people."
        }
      ],
      "errors": [
        {
          "status": 200,
          "code": "ok=false",
          "description": {
            "ru": "Сохранённый отчёт отсутствует или недоступен.",
            "en": "The cached report is missing or unavailable."
          }
        }
      ]
    },
    {
      "id": "audience-year",
      "group": "analytics",
      "method": "GET",
      "path": "/api_static.php?action=year",
      "title": {
        "ru": "Аудитория за год",
        "en": "Yearly audience"
      },
      "summary": {
        "ru": "Показатели аудитории за один год или диапазон лет.",
        "en": "Audience values for one year or a range of years."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык названий в отчёте.",
            "en": "Language of report labels."
          },
          "default": "ru",
          "enum": [
            "ru",
            "en"
          ]
        },
        {
          "name": "year",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Год; по умолчанию текущий.",
            "en": "Year; defaults to the current year."
          }
        },
        {
          "name": "year_from",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Первый год диапазона.",
            "en": "First year in the range."
          }
        },
        {
          "name": "year_to",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Последний год диапазона.",
            "en": "Last year in the range."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "from_cache": true,
        "cached_at": "2026-11-20 12:00:00",
        "timezone": "Europe/Moscow",
        "lang": "ru",
        "action": "year",
        "data": [
          {
            "year": 2026,
            "month": "2026-11",
            "stream_slug": "top",
            "stream_name": "Топ",
            "listeners": 120
          }
        ]
      },
      "fields": [
        {
          "name": "data",
          "type": "array",
          "description": {
            "ru": "Сохранённые значения аудитории по потокам.",
            "en": "Cached audience values by stream."
          }
        },
        {
          "name": "cached_at",
          "type": "string | null",
          "description": {
            "ru": "Время обновления отчёта.",
            "en": "Time when the report was updated."
          }
        },
        {
          "name": "summary.total_listeners",
          "type": "integer",
          "description": {
            "ru": "Суммарное значение за выбранный период.",
            "en": "Aggregate value for the selected period."
          }
        },
        {
          "name": "summary.unique_listeners",
          "type": "integer",
          "description": {
            "ru": "Расчётная оценка уникальной аудитории.",
            "en": "Estimated unique audience."
          }
        }
      ],
      "notes": [
        {
          "ru": "Отчёт использует сохранённые данные аудитории.",
          "en": "The report uses cached audience data."
        },
        {
          "ru": "unique_listeners — оценка, а не точное число отдельных людей.",
          "en": "unique_listeners is an estimate, not an exact count of individual people."
        },
        {
          "ru": "Один год разбивается по месяцам, диапазон — по годам.",
          "en": "A single year is grouped by month; a range is grouped by year."
        }
      ],
      "errors": [
        {
          "status": 200,
          "code": "ok=false",
          "description": {
            "ru": "Сохранённый отчёт отсутствует или недоступен.",
            "en": "The cached report is missing or unavailable."
          }
        }
      ]
    },
    {
      "id": "audience-periods",
      "group": "analytics",
      "method": "GET",
      "path": "/api_static.php?action=periods",
      "title": {
        "ru": "Доступные периоды",
        "en": "Available periods"
      },
      "summary": {
        "ru": "Месяцы и годы, для которых доступны сохранённые отчёты аудитории.",
        "en": "Months and years with cached audience reports."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык названий в отчёте.",
            "en": "Language of report labels."
          },
          "default": "ru",
          "enum": [
            "ru",
            "en"
          ]
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "from_cache": true,
        "action": "periods",
        "data": {
          "months": [
            {
              "value": "2026-11",
              "label": "Ноябрь 2026",
              "year": 2026,
              "month": 11
            }
          ],
          "years": [
            {
              "value": "2026",
              "label": "2026"
            }
          ],
          "latest_month": "2026-11",
          "latest_year": "2026"
        }
      },
      "fields": [
        {
          "name": "data.months",
          "type": "array",
          "description": {
            "ru": "Доступные месяцы с кодами и подписями.",
            "en": "Available months with values and labels."
          }
        },
        {
          "name": "data.years",
          "type": "array",
          "description": {
            "ru": "Доступные годы.",
            "en": "Available years."
          }
        },
        {
          "name": "data.latest_month",
          "type": "string | null",
          "description": {
            "ru": "Последний доступный месяц YYYY-MM.",
            "en": "Latest available month as YYYY-MM."
          }
        },
        {
          "name": "data.latest_year",
          "type": "string | null",
          "description": {
            "ru": "Последний доступный год.",
            "en": "Latest available year."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 200,
          "code": "ok=false",
          "description": {
            "ru": "Сохранённый отчёт отсутствует или недоступен.",
            "en": "The cached report is missing or unavailable."
          }
        }
      ]
    },
    {
      "id": "audience-countries",
      "group": "analytics",
      "method": "GET",
      "path": "/api_static.php?action=countries",
      "title": {
        "ru": "География аудитории",
        "en": "Audience geography"
      },
      "summary": {
        "ru": "До 12 стран по средней доле аудитории за период.",
        "en": "Up to 12 countries by average audience share for a period."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {
        "lang": "ru"
      },
      "body": {},
      "params": [
        {
          "name": "lang",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Язык названий в отчёте.",
            "en": "Language of report labels."
          },
          "default": "ru",
          "enum": [
            "ru",
            "en"
          ]
        },
        {
          "name": "month",
          "in": "query",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Месяц YYYY-MM; имеет приоритет над годом.",
            "en": "Month as YYYY-MM; takes precedence over the year."
          }
        },
        {
          "name": "year",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Год; по умолчанию текущий.",
            "en": "Year; defaults to the current year."
          }
        },
        {
          "name": "year_from",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Первый год диапазона.",
            "en": "First year in the range."
          }
        },
        {
          "name": "year_to",
          "in": "query",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Последний год диапазона.",
            "en": "Last year in the range."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "from_cache": true,
        "action": "countries",
        "data": [
          {
            "country": "Россия",
            "percent": 60.2
          }
        ],
        "period": {
          "month_from": "2026-11",
          "month_to": "2026-11",
          "year_from": 2026,
          "year_to": 2026
        }
      },
      "fields": [
        {
          "name": "data[].country",
          "type": "string",
          "description": {
            "ru": "Название страны.",
            "en": "Country name."
          }
        },
        {
          "name": "data[].percent",
          "type": "number",
          "description": {
            "ru": "Средняя доля аудитории в процентах.",
            "en": "Average audience share as a percentage."
          }
        },
        {
          "name": "period",
          "type": "object",
          "description": {
            "ru": "Границы выбранного периода.",
            "en": "Selected period boundaries."
          }
        }
      ],
      "notes": [
        {
          "ru": "Доли рассчитаны по сохранённым отчётам и отсортированы по убыванию.",
          "en": "Shares are calculated from cached reports and sorted in descending order."
        }
      ],
      "errors": [
        {
          "status": 200,
          "code": "ok=false",
          "description": {
            "ru": "Сохранённый отчёт отсутствует или недоступен.",
            "en": "The cached report is missing or unavailable."
          }
        }
      ]
    },
    {
      "id": "client-check-service",
      "group": "auth",
      "method": "POST",
      "path": "/api.auth.client.php?action=check_service",
      "title": {
        "ru": "Проверить услугу",
        "en": "Check a service"
      },
      "summary": {
        "ru": "Узнать, назначен ли пароль для указанной услуги.",
        "en": "Check whether a password has been set for a service."
      },
      "auth": "public",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "service_id": "SERVICE_ID"
      },
      "params": [
        {
          "name": "service_id",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Номер услуги, до 64 символов.",
            "en": "Service ID, up to 64 characters."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "service_id": "SERVICE_ID",
          "password_set": true
        }
      },
      "fields": [
        {
          "name": "data.password_set",
          "type": "boolean",
          "description": {
            "ru": "true — пароль уже есть, false — требуется первый пароль.",
            "en": "true means a password exists; false means initial setup is needed."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 400,
          "code": "missing_credentials",
          "description": {
            "ru": "Укажите необходимые данные для входа.",
            "en": "Provide the required credentials."
          }
        },
        {
          "status": 404,
          "code": "service_not_found",
          "description": {
            "ru": "Услуга не найдена.",
            "en": "Service not found."
          }
        },
        {
          "status": 403,
          "code": "service_status_deleted",
          "description": {
            "ru": "Услуга удалена.",
            "en": "The service has been deleted."
          }
        }
      ]
    },
    {
      "id": "client-login",
      "group": "auth",
      "method": "POST",
      "path": "/api.auth.client.php?action=login",
      "title": {
        "ru": "Вход клиента",
        "en": "Client sign-in"
      },
      "summary": {
        "ru": "Получить клиентский токен по номеру услуги и паролю.",
        "en": "Get a client token using a service ID and password."
      },
      "auth": "public",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "service_id": "SERVICE_ID",
        "password": "PASSWORD"
      },
      "params": [
        {
          "name": "service_id",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Номер услуги, до 64 символов.",
            "en": "Service ID, up to 64 characters."
          }
        },
        {
          "name": "password",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Пароль клиента.",
            "en": "Client password."
          }
        },
        {
          "name": "device_uuid",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "UUID ранее зарегистрированного push-устройства.",
            "en": "UUID of a previously registered push device."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "mode": "login",
          "token": {
            "access_token": "ACCESS_TOKEN",
            "token_type": "Bearer",
            "expires_at": "2026-12-20 12:00:00",
            "expires_in": 2592000
          },
          "profile_api": "api.profile.client.php",
          "user": {
            "id": 1001,
            "name": "Client",
            "service_id": "SERVICE_ID",
            "status": "active"
          }
        }
      },
      "fields": [
        {
          "name": "data.token.access_token",
          "type": "string",
          "description": {
            "ru": "Токен для заголовка Authorization: Bearer.",
            "en": "Token for the Authorization: Bearer header."
          }
        },
        {
          "name": "data.token.expires_at",
          "type": "string",
          "description": {
            "ru": "Срок действия, указанный при выдаче токена.",
            "en": "Expiration time returned when the token is issued."
          }
        },
        {
          "name": "data.user",
          "type": "object",
          "description": {
            "ru": "Профиль клиента и параметры услуги.",
            "en": "Client profile and service details."
          }
        }
      ],
      "notes": [
        {
          "ru": "Используйте полученный токен для клиентского профиля и исполнителей.",
          "en": "Use the returned token for client profile and artist endpoints."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "missing_credentials",
          "description": {
            "ru": "Укажите необходимые данные для входа.",
            "en": "Provide the required credentials."
          }
        },
        {
          "status": 401,
          "code": "invalid_credentials",
          "description": {
            "ru": "Номер услуги или пароль не принят.",
            "en": "The service ID or password was not accepted."
          }
        },
        {
          "status": 409,
          "code": "password_setup_required",
          "description": {
            "ru": "Сначала создайте пароль услуги.",
            "en": "Create the service password first."
          }
        },
        {
          "status": 403,
          "code": "service_status_deleted",
          "description": {
            "ru": "Услуга удалена.",
            "en": "The service has been deleted."
          }
        }
      ]
    },
    {
      "id": "client-create-password",
      "group": "auth",
      "method": "POST",
      "path": "/api.auth.client.php?action=create_password",
      "title": {
        "ru": "Первый пароль клиента",
        "en": "Set the first client password"
      },
      "summary": {
        "ru": "Назначить первый пароль услуги и получить клиентский токен.",
        "en": "Set the service’s first password and receive a client token."
      },
      "auth": "public",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "service_id": "SERVICE_ID",
        "password": "NEW_PASSWORD"
      },
      "params": [
        {
          "name": "service_id",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Номер услуги, до 64 символов.",
            "en": "Service ID, up to 64 characters."
          }
        },
        {
          "name": "password",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "От 8 до 128 символов.",
            "en": "From 8 to 128 characters."
          }
        },
        {
          "name": "device_uuid",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "UUID ранее зарегистрированного push-устройства.",
            "en": "UUID of a previously registered push device."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "mode": "password_created",
          "token": {
            "access_token": "ACCESS_TOKEN",
            "token_type": "Bearer",
            "expires_at": "2026-12-20 12:00:00",
            "expires_in": 2592000
          },
          "profile_api": "api.profile.client.php",
          "user": {
            "id": 1001,
            "name": "Client",
            "service_id": "SERVICE_ID",
            "status": "active"
          }
        }
      },
      "fields": [
        {
          "name": "data.token.access_token",
          "type": "string",
          "description": {
            "ru": "Токен для заголовка Authorization: Bearer.",
            "en": "Token for the Authorization: Bearer header."
          }
        },
        {
          "name": "data.token.expires_at",
          "type": "string",
          "description": {
            "ru": "Срок действия, указанный при выдаче токена.",
            "en": "Expiration time returned when the token is issued."
          }
        },
        {
          "name": "data.user",
          "type": "object",
          "description": {
            "ru": "Профиль клиента и параметры услуги.",
            "en": "Client profile and service details."
          }
        }
      ],
      "notes": [
        {
          "ru": "Применяется только к услуге, у которой ещё нет пароля.",
          "en": "Available only for a service that does not have a password yet."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "missing_credentials",
          "description": {
            "ru": "Укажите необходимые данные для входа.",
            "en": "Provide the required credentials."
          }
        },
        {
          "status": 401,
          "code": "invalid_credentials",
          "description": {
            "ru": "Номер услуги или пароль не принят.",
            "en": "The service ID or password was not accepted."
          }
        },
        {
          "status": 403,
          "code": "service_status_deleted",
          "description": {
            "ru": "Услуга удалена.",
            "en": "The service has been deleted."
          }
        },
        {
          "status": 409,
          "code": "password_already_set",
          "description": {
            "ru": "Пароль уже назначен.",
            "en": "A password has already been set."
          }
        },
        {
          "status": 422,
          "code": "password_too_short",
          "description": {
            "ru": "Пароль короче 8 символов.",
            "en": "The password is shorter than 8 characters."
          }
        },
        {
          "status": 422,
          "code": "password_too_long",
          "description": {
            "ru": "Пароль длиннее 128 символов.",
            "en": "The password is longer than 128 characters."
          }
        }
      ]
    },
    {
      "id": "client-logout",
      "group": "auth",
      "method": "POST",
      "path": "/api.auth.client.php?action=logout",
      "title": {
        "ru": "Выход клиента",
        "en": "Client sign-out"
      },
      "summary": {
        "ru": "Отозвать переданный токен доступа.",
        "en": "Revoke the supplied access token."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "json",
      "query": {},
      "body": {},
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        },
        {
          "name": "device_uuid",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "При передаче снимает привязку push-устройства к аккаунту.",
            "en": "If supplied, unlinks the push device from the account."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "logged_out": true
        }
      },
      "fields": [
        {
          "name": "data.logged_out",
          "type": "boolean",
          "description": {
            "ru": "true — выход выполнен.",
            "en": "true means sign-out is complete."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        }
      ]
    },
    {
      "id": "listener-logout",
      "group": "auth",
      "method": "POST",
      "path": "/api.auth.app.php?action=logout",
      "title": {
        "ru": "Выход слушателя",
        "en": "Listener sign-out"
      },
      "summary": {
        "ru": "Отозвать переданный токен доступа.",
        "en": "Revoke the supplied access token."
      },
      "auth": "bearer-app",
      "run": false,
      "format": "json",
      "query": {},
      "body": {},
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен слушателя.",
            "en": "Bearer ACCESS_TOKEN — a listener token."
          }
        },
        {
          "name": "device_uuid",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "При передаче снимает привязку push-устройства к аккаунту.",
            "en": "If supplied, unlinks the push device from the account."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "logged_out": true
        }
      },
      "fields": [
        {
          "name": "data.logged_out",
          "type": "boolean",
          "description": {
            "ru": "true — выход выполнен.",
            "en": "true means sign-out is complete."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        }
      ]
    },
    {
      "id": "profile-app",
      "group": "profiles",
      "method": "GET",
      "path": "/api.profile.app.php?action=me",
      "title": {
        "ru": "Профиль слушателя",
        "en": "Listener profile"
      },
      "summary": {
        "ru": "Получить профиль владельца токена слушателя.",
        "en": "Get the profile of the listener token owner."
      },
      "auth": "bearer-app",
      "run": false,
      "format": "none",
      "query": {},
      "body": {},
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен слушателя.",
            "en": "Bearer ACCESS_TOKEN — a listener token."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "id": 1001,
          "name": "Listener",
          "last_name": null,
          "email": null,
          "platform": "ios",
          "language_code": "ru",
          "country_code": "RU",
          "status": "active"
        }
      },
      "fields": [
        {
          "name": "data",
          "type": "object",
          "description": {
            "ru": "Профиль владельца токена слушателя.",
            "en": "Profile of the listener token owner."
          }
        },
        {
          "name": "data.language_code",
          "type": "string | null",
          "description": {
            "ru": "Язык профиля.",
            "en": "Profile language."
          }
        },
        {
          "name": "data.country_code",
          "type": "string | null",
          "description": {
            "ru": "Код страны.",
            "en": "Country code."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 404,
          "code": "user_not_found",
          "description": {
            "ru": "Аккаунт не найден.",
            "en": "Account not found."
          }
        }
      ]
    },
    {
      "id": "profile-app-update",
      "group": "profiles",
      "method": "POST",
      "path": "/api.profile.app.php?action=update",
      "title": {
        "ru": "Изменить профиль слушателя",
        "en": "Update listener profile"
      },
      "summary": {
        "ru": "Сохранить имя, язык и страну своего профиля.",
        "en": "Save your profile name, language and country."
      },
      "auth": "bearer-app",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "name": "Listener",
        "language_code": "ru",
        "country_code": "RU"
      },
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен слушателя.",
            "en": "Bearer ACCESS_TOKEN — a listener token."
          }
        },
        {
          "name": "name",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Имя, до 128 символов.",
            "en": "First name, up to 128 characters."
          }
        },
        {
          "name": "last_name",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Фамилия, до 128 символов.",
            "en": "Last name, up to 128 characters."
          }
        },
        {
          "name": "language_code",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код языка; локаль сокращается до языка.",
            "en": "Language code; a locale is reduced to its language."
          }
        },
        {
          "name": "country_code",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Код страны из 2–3 латинских букв.",
            "en": "Country code with 2–3 Latin letters."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "id": 1001,
          "name": "Listener",
          "last_name": null,
          "email": null,
          "platform": "ios",
          "language_code": "ru",
          "country_code": "RU",
          "status": "active"
        }
      },
      "fields": [
        {
          "name": "data",
          "type": "object",
          "description": {
            "ru": "Профиль владельца токена слушателя.",
            "en": "Profile of the listener token owner."
          }
        },
        {
          "name": "data.language_code",
          "type": "string | null",
          "description": {
            "ru": "Язык профиля.",
            "en": "Profile language."
          }
        },
        {
          "name": "data.country_code",
          "type": "string | null",
          "description": {
            "ru": "Код страны.",
            "en": "Country code."
          }
        }
      ],
      "notes": [
        {
          "ru": "Неуказанные и пустые необязательные поля сохраняют прежние значения.",
          "en": "Omitted and empty optional fields retain their previous values."
        }
      ],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 404,
          "code": "user_not_found",
          "description": {
            "ru": "Аккаунт не найден.",
            "en": "Account not found."
          }
        }
      ]
    },
    {
      "id": "profile-client",
      "group": "profiles",
      "method": "GET",
      "path": "/api.profile.client.php?action=me",
      "title": {
        "ru": "Профиль клиента",
        "en": "Client profile"
      },
      "summary": {
        "ru": "Получить свой профиль и параметры услуги.",
        "en": "Get your profile and service details."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "none",
      "query": {},
      "body": {},
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "id": 1001,
          "name": "Client",
          "service_id": "SERVICE_ID",
          "status": "active",
          "service_name": "Rotation",
          "service_start": "2026-11-01",
          "service_end": "2026-12-01",
          "track_limit": 3
        }
      },
      "fields": [
        {
          "name": "data",
          "type": "object",
          "description": {
            "ru": "Профиль владельца клиентского токена.",
            "en": "Profile of the client token owner."
          }
        },
        {
          "name": "data.service_id",
          "type": "string",
          "description": {
            "ru": "Номер услуги.",
            "en": "Service ID."
          }
        },
        {
          "name": "data.streams",
          "type": "array",
          "description": {
            "ru": "Потоки, связанные с услугой.",
            "en": "Streams associated with the service."
          }
        },
        {
          "name": "data.service_end",
          "type": "string | null",
          "description": {
            "ru": "Дата окончания услуги.",
            "en": "Service end date."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 404,
          "code": "user_not_found",
          "description": {
            "ru": "Аккаунт не найден.",
            "en": "Account not found."
          }
        }
      ]
    },
    {
      "id": "profile-client-update",
      "group": "profiles",
      "method": "POST",
      "path": "/api.profile.client.php?action=update",
      "title": {
        "ru": "Изменить профиль клиента",
        "en": "Update client profile"
      },
      "summary": {
        "ru": "Сохранить имя владельца клиентского аккаунта.",
        "en": "Save the name of the client account owner."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "name": "Client"
      },
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        },
        {
          "name": "name",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Имя, до 128 символов.",
            "en": "Name, up to 128 characters."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "id": 1001,
          "name": "Client",
          "service_id": "SERVICE_ID",
          "status": "active",
          "service_name": "Rotation",
          "service_start": "2026-11-01",
          "service_end": "2026-12-01",
          "track_limit": 3
        }
      },
      "fields": [
        {
          "name": "data",
          "type": "object",
          "description": {
            "ru": "Профиль владельца клиентского токена.",
            "en": "Profile of the client token owner."
          }
        },
        {
          "name": "data.service_id",
          "type": "string",
          "description": {
            "ru": "Номер услуги.",
            "en": "Service ID."
          }
        },
        {
          "name": "data.streams",
          "type": "array",
          "description": {
            "ru": "Потоки, связанные с услугой.",
            "en": "Streams associated with the service."
          }
        },
        {
          "name": "data.service_end",
          "type": "string | null",
          "description": {
            "ru": "Дата окончания услуги.",
            "en": "Service end date."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 400,
          "code": "missing_name",
          "description": {
            "ru": "Укажите имя.",
            "en": "A name is required."
          }
        },
        {
          "status": 404,
          "code": "user_not_found",
          "description": {
            "ru": "Аккаунт не найден.",
            "en": "Account not found."
          }
        }
      ]
    },
    {
      "id": "artists-list",
      "group": "profiles",
      "method": "GET",
      "path": "/api.client_artists.php?action=list",
      "title": {
        "ru": "Исполнители клиента",
        "en": "Client artists"
      },
      "summary": {
        "ru": "Получить исполнителей, связанных с вашим клиентским аккаунтом.",
        "en": "Get the artists associated with your client account."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "none",
      "query": {},
      "body": {},
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "items": [
            {
              "id": 2001,
              "artist_name_ru": "Имя исполнителя",
              "artist_name_en": "Artist name",
              "is_active": 1,
              "notify_enabled": 1,
              "cooldown_minutes": 10
            }
          ],
          "total": 1
        }
      },
      "fields": [
        {
          "name": "data.items",
          "type": "array",
          "description": {
            "ru": "Исполнители: активные выше, затем новые.",
            "en": "Artists with active records first, then newest first."
          }
        },
        {
          "name": "data.total",
          "type": "integer",
          "description": {
            "ru": "Общее количество записей.",
            "en": "Total record count."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        }
      ]
    },
    {
      "id": "artists-add",
      "group": "profiles",
      "method": "POST",
      "path": "/api.client_artists.php?action=add",
      "title": {
        "ru": "Добавить исполнителя",
        "en": "Add an artist"
      },
      "summary": {
        "ru": "Добавить исполнителя и настройки его уведомлений.",
        "en": "Add an artist and configure their notifications."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "artist_name_ru": "Имя исполнителя",
        "artist_name_en": "Artist name",
        "notify_enabled": 1,
        "cooldown_minutes": 10
      },
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        },
        {
          "name": "artist_name_ru",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Имя на русском, до 255 символов.",
            "en": "Russian artist name, up to 255 characters."
          }
        },
        {
          "name": "artist_name_en",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Имя латиницей, до 255 символов.",
            "en": "Artist name in Latin script, up to 255 characters."
          }
        },
        {
          "name": "is_active",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Активность записи.",
            "en": "Whether the record is active."
          },
          "default": 1,
          "enum": [
            0,
            1
          ]
        },
        {
          "name": "notify_enabled",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Разрешение уведомлений.",
            "en": "Whether notifications are enabled."
          },
          "default": 1,
          "enum": [
            0,
            1
          ]
        },
        {
          "name": "cooldown_minutes",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Пауза между уведомлениями: от 1 до 1440 минут.",
            "en": "Interval between notifications, from 1 to 1,440 minutes."
          },
          "default": 10
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "mode": "add",
          "artist": {
            "id": 2001,
            "artist_name_ru": "Имя исполнителя",
            "artist_name_en": "Artist name",
            "is_active": 1,
            "notify_enabled": 1,
            "cooldown_minutes": 10
          }
        }
      },
      "fields": [
        {
          "name": "data.artist",
          "type": "object",
          "description": {
            "ru": "Сохранённая запись исполнителя.",
            "en": "Saved artist record."
          }
        },
        {
          "name": "data.artist.is_active",
          "type": "integer",
          "description": {
            "ru": "1 — запись активна; 0 — выключена.",
            "en": "1 means the record is active; 0 means disabled."
          }
        },
        {
          "name": "data.artist.notify_enabled",
          "type": "integer",
          "description": {
            "ru": "1 — уведомления разрешены; 0 — выключены.",
            "en": "1 enables notifications; 0 disables them."
          }
        },
        {
          "name": "data.artist.cooldown_minutes",
          "type": "integer",
          "description": {
            "ru": "Минимальная пауза уведомлений в минутах.",
            "en": "Minimum notification interval in minutes."
          }
        }
      ],
      "notes": [
        {
          "ru": "Обязательно хотя бы одно имя: artist_name_ru или artist_name_en.",
          "en": "At least one name is required: artist_name_ru or artist_name_en."
        }
      ],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 400,
          "code": "missing_artist_name",
          "description": {
            "ru": "Укажите хотя бы одно имя исполнителя.",
            "en": "Provide at least one artist name."
          }
        },
        {
          "status": 409,
          "code": "artist_already_exists",
          "description": {
            "ru": "Такой исполнитель уже добавлен.",
            "en": "The artist has already been added."
          }
        }
      ]
    },
    {
      "id": "artists-update",
      "group": "profiles",
      "method": "POST",
      "path": "/api.client_artists.php?action=update",
      "title": {
        "ru": "Изменить исполнителя",
        "en": "Update an artist"
      },
      "summary": {
        "ru": "Обновить имена и настройки своего исполнителя.",
        "en": "Update your artist’s names and settings."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "id": 2001,
        "notify_enabled": 0
      },
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        },
        {
          "name": "id",
          "in": "body",
          "type": "integer",
          "required": true,
          "description": {
            "ru": "ID записи исполнителя в вашем аккаунте.",
            "en": "Artist record ID in your account."
          }
        },
        {
          "name": "artist_name_ru",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Имя на русском, до 255 символов.",
            "en": "Russian artist name, up to 255 characters."
          }
        },
        {
          "name": "artist_name_en",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Имя латиницей, до 255 символов.",
            "en": "Artist name in Latin script, up to 255 characters."
          }
        },
        {
          "name": "is_active",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Активность записи.",
            "en": "Whether the record is active."
          },
          "enum": [
            0,
            1
          ]
        },
        {
          "name": "notify_enabled",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Разрешение уведомлений.",
            "en": "Whether notifications are enabled."
          },
          "enum": [
            0,
            1
          ]
        },
        {
          "name": "cooldown_minutes",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Пауза между уведомлениями: от 1 до 1440 минут.",
            "en": "Interval between notifications, from 1 to 1,440 minutes."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "mode": "update",
          "artist": {
            "id": 2001,
            "artist_name_ru": "Имя исполнителя",
            "artist_name_en": "Artist name",
            "is_active": 1,
            "notify_enabled": 0,
            "cooldown_minutes": 10
          }
        }
      },
      "fields": [
        {
          "name": "data.artist",
          "type": "object",
          "description": {
            "ru": "Сохранённая запись исполнителя.",
            "en": "Saved artist record."
          }
        },
        {
          "name": "data.artist.is_active",
          "type": "integer",
          "description": {
            "ru": "1 — запись активна; 0 — выключена.",
            "en": "1 means the record is active; 0 means disabled."
          }
        },
        {
          "name": "data.artist.notify_enabled",
          "type": "integer",
          "description": {
            "ru": "1 — уведомления разрешены; 0 — выключены.",
            "en": "1 enables notifications; 0 disables them."
          }
        },
        {
          "name": "data.artist.cooldown_minutes",
          "type": "integer",
          "description": {
            "ru": "Минимальная пауза уведомлений в минутах.",
            "en": "Minimum notification interval in minutes."
          }
        }
      ],
      "notes": [
        {
          "ru": "Неуказанные поля сохраняются; хотя бы одно имя должно остаться заполненным.",
          "en": "Omitted fields are retained; at least one name must remain filled in."
        }
      ],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 400,
          "code": "missing_artist_id",
          "description": {
            "ru": "Не передан ID исполнителя.",
            "en": "The artist ID is required."
          }
        },
        {
          "status": 404,
          "code": "artist_not_found",
          "description": {
            "ru": "Исполнитель не найден в вашем аккаунте.",
            "en": "The artist was not found in your account."
          }
        },
        {
          "status": 400,
          "code": "missing_artist_name",
          "description": {
            "ru": "Укажите хотя бы одно имя исполнителя.",
            "en": "Provide at least one artist name."
          }
        },
        {
          "status": 409,
          "code": "artist_already_exists",
          "description": {
            "ru": "Такой исполнитель уже добавлен.",
            "en": "The artist has already been added."
          }
        }
      ]
    },
    {
      "id": "artists-toggle",
      "group": "profiles",
      "method": "POST",
      "path": "/api.client_artists.php?action=toggle",
      "title": {
        "ru": "Настройка исполнителя",
        "en": "Set an artist flag"
      },
      "summary": {
        "ru": "Изменить активность исполнителя или разрешение уведомлений.",
        "en": "Change an artist’s active state or notification setting."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "id": 2001,
        "field": "notify_enabled",
        "value": 0
      },
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        },
        {
          "name": "id",
          "in": "body",
          "type": "integer",
          "required": true,
          "description": {
            "ru": "ID записи исполнителя в вашем аккаунте.",
            "en": "Artist record ID in your account."
          }
        },
        {
          "name": "field",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Настройка для изменения.",
            "en": "Setting to change."
          },
          "default": "is_active",
          "enum": [
            "is_active",
            "notify_enabled"
          ]
        },
        {
          "name": "value",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Новое значение настройки.",
            "en": "New setting value."
          },
          "default": 1,
          "enum": [
            0,
            1
          ]
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "mode": "toggle",
          "updated": true,
          "artist": {
            "id": 2001,
            "artist_name_ru": "Имя исполнителя",
            "artist_name_en": "Artist name",
            "is_active": 1,
            "notify_enabled": 0,
            "cooldown_minutes": 10
          }
        }
      },
      "fields": [
        {
          "name": "data.artist",
          "type": "object",
          "description": {
            "ru": "Сохранённая запись исполнителя.",
            "en": "Saved artist record."
          }
        },
        {
          "name": "data.artist.is_active",
          "type": "integer",
          "description": {
            "ru": "1 — запись активна; 0 — выключена.",
            "en": "1 means the record is active; 0 means disabled."
          }
        },
        {
          "name": "data.artist.notify_enabled",
          "type": "integer",
          "description": {
            "ru": "1 — уведомления разрешены; 0 — выключены.",
            "en": "1 enables notifications; 0 disables them."
          }
        },
        {
          "name": "data.artist.cooldown_minutes",
          "type": "integer",
          "description": {
            "ru": "Минимальная пауза уведомлений в минутах.",
            "en": "Minimum notification interval in minutes."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 400,
          "code": "missing_artist_id",
          "description": {
            "ru": "Не передан ID исполнителя.",
            "en": "The artist ID is required."
          }
        },
        {
          "status": 400,
          "code": "invalid_toggle_field",
          "description": {
            "ru": "Допустимы is_active и notify_enabled.",
            "en": "Only is_active and notify_enabled are supported."
          }
        },
        {
          "status": 404,
          "code": "artist_not_found",
          "description": {
            "ru": "Исполнитель не найден в вашем аккаунте.",
            "en": "The artist was not found in your account."
          }
        }
      ]
    },
    {
      "id": "artists-delete",
      "group": "profiles",
      "method": "POST",
      "path": "/api.client_artists.php?action=delete",
      "title": {
        "ru": "Удалить исполнителя",
        "en": "Delete an artist"
      },
      "summary": {
        "ru": "Удалить запись исполнителя из своего аккаунта.",
        "en": "Delete an artist record from your account."
      },
      "auth": "bearer-client",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "id": 2001
      },
      "params": [
        {
          "name": "Authorization",
          "in": "header",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Bearer ACCESS_TOKEN — токен клиента.",
            "en": "Bearer ACCESS_TOKEN — a client token."
          }
        },
        {
          "name": "id",
          "in": "body",
          "type": "integer",
          "required": true,
          "description": {
            "ru": "ID записи исполнителя в вашем аккаунте.",
            "en": "Artist record ID in your account."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "mode": "delete",
          "deleted": true,
          "id": 2001
        }
      },
      "fields": [
        {
          "name": "data.deleted",
          "type": "boolean",
          "description": {
            "ru": "true — запись удалена.",
            "en": "true means the record was deleted."
          }
        },
        {
          "name": "data.id",
          "type": "integer",
          "description": {
            "ru": "ID удалённой записи.",
            "en": "Deleted record ID."
          }
        }
      ],
      "notes": [],
      "errors": [
        {
          "status": 401,
          "code": "missing_bearer_token",
          "description": {
            "ru": "Не передан Bearer-токен.",
            "en": "The Bearer token is missing."
          }
        },
        {
          "status": 401,
          "code": "invalid_token",
          "description": {
            "ru": "Токен не принят.",
            "en": "The token was not accepted."
          }
        },
        {
          "status": 403,
          "code": "token_scope_mismatch",
          "description": {
            "ru": "Токен относится к другому типу аккаунта.",
            "en": "The token belongs to a different account type."
          }
        },
        {
          "status": 401,
          "code": "token_revoked",
          "description": {
            "ru": "Токен отозван.",
            "en": "The token has been revoked."
          }
        },
        {
          "status": 401,
          "code": "token_expired",
          "description": {
            "ru": "Токен истёк.",
            "en": "The token has expired."
          }
        },
        {
          "status": 400,
          "code": "missing_artist_id",
          "description": {
            "ru": "Не передан ID исполнителя.",
            "en": "The artist ID is required."
          }
        },
        {
          "status": 404,
          "code": "artist_not_found",
          "description": {
            "ru": "Исполнитель не найден в вашем аккаунте.",
            "en": "The artist was not found in your account."
          }
        }
      ]
    },
    {
      "id": "maintenance",
      "group": "apps",
      "method": "GET",
      "path": "/api.app_maintenance.php",
      "title": {
        "ru": "Технические работы",
        "en": "Maintenance"
      },
      "summary": {
        "ru": "Состояние и расписание технических работ для приложения.",
        "en": "Maintenance status and schedule for the app."
      },
      "auth": "public",
      "run": true,
      "format": "none",
      "query": {},
      "body": {},
      "params": [],
      "response_kind": "json",
      "response": {
        "ok": true,
        "source": "cache",
        "schema_version": 1,
        "server_time": "2026-11-20T12:00:00+03:00",
        "timezone": "Europe/Moscow",
        "recommended_poll_seconds": 30,
        "maintenance_active": false,
        "show_notification": false,
        "active_maintenance": [],
        "upcoming_maintenance": [],
        "notifications": [],
        "count": 0,
        "items": []
      },
      "fields": [
        {
          "name": "maintenance_active",
          "type": "boolean | null",
          "description": {
            "ru": "Есть ли активные работы; null при недоступности данных.",
            "en": "Whether maintenance is active; null when data is unavailable."
          }
        },
        {
          "name": "show_notification",
          "type": "boolean | null",
          "description": {
            "ru": "Нужно ли показать уведомление.",
            "en": "Whether a notification should be shown."
          }
        },
        {
          "name": "items",
          "type": "array",
          "description": {
            "ru": "Расписание работ и состояния записей.",
            "en": "Maintenance schedule and item states."
          }
        },
        {
          "name": "server_time",
          "type": "string",
          "description": {
            "ru": "Время сервера в ISO 8601 с часовым поясом.",
            "en": "Server time in ISO 8601 with its time zone."
          }
        },
        {
          "name": "recommended_poll_seconds",
          "type": "integer",
          "description": {
            "ru": "Рекомендуемый интервал опроса в секундах.",
            "en": "Recommended polling interval in seconds."
          }
        }
      ],
      "notes": [
        {
          "ru": "Поддерживаются GET, HEAD и OPTIONS; рекомендуемый опрос — каждые 30 секунд.",
          "en": "GET, HEAD and OPTIONS are supported; recommended polling is every 30 seconds."
        },
        {
          "ru": "При ответе 503 не считайте null отсутствием работ.",
          "en": "For a 503 response, do not interpret null as no maintenance."
        }
      ],
      "errors": [
        {
          "status": 405,
          "code": "method_not_allowed",
          "description": {
            "ru": "Метод HTTP не поддерживается.",
            "en": "The HTTP method is not supported."
          }
        },
        {
          "status": 503,
          "code": "maintenance_cache_unavailable",
          "description": {
            "ru": "Расписание работ временно недоступно.",
            "en": "The maintenance schedule is temporarily unavailable."
          }
        }
      ]
    },
    {
      "id": "push-register",
      "group": "apps",
      "method": "POST",
      "path": "/api.push_devices.php",
      "title": {
        "ru": "Регистрация устройства",
        "en": "Register a device"
      },
      "summary": {
        "ru": "Зарегистрировать установку приложения или обновить её параметры.",
        "en": "Register an app installation or update its details."
      },
      "auth": "public",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "action": "register",
        "device_uuid": "DEVICE_UUID",
        "platform": "ios",
        "store": "app_store",
        "locale": "ru-RU",
        "push_timezone": "Europe/Moscow"
      },
      "params": [
        {
          "name": "action",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Действие регистрации в теле запроса.",
            "en": "Registration action in the request body."
          },
          "default": "register",
          "enum": [
            "register"
          ]
        },
        {
          "name": "device_uuid",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Стабильный UUID установки, до 191 символа.",
            "en": "Stable installation UUID, up to 191 characters."
          }
        },
        {
          "name": "platform",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Платформа устройства.",
            "en": "Device platform."
          },
          "enum": [
            "ios",
            "ipados",
            "macos",
            "watchos",
            "tvos",
            "visionos",
            "android_phone",
            "android_tablet",
            "android_tv",
            "android_auto",
            "android_desktop",
            "android_laptop"
          ]
        },
        {
          "name": "store",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Магазин установки, соответствующий платформе.",
            "en": "Installation store matching the platform."
          },
          "enum": [
            "app_store",
            "testflight",
            "google_play",
            "rustore",
            "huawei_appgallery",
            "samsung_galaxy_store",
            "apk",
            "unknown"
          ]
        },
        {
          "name": "device_name",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Название устройства, до 255 символов.",
            "en": "Device name, up to 255 characters."
          }
        },
        {
          "name": "app_version",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Версия приложения, до 50 символов.",
            "en": "App version, up to 50 characters."
          }
        },
        {
          "name": "os_version",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Версия ОС, до 50 символов.",
            "en": "OS version, up to 50 characters."
          }
        },
        {
          "name": "locale",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Локаль, до 20 символов; по умолчанию Accept-Language или en.",
            "en": "Locale, up to 20 characters; defaults to Accept-Language or en."
          }
        },
        {
          "name": "push_timezone",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Часовой пояс IANA, например Europe/Moscow.",
            "en": "IANA time zone, for example Europe/Moscow."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "push_timezone": "Europe/Moscow",
          "utc_offset_minutes": 180,
          "timezone_country_codes": [
            "RU"
          ],
          "status": "registered",
          "device_status": "inactive",
          "notifications_enabled": 0,
          "push_provider": null,
          "store": "app_store",
          "locale": "ru-RU"
        }
      },
      "fields": [
        {
          "name": "data.status",
          "type": "string",
          "description": {
            "ru": "Результат регистрации или изменения устройства.",
            "en": "Result of device registration or update."
          }
        },
        {
          "name": "data.device_status",
          "type": "string",
          "description": {
            "ru": "Текущее состояние устройства.",
            "en": "Current device state."
          }
        },
        {
          "name": "data.notifications_enabled",
          "type": "integer",
          "description": {
            "ru": "1 — уведомления разрешены; 0 — выключены.",
            "en": "1 enables notifications; 0 disables them."
          }
        },
        {
          "name": "data.push_provider",
          "type": "string | null",
          "description": {
            "ru": "Определённый сервером провайдер APNs или FCM.",
            "en": "APNs or FCM provider determined by the server."
          }
        },
        {
          "name": "data.push_timezone",
          "type": "string | null",
          "description": {
            "ru": "Сохранённый часовой пояс устройства.",
            "en": "Saved device time zone."
          }
        }
      ],
      "notes": [
        {
          "ru": "action передаётся в JSON-теле.",
          "en": "Pass action in the JSON body."
        },
        {
          "ru": "После регистрации передайте разрешение уведомлений через permission.",
          "en": "After registration, submit the notification permission using permission."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "device_uuid_required",
          "description": {
            "ru": "Не передан UUID устройства.",
            "en": "The device UUID is required."
          }
        },
        {
          "status": 400,
          "code": "invalid_platform",
          "description": {
            "ru": "Неподдерживаемая платформа.",
            "en": "Unsupported platform."
          }
        },
        {
          "status": 400,
          "code": "invalid_store",
          "description": {
            "ru": "Неподдерживаемый магазин приложений.",
            "en": "Unsupported app store."
          }
        },
        {
          "status": 400,
          "code": "invalid_store_for_platform",
          "description": {
            "ru": "Магазин не соответствует платформе.",
            "en": "The app store does not match the platform."
          }
        }
      ]
    },
    {
      "id": "push-permission",
      "group": "apps",
      "method": "POST",
      "path": "/api.push_devices.php",
      "title": {
        "ru": "Разрешение уведомлений",
        "en": "Notification permission"
      },
      "summary": {
        "ru": "Сохранить разрешение уведомлений и push-токен зарегистрированного устройства.",
        "en": "Save notification permission and the push token for a registered device."
      },
      "auth": "public",
      "run": false,
      "format": "json",
      "query": {},
      "body": {
        "action": "permission",
        "device_uuid": "DEVICE_UUID",
        "notifications_enabled": 1,
        "push_token": "PUSH_TOKEN",
        "locale": "ru-RU",
        "push_timezone": "Europe/Moscow"
      },
      "params": [
        {
          "name": "action",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Действие сохранения разрешения в теле запроса.",
            "en": "Permission action in the request body."
          },
          "enum": [
            "permission"
          ]
        },
        {
          "name": "device_uuid",
          "in": "body",
          "type": "string",
          "required": true,
          "description": {
            "ru": "Стабильный UUID установки, до 191 символа.",
            "en": "Stable installation UUID, up to 191 characters."
          }
        },
        {
          "name": "notifications_enabled",
          "in": "body",
          "type": "integer",
          "required": false,
          "description": {
            "ru": "Разрешение уведомлений.",
            "en": "Notification permission."
          },
          "default": 0,
          "enum": [
            0,
            1
          ]
        },
        {
          "name": "push_token",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Токен до 512 символов; обязателен при notifications_enabled=1.",
            "en": "Token up to 512 characters; required when notifications_enabled=1."
          }
        },
        {
          "name": "platform",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Платформа; по умолчанию сохранённое значение.",
            "en": "Platform; defaults to the saved value."
          },
          "enum": [
            "ios",
            "ipados",
            "macos",
            "watchos",
            "tvos",
            "visionos",
            "android_phone",
            "android_tablet",
            "android_tv",
            "android_auto",
            "android_desktop",
            "android_laptop"
          ]
        },
        {
          "name": "store",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Магазин установки, соответствующий платформе.",
            "en": "Installation store matching the platform."
          },
          "enum": [
            "app_store",
            "testflight",
            "google_play",
            "rustore",
            "huawei_appgallery",
            "samsung_galaxy_store",
            "apk",
            "unknown"
          ]
        },
        {
          "name": "device_name",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Название устройства, до 255 символов.",
            "en": "Device name, up to 255 characters."
          }
        },
        {
          "name": "app_version",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Версия приложения, до 50 символов.",
            "en": "App version, up to 50 characters."
          }
        },
        {
          "name": "os_version",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Версия ОС, до 50 символов.",
            "en": "OS version, up to 50 characters."
          }
        },
        {
          "name": "locale",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Локаль, до 20 символов; по умолчанию Accept-Language или en.",
            "en": "Locale, up to 20 characters; defaults to Accept-Language or en."
          }
        },
        {
          "name": "push_timezone",
          "in": "body",
          "type": "string",
          "required": false,
          "description": {
            "ru": "Часовой пояс IANA, например Europe/Moscow.",
            "en": "IANA time zone, for example Europe/Moscow."
          }
        }
      ],
      "response_kind": "json",
      "response": {
        "ok": true,
        "data": {
          "push_timezone": "Europe/Moscow",
          "utc_offset_minutes": 180,
          "timezone_country_codes": [
            "RU"
          ],
          "status": "permission_saved",
          "device_status": "active",
          "notifications_enabled": 1,
          "push_provider": "apns",
          "store": "app_store",
          "locale": "ru-RU"
        }
      },
      "fields": [
        {
          "name": "data.status",
          "type": "string",
          "description": {
            "ru": "Результат регистрации или изменения устройства.",
            "en": "Result of device registration or update."
          }
        },
        {
          "name": "data.device_status",
          "type": "string",
          "description": {
            "ru": "Текущее состояние устройства.",
            "en": "Current device state."
          }
        },
        {
          "name": "data.notifications_enabled",
          "type": "integer",
          "description": {
            "ru": "1 — уведомления разрешены; 0 — выключены.",
            "en": "1 enables notifications; 0 disables them."
          }
        },
        {
          "name": "data.push_provider",
          "type": "string | null",
          "description": {
            "ru": "Определённый сервером провайдер APNs или FCM.",
            "en": "APNs or FCM provider determined by the server."
          }
        },
        {
          "name": "data.push_timezone",
          "type": "string | null",
          "description": {
            "ru": "Сохранённый часовой пояс устройства.",
            "en": "Saved device time zone."
          }
        }
      ],
      "notes": [
        {
          "ru": "action передаётся в JSON-теле; устройство должно быть зарегистрировано.",
          "en": "Pass action in the JSON body; the device must already be registered."
        },
        {
          "ru": "При выключении уведомлений сохранённый push-токен очищается.",
          "en": "Disabling notifications clears the saved push token."
        },
        {
          "ru": "Провайдер определяется по платформе; push_provider не передаётся.",
          "en": "The provider is determined from the platform; do not send push_provider."
        }
      ],
      "errors": [
        {
          "status": 400,
          "code": "device_uuid_required",
          "description": {
            "ru": "Не передан UUID устройства.",
            "en": "The device UUID is required."
          }
        },
        {
          "status": 404,
          "code": "device_not_found",
          "description": {
            "ru": "Сначала зарегистрируйте устройство.",
            "en": "Register the device first."
          }
        },
        {
          "status": 400,
          "code": "invalid_platform",
          "description": {
            "ru": "Неподдерживаемая платформа.",
            "en": "Unsupported platform."
          }
        },
        {
          "status": 400,
          "code": "invalid_store",
          "description": {
            "ru": "Неподдерживаемый магазин приложений.",
            "en": "Unsupported app store."
          }
        },
        {
          "status": 400,
          "code": "invalid_store_for_platform",
          "description": {
            "ru": "Магазин не соответствует платформе.",
            "en": "The app store does not match the platform."
          }
        },
        {
          "status": 400,
          "code": "invalid_push_provider",
          "description": {
            "ru": "Не удалось определить push-провайдера.",
            "en": "The push provider could not be determined."
          }
        },
        {
          "status": 400,
          "code": "push_token_required",
          "description": {
            "ru": "Для уведомлений нужен push-токен.",
            "en": "A push token is required to enable notifications."
          }
        }
      ]
    }
  ]
}
