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

# Создать кнопку шага

> Добавляет inline-кнопку в конец списка кнопок шага. Возвращает обновлённый шаг. Кнопки-ссылки по умолчанию работают «С учётом кликов». Для прямого перехода укажите settings.link_mode=direct: теги сохраняются, но не присваиваются, а события кликов для автоматизаций не возникают. Автоматизации «Не кликнули» остаются активными. Защита от копирования недоступна для ссылок Telegram (422).



## OpenAPI

````yaml POST /api/v1/bot/{bot}/products/{product}/steps/{step}/buttons
openapi: 3.1.0
info:
  title: Zenedu API v1
  description: >-
    API for managing Telegram bots, subscribers, products, funnels, offers, and
    orders on the Zenedu platform.
  version: 1.0.0
servers:
  - url: https://app.zenedu.io
security:
  - bearerAuth: []
tags:
  - name: User
    description: Current user profile
  - name: Bots
    description: Bot management
  - name: Subscribers
    description: Subscriber management
  - name: Orders
    description: Order management
  - name: Products
    description: Product management
  - name: Funnels
    description: Funnel management
  - name: Offers
    description: Offer management
  - name: Links
    description: Link generation
  - name: Files
    description: File downloads
  - name: Zapier
    description: Zapier webhook management
  - name: Webhooks
    description: Account webhook subscriptions
  - name: Payment systems
    description: Account payment methods
  - name: Bot settings
    description: 'Bot configuration: email, branding, integrations, legal documents'
  - name: Commands
    description: Bot menu commands
  - name: Custom fields
    description: Subscriber custom fields
  - name: Folders
    description: Folders for products, funnels, channels and groups
  - name: Slugs
    description: Public link slugs
  - name: Funnel links
    description: Subscription links of a funnel
  - name: Coupons
    description: Coupon management
  - name: Subscriptions
    description: Recurring subscription management
  - name: Tasks
    description: Student task review
  - name: Broadcasts
    description: Broadcast messages
  - name: Automations
    description: Event-based automations
  - name: Affiliate
    description: Affiliate program management
  - name: Shop
    description: Bot shop draft and publication
  - name: Channels
    description: Telegram channels connected to the bot
  - name: Groups
    description: Telegram groups connected to the bot
  - name: Mini-app
    description: Telegram mini app configuration
  - name: Web
    description: Web app configuration
  - name: Telegram files
    description: Telegram file attachments for steps and broadcasts
