> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.erlcrussia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Выполнение Команды на Сервере

> Отправляет команду на выполнение на сервер ER:LC.


Команды добавляются в глобальную очередь с ограничением на максимальное
количество команд.


**Примечание:** Этот эндпоинт **не подвержен** Rate Limiting (120 запросов/мин).




## OpenAPI

````yaml ru/openapi/ru-erlc-v2-openapi.yaml POST /erlc/server/command
openapi: 3.1.0
info:
  title: ER:LC Россия API V2 - Moscow RolePlay API ER:LC V2
  version: 2.0.0
servers:
  - url: https://api.erlcrussia.xyz/v2
    description: Moscow RolePlay API ER:LC V2
security: []
tags:
  - name: Moscow RolePlay API ER:LC V2
    description: Данные игрового сервера ER:LC v2 API и управление им.
paths:
  /erlc/server/command:
    post:
      tags:
        - Moscow RolePlay API ER:LC V2
      summary: Выполнение Команды на Сервере
      description: >
        Отправляет команду на выполнение на сервер ER:LC.



        Команды добавляются в глобальную очередь с ограничением на максимальное

        количество команд.



        **Примечание:** Этот эндпоинт **не подвержен** Rate Limiting (120
        запросов/мин).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - command
              properties:
                command:
                  type: string
                  description: Команда для выполнения на сервере.
                  example: ':h Всем Привет'
      responses:
        '200':
          description: Команда успешно добавлена в очередь.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    description: Статус команды.
                    example: Queued
                  QueueSize:
                    type: integer
                    description: Текущий размер очереди команд.
                    example: 5
              examples:
                Success:
                  summary: Команда добавлена в очередь.
                  value:
                    Status: Queued
                    QueueSize: 5
        '400':
          description: Ошибка запроса (отсутствует команда).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MissingCommandError'
              examples:
                Missing Command:
                  summary: Отсутствует поле command.
                  value:
                    code: 5005
                    message: Missing Command
        '401':
          $ref: '#/components/responses/UnauthorizedMissingOrInvalidToken'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          description: Очередь команд заполнена.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandQueueFullError'
              examples:
                Command Queue Full:
                  summary: Очередь команд заполнена.
                  value:
                    code: 5015
                    message: Command Queue Full
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - MRPAPIKey: []
components:
  schemas:
    MissingCommandError:
      type: object
      description: Ошибка при отсутствии команды в запросе.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5005
        message:
          type: string
          example: Missing Command
    CommandQueueFullError:
      type: object
      description: >-
        Ошибка при заполненной очереди команд. Возвращается при попытке
        отправить команду, когда очередь заполнена.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5015
        message:
          type: string
          example: Command Queue Full
    UnauthorizedError:
      type: object
      description: Ошибка аутентификации (отсутствует или неверный токен).
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5007
        message:
          type: string
          example: Missing Token
    ForbiddenError:
      type: object
      description: Ошибка доступа (запрещено).
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5009
        message:
          type: string
          example: Forbidden
    ErrorResponse:
      type: object
      description: Стандартный формат ошибки.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Код ошибки API.
          example: 5007
        message:
          type: string
          description: Сообщение/идентификатор ошибки.
          example: Missing Token
  responses:
    UnauthorizedMissingOrInvalidToken:
      description: Ошибка аутентификации.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
          examples:
            Missing Token:
              summary: Нет токена.
              value:
                code: 5007
                message: Missing Token
            Invalid Token:
              summary: Неверный или деактивированный токен.
              value:
                code: 5008
                message: Invalid Token
            Invalid Master Key:
              summary: Неверный мастер-ключ.
              value:
                code: 5006
                message: Invalid Master Key
    Forbidden:
      description: Доступ запрещён.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenError'
          examples:
            Forbidden:
              summary: Нет прав доступа к эндпоинту.
              value:
                code: 5009
                message: Forbidden
            Api Version Forbidden:
              summary: Доступ к этой версии API запрещён.
              value:
                code: 5010
                message: Api Version Forbidden
            Query Param Forbidden:
              summary: Query-параметр запрещён.
              value:
                code: 5011
                message: Query Param Forbidden
    InternalServerError:
      description: Внутренняя ошибка сервера.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Server Error:
              summary: Ошибка внешнего ER:LC API.
              value:
                code: 5018
                message: Server Error
  securitySchemes:
    MRPAPIKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Стандартный API ключ для доступа к ER:LC эндпоинтам.

        Передается в заголовке `Authorization: Bearer <ключ>`.

        ОБЯЗАТЕЛЕН ДЛЯ ВСЕХ ER:LC ЭНДПОИНТОВ.

````