AppsMax Applications API

Заявки и их теги.

OpenAPI Specification

appsmax-rest-api-v1-applications-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AppsMax REST Applications API
  version: 1.1.1
  description: Публичный server-to-server контракт REST API AppsMax v1. Это API платформы AppsMax, а не официальный API MAX или Telegram. Все ответы API имеют JSON-формат, X-Request-Id и запрет кеширования. Проверено по production-маршрутам, валидации и synthetic acceptance 2026-08-09.
  contact:
    name: AppsMax
    url: https://appsmax.ru/contacts/
    email: info@appsmax.ru
  license:
    name: AppsMax API Terms
    url: https://appsmax.ru/documents/
servers:
- url: https://telegram.appsmax.ru/api/v1
  description: Production API v1
security:
- bearerAuth: []
- apiTokenHeader: []
tags:
- name: Applications
  description: Заявки и их теги.
paths:
  /applications:
    get:
      operationId: listApplications
      tags:
      - Applications
      summary: Получить заявки
      x-required-scope: applications:read
      parameters:
      - $ref: '#/components/parameters/BotIdQuery'
      - $ref: '#/components/parameters/StatusArray'
      - $ref: '#/components/parameters/SourceArray'
      - $ref: '#/components/parameters/CreatedFrom'
      - $ref: '#/components/parameters/CreatedTo'
      - $ref: '#/components/parameters/Tag'
      - $ref: '#/components/parameters/PerPage100'
      - name: sort
        in: query
        schema:
          type: string
          enum:
          - created_at
          - submitted_at
          default: created_at
      - $ref: '#/components/parameters/Direction'
      - $ref: '#/components/parameters/Page'
      responses:
        '200':
          $ref: '#/components/responses/Applications'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
    post:
      operationId: createApplication
      tags:
      - Applications
      summary: Создать заявку
      description: bot_id обязателен. Верхнеуровневое поле status не поддерживается; AppsMax назначает новой заявке начальный статус.
      x-required-scope: applications:write
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationCreateRequest'
      responses:
        '200':
          $ref: '#/components/responses/ApplicationReplay'
        '201':
          $ref: '#/components/responses/ApplicationCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
  /applications/{id}:
    get:
      operationId: getApplication
      tags:
      - Applications
      summary: Получить заявку
      x-required-scope: applications:read
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          $ref: '#/components/responses/Application'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
  /applications/{application}/tags:
    post:
      operationId: syncApplicationTags
      tags:
      - Applications
      summary: Синхронизировать теги заявки
      x-required-scope: applications:write
      parameters:
      - $ref: '#/components/parameters/ApplicationPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationTagsRequest'
      responses:
        '200':
          $ref: '#/components/responses/Application'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    Application:
      type: object
      required:
      - id
      - bot_id
      - organization_id
      - source
      - status
      - contact
      - answers
      - tags
      properties:
        id:
          type: integer
        bot_id:
          type: integer
        organization_id:
          type: integer
        number:
          type:
          - integer
          - 'null'
        source:
          type: string
        source_label:
          type:
          - string
          - 'null'
        status:
          type: string
        status_label:
          type:
          - string
          - 'null'
        submitted_at:
          type:
          - string
          - 'null'
          format: date-time
        created_at:
          type:
          - string
          - 'null'
          format: date-time
        contact:
          type: object
          additionalProperties: true
        answers:
          type: object
          additionalProperties: true
        form_meta:
          type: object
          additionalProperties: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ApplicationTag'
    ResourceEnvelope:
      type: object
      required:
      - data
      properties:
        data:
          type: object
          additionalProperties: true
    ApiError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          - meta
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
            meta:
              type: object
              required:
              - request_id
              properties:
                request_id:
                  type: string
                  description: Идентификатор запроса для обращения в поддержку.
              additionalProperties: true
    ApplicationCollection:
      allOf:
      - $ref: '#/components/schemas/CollectionEnvelope'
      - type: object
        properties:
          data:
            type: array
            items:
              $ref: '#/components/schemas/Application'
    ApplicationResponse:
      allOf:
      - $ref: '#/components/schemas/ResourceEnvelope'
      - type: object
        properties:
          data:
            $ref: '#/components/schemas/Application'
    ApplicationTag:
      type: object
      required:
      - id
      - name
      - slug
      properties:
        id:
          type: integer
        name:
          type: string
        slug:
          type: string
    ApplicationTagsRequest:
      type: object
      required:
      - tags
      additionalProperties: false
      properties:
        tags:
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: string
            minLength: 1
            maxLength: 64
            pattern: ^[\p{L}\p{M}\p{N} _-]+$
    CollectionEnvelope:
      type: object
      required:
      - data
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: true
        links:
          type: object
          additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    ApplicationCreateRequest:
      type: object
      required:
      - bot_id
      additionalProperties: false
      properties:
        bot_id:
          type: integer
          minimum: 1
        source:
          type:
          - string
          - 'null'
          enum:
          - funnel
          - miniapp
          - communications
          - interactive_menu
          - rest_api
          - gigachat
          - community
          description: Поддерживаемый источник AppsMax; при отсутствии используется rest_api.
        title:
          type:
          - string
          - 'null'
          maxLength: 255
        contact:
          type:
          - object
          - 'null'
          additionalProperties: false
          properties:
            name:
              type:
              - string
              - 'null'
              maxLength: 255
            phone:
              type:
              - string
              - 'null'
              maxLength: 255
            email:
              type:
              - string
              - 'null'
              format: email
              maxLength: 255
        channel:
          type:
          - string
          - 'null'
          maxLength: 191
        payload:
          type:
          - object
          - 'null'
          additionalProperties: true
          maxProperties: 100
  parameters:
    PerPage100:
      name: per_page
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
    IdPath:
      name: id
      in: path
      required: true
      schema:
        type: integer
        minimum: 1
    Direction:
      name: direction
      in: query
      schema:
        type: string
        enum:
        - asc
        - desc
        default: desc
    Tag:
      name: tag
      in: query
      schema:
        type: string
        maxLength: 80
    CreatedTo:
      name: created_to
      in: query
      schema:
        type: string
        format: date
    BotIdQuery:
      name: bot_id
      in: query
      schema:
        type: integer
        minimum: 1
    SourceArray:
      name: source[]
      in: query
      style: form
      explode: true
      schema:
        type: array
        items:
          type: string
    CreatedFrom:
      name: created_from
      in: query
      schema:
        type: string
        format: date
    ApplicationPath:
      name: application
      in: path
      required: true
      schema:
        type: integer
        minimum: 1
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: 'Уникальный ключ повтора для безопасного retry. Один ключ нельзя использовать с другим телом запроса. Допустимы 1–128 символов: A-Z, a-z, 0-9, точка, подчёркивание, двоеточие и дефис.'
      schema:
        type: string
        minLength: 1
        maxLength: 128
        pattern: ^[A-Za-z0-9._:-]+$
    StatusArray:
      name: status[]
      in: query
      style: form
      explode: true
      schema:
        type: array
        items:
          type: string
    Page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
  responses:
    ServerError:
      description: Непредвиденная ошибка. Передайте X-Request-Id в поддержку AppsMax.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Токен отсутствует, недействителен или отозван.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    UnsupportedMediaType:
      description: 'Для запроса с телом требуется Content-Type: application/json.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Conflict:
      description: Idempotency-Key уже использован с другим запросом.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ValidationFailed:
      description: Поля запроса не прошли валидацию.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    BadRequest:
      description: Повреждённый JSON или синтаксически неверный запрос.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Applications:
      description: Пагинируемая коллекция заявок.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApplicationCollection'
    ApplicationCreated:
      description: Заявка создана.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
        Idempotency-Replayed:
          $ref: '#/components/headers/IdempotencyReplayed'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApplicationResponse'
    Forbidden:
      description: Нет нужного scope или доступа к организации.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: Превышен rate limit токена или операции.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    PayloadTooLarge:
      description: Тело запроса превышает допустимый размер.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Ресурс не найден в доступном контуре.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Application:
      description: Заявка.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApplicationResponse'
    ApplicationReplay:
      description: Повтор ранее выполненного создания заявки.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-Api-Version:
          $ref: '#/components/headers/ApiVersion'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
        Idempotency-Replayed:
          $ref: '#/components/headers/IdempotencyReplayed'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApplicationResponse'
  headers:
    RequestId:
      description: Идентификатор запроса. При корректном входящем X-Request-Id AppsMax возвращает его без изменения.
      schema:
        type: string
    RateLimitRemaining:
      description: Оставшееся число запросов в текущем окне.
      schema:
        type: integer
    RetryAfter:
      description: Число секунд до повторной попытки.
      schema:
        type: integer
    IdempotencyReplayed:
      description: true, если возвращён результат ранее выполненного запроса; false при первоначальном создании.
      schema:
        type: string
        enum:
        - 'true'
        - 'false'
    ApiVersion:
      description: Фактическая версия API.
      schema:
        type: string
        example: v1
    RateLimitLimit:
      description: Лимит запросов в текущем окне.
      schema:
        type: integer
    CacheControl:
      description: Ответы API не должны кешироваться.
      schema:
        type: string
        example: no-store, private
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: AppsMax API token
      description: 'Рекомендуемый вариант: Authorization: Bearer YOUR_API_TOKEN'
    apiTokenHeader:
      type: apiKey
      in: header
      name: X-Api-Token
      description: Fallback для клиентов без Bearer auth. Не передавайте токен в URL.
externalDocs:
  description: Документация и ограничения
  url: https://appsmax.ru/developers/
x-appsmax-verified-at: '2026-08-09'
x-appsmax-default-rate-limit-per-minute: 60
x-appsmax-public-sdk: false
x-appsmax-webhooks-covered: false