paths:
  /api/v1/bot/{bot}/products/{product}/steps/{step}/buttons:
    post:
      tags:
        - Products
      summary: Create step button
      description: >-
        Adds an inline button to the end of the step's button list. Returns the
        updated step. Link buttons use With click tracking by default. Set
        settings.link_mode to direct for a direct link, or tracked to return to
        click tracking. Selected tags are retained in direct mode but are not
        applied; direct links do not produce click events for click automations.
        Button-not-clicked automations remain active. Protect from copying
        (settings.web_app) is unavailable for t.me, telegram.me and tg://
        destinations (422).
      operationId: createProductStepButton
      parameters:
        - name: bot
          in: path
          required: true
          description: Bot ID
          schema:
            type: integer
        - name: product
          in: path
          required: true
          description: Product ID
          schema:
            type: integer
        - name: step
          in: path
          required: true
          description: Step ID
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StepButtonInput'
      responses:
        '201':
          description: Step with the new button
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Step'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden — lacks access to this bot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    StepButtonInput:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - link
            - task
            - action
            - offer
            - affiliate
            - app
        name:
          type: string
          maxLength: 250
        link:
          type:
            - string
            - 'null'
          maxLength: 250
          description: Required when type is link; https or tg URL
        offer_id:
          type:
            - integer
            - 'null'
          description: Required when type is offer
        actions:
          type: array
          description: Required when type is action
          items:
            type: object
            required:
              - name
            properties:
              name:
                type: string
                enum:
                  - send_next_step
                  - send_any_step
                  - send_text
                  - call_command
                  - add_to_offer
                  - add_to_funnel
                  - remove_from_funnel
                  - add_tag
                  - remove_tag
                  - delete_step
              settings:
                type: object
                description: >-
                  Action parameters, for example step, text, call_command,
                  offer, funnel_add, funnel_remove, tags
        settings:
          type: object
          properties:
            style:
              type:
                - string
                - 'null'
              enum:
                - ''
                - primary
                - success
                - danger
                - null
            web_app:
              type: boolean
              description: >-
                Protect from copying: opens a website as a Telegram Web App to
                make copying the link harder. Available with either link mode.
                Cannot be enabled for t.me, telegram.me or tg:// destinations;
                the API returns 422.
            link_mode:
              type: string
              enum:
                - direct
                - tracked
              default: tracked
              description: >-
                Applies to link buttons. tracked (With click tracking) routes
                through Zenedu to record clicks, apply selected tags and trigger
                click automations. direct (Direct link) opens the destination
                directly, without recording clicks or applying tags. Recommended
                for links to Telegram channels, chats and bots. Direct links do
                not produce click events, but do not disable or delete
                automation settings. Button-not-clicked automations remain
                active and may run even when a subscriber follows a direct link.
                Routing is determined only by this mode, never by the
                destination or automation conditions. The tracked default is
                omitted from saved settings; only direct is stored.
            tags:
              type: array
              items:
                type: string
                maxLength: 255
              description: >-
                Tag names assigned to the subscriber when following a tracked
                link. Selections are retained in direct mode but are not
                assigned when following a direct link. A Telegram link click
                does not confirm that the subscriber joined a channel or group.
            task_message:
              type:
                - string
                - 'null'
            task_send_task_button_message:
              type:
                - string
                - 'null'
            task_add_more_button_label:
              type:
                - string
                - 'null'
            task_cancel_button_label:
              type:
                - string
                - 'null'
            task_cancel_button_message:
              type:
                - string
                - 'null'
            send_task_second_time_error:
              type:
                - string
                - 'null'
          description: >-
            Button settings. For link buttons, an absent link_mode means
            tracked. When replacing a button, send all settings you want to
            retain; omitted settings are reset.
    Step:
      type: object
      properties:
        id:
          type: integer
        product_id:
          type: integer
        section_id:
          type:
            - integer
            - 'null'
        type:
          type: string
          enum:
            - message
            - lesson
            - task
            - question
            - poll
            - quiz
        name:
          type: string
        text:
          type:
            - string
            - 'null'
        active:
          type: boolean
        sort:
          type: integer
        link_preview:
          type: boolean
        task_autocheck:
          type: boolean
        custom_field_id:
          type:
            - integer
            - 'null'
        sending_time:
          type: object
          properties:
            option:
              type: string
              enum:
                - immediately
                - duration
                - date
                - time
                - never
                - stop
              description: >-
                Sending mode. duration requires delay_number and delay_type,
                date requires delay_at, time requires delay_time
            delay_number:
              type:
                - integer
                - 'null'
              description: Delay amount, min 0
            delay_type:
              type:
                - string
                - 'null'
              enum:
                - seconds
                - minutes
                - hours
                - days
                - null
            delay_at:
              type:
                - string
                - 'null'
              format: date-time
              description: Exact send date, used with option=date
            skip_past_date:
              type: boolean
              description: Skip sending if the date has already passed
            delay_time:
              type:
                - string
                - 'null'
              format: date-time
              description: Time of day, used with option=time
            delay_limit:
              type:
                - object
                - 'null'
              description: Allowed sending window
              properties:
                time_from:
                  type: integer
                  minimum: 0
                  maximum: 1439
                  description: Window start, minutes from midnight
                time_to:
                  type: integer
                  minimum: 0
                  maximum: 1439
                  description: Window end, minutes from midnight
                weekdays:
                  type: array
                  minItems: 1
                  items:
                    type: string
                    enum:
                      - mon
                      - tue
                      - wed
                      - thu
                      - fri
                      - sat
                      - sun
        menu_time:
          oneOf:
            - $ref: '#/components/schemas/StepMenuTime'
            - type: 'null'
        settings:
          type: object
          properties:
            attach_file:
              type: boolean
            has_spoiler:
              type: boolean
            attach_style:
              type:
                - string
                - 'null'
            autodelete:
              type: integer
              description: Seconds
            protect_content:
              type: boolean
            save_profile:
              type: boolean
            subtype:
              type:
                - string
                - 'null'
            question_error_message:
              type:
                - string
                - 'null'
            quiz_explanation:
              type:
                - string
                - 'null'
        cover_url:
          type:
            - string
            - 'null'
        attachments:
          type: array
          description: Read-only, uploaded via the bot in Telegram
          items:
            type: object
            properties:
              id:
                type: integer
              type:
                type:
                  - string
                  - 'null'
              name:
                type:
                  - string
                  - 'null'
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/StepButton'
        options:
          type: array
          description: Present only for poll and quiz steps
          items:
            type: object
            properties:
              id:
                type: integer
              text:
                type: string
              is_correct:
                type: boolean
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors keyed by field name
    StepMenuTime:
      type: object
      required:
        - type
      description: When the step becomes available in the bot menu
      properties:
        type:
          type: string
          enum:
            - immediately
            - sending
            - never
            - duration
            - date
            - time
          description: >-
            duration requires delay_number and delay_type, date requires
            delay_at, time requires delay_number and delay_time
        delay_number:
          type:
            - integer
            - 'null'
          description: Delay amount, min 0
        delay_type:
          type:
            - string
            - 'null'
          enum:
            - seconds
            - minutes
            - hours
            - days
            - null
        delay_at:
          type:
            - string
            - 'null'
          format: date-time
        delay_time:
          type:
            - string
            - 'null'
          format: date-time
    StepButton:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum:
            - link
            - task
            - offer
            - app
            - affiliate
            - action
        name:
          type: string
        link:
          type:
            - string
            - 'null'
        offer_id:
          type:
            - integer
            - 'null'
        actions:
          type: array
          items:
            type: object
        settings:
          description: >-
            Stored button settings. For link buttons, an absent link_mode means
            tracked; only the direct override is stored. Empty settings are
            returned as [].
          oneOf:
            - type: object
              properties:
                link_mode:
                  type: string
                  enum:
                    - direct
                    - tracked
                  description: >-
                    For link buttons, direct is the saved override. An absent
                    field means tracked; the tracked default is omitted from
                    saved link-button settings.
            - type: array
              maxItems: 0
        sort:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from the Zenedu dashboard

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.