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

# Create cancel



## OpenAPI

````yaml /openapi/assistant.json post /v1/assistant/runs/{run_id}/cancel/
openapi: 3.0.3
info:
  title: Yume API — AI Ассистент
  version: 1.0.0
  description: SSE чат-шлюз и инструменты ассистента.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/assistant/runs/{run_id}/cancel/:
    post:
      tags:
        - runs
      summary: Create cancel
      operationId: runs_cancel_create
      parameters:
        - in: path
          name: run_id
          schema:
            type: string
            format: uuid
          required: true
        - $ref: '#/components/parameters/TenantId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    Run:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        run_id:
          type: string
          readOnly: true
        session_id:
          type: string
          readOnly: true
        state:
          allOf:
            - $ref: '#/components/schemas/StateEnum'
          readOnly: true
        reason:
          allOf:
            - $ref: '#/components/schemas/ReasonEnum'
          readOnly: true
        source:
          allOf:
            - $ref: '#/components/schemas/SourceEnum'
          readOnly: true
        input:
          type: integer
          readOnly: true
        output:
          type: integer
          readOnly: true
        cache_write:
          type: integer
          readOnly: true
        cache_read:
          type: integer
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        started_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        finished_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - cache_read
        - cache_write
        - created_at
        - finished_at
        - id
        - input
        - output
        - reason
        - run_id
        - session_id
        - source
        - started_at
        - state
    StateEnum:
      enum:
        - queued
        - running
        - completed
        - cancelled
        - failed
        - awaiting_approval
      type: string
      description: |-
        * `queued` - В очереди
        * `running` - Выполняется
        * `completed` - Завершено
        * `cancelled` - Отменено
        * `failed` - Ошибка
        * `awaiting_approval` - Ждёт подтверждения
    ReasonEnum:
      enum:
        - approval
        - cancelled
        - quota
        - error
        - tenant_unresolved
        - worker_lost
      type: string
      description: |-
        * `approval` - ожидает подтверждения пользователя
        * `cancelled` - Отменён пользователем
        * `quota` - Исчерпан лимит
        * `error` - Ошибка выполнения
        * `tenant_unresolved` - Компания не определена
        * `worker_lost` - Воркер не отвечает
    SourceEnum:
      enum:
        - web
        - channel
      type: string
      description: |-
        * `web` - Веб
        * `channel` - Внешний канал
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````