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

# Update Form

> Update an existing form by ID.



## OpenAPI

````yaml PATCH /forms/{id}
openapi: 3.1.0
info:
  title: FormBnB API
  version: 1.0.0
  description: API for FormBnB - Form backend as a service
servers:
  - url: https://api.formbnb.com
security: []
paths:
  /forms/{id}:
    patch:
      tags:
        - Forms
      summary: Update a form
      description: Update an existing form by ID.
      parameters:
        - schema:
            type: string
            description: Form ID
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFormRequest'
      responses:
        '200':
          description: Updated form
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Form'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Form not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateFormRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Form name
        description:
          type: string
          nullable: true
          maxLength: 500
          description: Form description
        is_active:
          type: boolean
          description: Whether the form is active
        email_notifications:
          type: boolean
          description: Enable email notifications
        notification_email:
          type: string
          nullable: true
          format: email
          description: Primary notification email
        notification_emails:
          type: array
          items:
            type: string
            format: email
          description: Additional notification emails
        redirect_url:
          type: string
          nullable: true
          format: uri
          description: URL to redirect after submission
        allowed_domains:
          type: array
          items:
            type: string
          description: Allowed domains for form submission
        webhook_enabled:
          type: boolean
          description: Enable webhook notifications
        webhook_url:
          type: string
          nullable: true
          format: uri
          description: Webhook URL
        webhook_secret:
          type: string
          nullable: true
          description: Webhook secret for verification
        custom_email_subject:
          type: string
          nullable: true
          description: Custom email subject
        custom_email_template:
          type: string
          nullable: true
          description: Custom email template
        auto_responder_enabled:
          type: boolean
          description: Enable auto-responder
        auto_responder_subject:
          type: string
          nullable: true
          description: Auto-responder subject
        auto_responder_body:
          type: string
          nullable: true
          description: Auto-responder body
        auto_responder_from_name:
          type: string
          nullable: true
          description: Auto-responder from name
        auto_responder_include_data:
          type: boolean
          description: Include submission data in auto-responder
        slack_enabled:
          type: boolean
          description: Enable Slack integration
        slack_webhook_url:
          type: string
          nullable: true
          description: Slack webhook URL
        slack_channel_id:
          type: string
          nullable: true
          description: Slack channel ID
        slack_channel_name:
          type: string
          nullable: true
          description: Slack channel name
        slack_notifications_enabled:
          type: boolean
          description: Enable Slack notifications
        discord_enabled:
          type: boolean
          description: Enable Discord integration
        discord_webhook_url:
          type: string
          nullable: true
          description: Discord webhook URL
        google_sheets_enabled:
          type: boolean
          description: Enable Google Sheets integration
        google_sheets_url:
          type: string
          nullable: true
          description: Google Sheets URL
        telegram_enabled:
          type: boolean
          description: Enable Telegram integration
        telegram_bot_token:
          type: string
          nullable: true
          description: Telegram bot token
        telegram_chat_id:
          type: string
          nullable: true
          description: Telegram chat ID
    Form:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          nullable: true
        is_active:
          type: boolean
        user_id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        email_notifications:
          type: boolean
        notification_email:
          type: string
          nullable: true
        notification_emails:
          type: array
          nullable: true
          items:
            type: string
        redirect_url:
          type: string
          nullable: true
        allowed_domains:
          type: array
          nullable: true
          items:
            type: string
        webhook_enabled:
          type: boolean
        webhook_url:
          type: string
          nullable: true
        webhook_secret:
          type: string
          nullable: true
        custom_email_subject:
          type: string
          nullable: true
        custom_email_template:
          type: string
          nullable: true
        auto_responder_enabled:
          type: boolean
        auto_responder_subject:
          type: string
          nullable: true
        auto_responder_body:
          type: string
          nullable: true
        auto_responder_from_name:
          type: string
          nullable: true
        auto_responder_include_data:
          type: boolean
        slack_enabled:
          type: boolean
        slack_webhook_url:
          type: string
          nullable: true
        discord_enabled:
          type: boolean
        discord_webhook_url:
          type: string
          nullable: true
        google_sheets_enabled:
          type: boolean
        google_sheets_url:
          type: string
          nullable: true
        telegram_enabled:
          type: boolean
        telegram_bot_token:
          type: string
          nullable: true
        telegram_chat_id:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - slug
        - description
        - is_active
        - user_id
        - org_id
        - email_notifications
        - notification_email
        - notification_emails
        - redirect_url
        - allowed_domains
        - webhook_enabled
        - webhook_url
        - webhook_secret
        - custom_email_subject
        - custom_email_template
        - auto_responder_enabled
        - auto_responder_subject
        - auto_responder_body
        - auto_responder_from_name
        - auto_responder_include_data
        - slack_enabled
        - slack_webhook_url
        - discord_enabled
        - discord_webhook_url
        - google_sheets_enabled
        - google_sheets_url
        - telegram_enabled
        - telegram_bot_token
        - telegram_chat_id
        - created_at
        - updated_at
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: >-
        Authentication using either a FormBnB session JWT (issued by /auth) or
        an API key (prefixed with sk_). Both token types are passed as Bearer
        tokens in the Authorization header.

````