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

# Обновить кнопку шага

> Заменяет поля кнопки. Сохраняются все поля, поэтому передавайте кнопку целиком. Возвращает обновлённый шаг.



## OpenAPI

````yaml PATCH /api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}
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}/funnels/{product}/steps/{step}/buttons/{button}:
    patch:
      tags:
        - Funnels
      summary: Update step button
      description: >-
        Replaces the button's fields. All fields are saved, so pass the full
        button. Returns the updated step.
      operationId: updateFunnelStepButton
      parameters:
        - name: bot
          in: path
          required: true
          description: Bot ID
          schema:
            type: integer
        - name: product
          in: path
          required: true
          description: Funnel ID
          schema:
            type: integer
        - name: step
          in: path
          required: true
          description: Step ID
          schema:
            type: integer
        - name: button
          in: path
          required: true
          description: Button ID
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StepButtonInput'
      responses:
        '200':
          description: Step
          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
            direct_link:
              type: boolean
            tags:
              type: array
              items:
                type: string
                maxLength: 255
            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'
    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:
          type: object
        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.