> ## 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 triggers



## OpenAPI

````yaml /openapi/sales.json post /v1/sales/funnels/triggers/
openapi: 3.0.3
info:
  title: Yume API — Продажи
  version: 1.0.0
  description: Касса и управление продажами.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/sales/funnels/triggers/:
    post:
      tags:
        - funnels
      summary: Create triggers
      operationId: funnels_triggers_create
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunnelTrigger'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FunnelTrigger'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FunnelTrigger'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunnelTrigger'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    FunnelTrigger:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        create_leads:
          type: boolean
          writeOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Обновлен
        action:
          allOf:
            - $ref: '#/components/schemas/FunnelTriggerActionEnum'
          minimum: -32768
          maximum: 32767
        order:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        message:
          type: string
          nullable: true
        message_source:
          nullable: true
          minimum: -32768
          maximum: 32767
          oneOf:
            - $ref: '#/components/schemas/MessageSourceEnum'
            - $ref: '#/components/schemas/NullEnum'
        task_deadline:
          type: string
          nullable: true
        task_description:
          type: string
          nullable: true
        order_status:
          nullable: true
          minimum: -32768
          maximum: 32767
          oneOf:
            - $ref: '#/components/schemas/OrderStatusEnum'
            - $ref: '#/components/schemas/NullEnum'
        order_source:
          nullable: true
          minimum: -32768
          maximum: 32767
          oneOf:
            - $ref: '#/components/schemas/OrderSourceEnum'
            - $ref: '#/components/schemas/NullEnum'
        webhook_url:
          type: string
          format: uri
          nullable: true
          maxLength: 200
        webhook_method:
          nullable: true
          minimum: -32768
          maximum: 32767
          oneOf:
            - $ref: '#/components/schemas/WebhookMethodEnum'
            - $ref: '#/components/schemas/NullEnum'
        slot:
          type: integer
          maximum: 2147483647
          minimum: 0
        index:
          type: integer
          maximum: 2147483647
          minimum: 0
        tenant:
          type: integer
        task_type:
          type: integer
          nullable: true
          title: Тип задачи
        funnel:
          type: integer
          nullable: true
        stages:
          type: array
          items:
            type: integer
      required:
        - action
        - created_at
        - id
        - stages
        - updated_at
    FunnelTriggerActionEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
      type: integer
      description: |-
        * `0` - Отправить сообщение
        * `1` - Создать задачу
        * `2` - Статус аренды
        * `3` - Воронка
        * `4` - Создать аренду
        * `5` - Источник аренды
        * `6` - Документ
        * `7` - Вебхук
    MessageSourceEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - SMS
        * `1` - Wazzup
    NullEnum:
      enum:
        - null
    OrderStatusEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
      type: integer
      description: |-
        * `0` - Запрос
        * `1` - Забронировано
        * `2` - В аренде
        * `3` - Отменено
        * `4` - Завершено
        * `5` - Должник
        * `6` - Просрочка
    OrderSourceEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
      type: integer
      description: |-
        * `0` - Запрос
        * `1` - Забронировано
        * `2` - В аренде
        * `3` - Отменено
        * `4` - Завершено
        * `5` - Должник
        * `6` - Просрочка
    WebhookMethodEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: |-
        * `0` - post
        * `1` - get
        * `2` - put
        * `3` - patch
        * `4` - удалить
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````