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

# Update Workflow API

> Rename a workflow and update its settings, such as the execution webhook. Settings are merged, so a rename never touches the webhook and a single header can be added or removed on its own.



## OpenAPI

````yaml PATCH /workflows/{workflow_id}
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /workflows/{workflow_id}:
    patch:
      description: >
        Renames a workflow and/or updates its `settings`, such as the execution
        webhook. `settings` is a

        JSON merge patch (RFC 7396) onto the stored settings: keys you omit are
        left unchanged and `null`

        removes one. So a rename never touches the webhook, `{"settings":
        {"webhook": {"headers": {"X-Old": null}}}}`

        drops one header while keeping the others, and `{"settings": {"webhook":
        null}}` stops sending

        webhooks. The definition itself is edited through the draft endpoints.
      parameters:
        - in: path
          name: workflow_id
          required: true
          schema:
            type: string
            format: uuid
          description: The unique `id` of the workflow
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowUpdateRequest'
        required: true
      responses:
        '200':
          description: Workflow updated. Header values in `settings` are returned masked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowWithSettings'
        '404':
          description: Workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
components:
  schemas:
    WorkflowUpdateRequest:
      type: object
      description: At least one field must be present. Fields you omit are left unchanged.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
          description: The new workflow name.
          example: Loan follow-up v2
        settings:
          type: object
          description: >
            A JSON merge patch (RFC 7396) onto the workflow's stored settings.
            Objects merge key by key, a

            key you omit is left unchanged, and `null` removes one. The merged
            result is validated as a

            whole, and unknown keys are rejected.
          properties:
            webhook:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/WorkflowWebhookSettingsInput'
          example:
            webhook:
              url: https://hooks.example.com/bolna/workflow
              headers:
                X-Api-Key: your-receiver-token
    WorkflowWithSettings:
      allOf:
        - $ref: '#/components/schemas/Workflow'
        - type: object
          properties:
            settings:
              $ref: '#/components/schemas/WorkflowSettings'
    WorkflowError:
      type: object
      description: >-
        Error envelope returned by every workflow endpoint. `detail.code` is a
        stable machine-readable code; extra keys (such as `current_revision` on
        `revision_conflict`, `execution_id` on `duplicate_run`, or `issues` on
        `invalid_definition`) ride alongside it.
      required:
        - detail
      properties:
        detail:
          type: object
          additionalProperties: true
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: revision_conflict
            message:
              type: string
              description: Human-readable explanation.
    WorkflowWebhookSettingsInput:
      type: object
      description: >
        Where every execution of this workflow sends its result when it
        finishes. Setting a URL turns the

        webhook on; `null` for the whole `webhook` object turns it off.
      properties:
        url:
          type: string
          format: uri
          description: >
            Must be `https` on port 443 or 8443, and its host must not be a
            private, loopback, link-local or

            carrier-NAT IP address. Redirects are not followed. Pointing it at a
            different host or port

            drops the stored `headers`, so send them again in the same request.
          example: https://hooks.example.com/bolna/workflow
        headers:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: >
            Headers sent with every webhook, typically an authentication token.
            Names must be unique

            ignoring case; names beginning `x-internal` are reserved, as are
            `Host`, `Content-Length`,

            `Transfer-Encoding` and `Connection`. Set one header to `null` to
            remove just that header.

            Reads return every value as `**********`, and sending that mask back
            is rejected — omit a

            header to keep its current value.
          example:
            X-Api-Key: your-receiver-token
    Workflow:
      type: object
      required:
        - id
        - name
        - status
      properties:
        id:
          type: string
          format: uuid
          description: Unique workflow id.
        name:
          type: string
          description: Display name.
        status:
          type: string
          enum:
            - active
            - archived
          description: Workflow status.
        latest_published_version:
          type: integer
          nullable: true
          description: >-
            Number of the newest published version, or `null` if nothing is
            published yet.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    WorkflowSettings:
      type: object
      description: >-
        The workflow's live settings. Header values are always returned as
        `**********`.
      properties:
        webhook:
          nullable: true
          description: The execution webhook, or `null` when none is set.
          type: object
          properties:
            url:
              type: string
              description: The configured destination.
              example: https://hooks.example.com/bolna/workflow
            headers:
              type: object
              additionalProperties:
                type: string
              description: The configured header names, each with its value masked.
              example:
                X-Api-Key: '**********'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````