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

# Update a Webhook

> Update a webhook's endpoint URL, its subscribed event types, or both. Omitted fields are left unchanged. `eventTypes` replaces the existing subscription rather than adding to it. The signing secret is unaffected.



## OpenAPI

````yaml patch /v1/webhooks/{id}
openapi: 3.0.0
info:
  title: Browserbase API
  description: Browserbase API for 3rd party developers
  version: v1
servers:
  - url: https://api.browserbase.com
    description: Public endpoint
    variables: {}
security:
  - BrowserbaseAuth: []
tags: []
paths:
  /v1/webhooks/{id}:
    patch:
      summary: Update a Webhook
      description: >-
        Update a webhook's endpoint URL, its subscribed event types, or both.
        Omitted fields are left unchanged. `eventTypes` replaces the existing
        subscription rather than adding to it. The signing secret is unaffected.
      operationId: Webhooks_update
      parameters:
        - name: id
          in: path
          description: The webhook ID.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                endpoint:
                  description: >-
                    HTTPS URL that event deliveries are POSTed to. Must be
                    publicly reachable.
                  type: string
                  format: uri
                  maxLength: 2048
                  pattern: ^https://[^/?#]+
                eventTypes:
                  description: >-
                    Event types this webhook subscribes to. Unknown types are
                    rejected.
                  type: array
                  items:
                    type: string
                    enum:
                      - functions.builds.running
                      - functions.builds.completed
                      - functions.builds.failed
                      - functions.invocations.pending
                      - functions.invocations.running
                      - functions.invocations.completed
                      - functions.invocations.failed
                  minItems: 1
                  uniqueItems: true
              additionalProperties: false
              minProperties: 1
      responses:
        '200':
          description: The webhook after the update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
      x-codeSamples:
        - lang: javascript
          label: Node.js
          source: |-
            import Browserbase from "@browserbasehq/sdk";

            const bb = new Browserbase({
              apiKey: process.env.BROWSERBASE_API_KEY,
            });

            const webhook = await bb.webhooks.update("<webhook-id>", {
              eventTypes: [
                "functions.invocations.completed",
                "functions.invocations.failed",
              ],
            });

            console.log(webhook);
        - lang: python
          label: Python
          source: |-
            import os

            from browserbase import Browserbase

            bb = Browserbase(api_key=os.environ["BROWSERBASE_API_KEY"])

            webhook = bb.webhooks.update(
                "<webhook-id>",
                event_types=[
                    "functions.invocations.completed",
                    "functions.invocations.failed",
                ],
            )

            print(webhook)
        - lang: bash
          label: cURL
          source: |-
            curl --request PATCH \
              --url https://api.browserbase.com/v1/webhooks/<webhook-id> \
              --header 'Content-Type: application/json' \
              --header "X-BB-API-Key: $BROWSERBASE_API_KEY" \
              --data '{
                "eventTypes": [
                  "functions.invocations.completed",
                  "functions.invocations.failed"
                ]
              }'
components:
  schemas:
    Webhook:
      description: >-
        A delivery endpoint for a project. Browserbase POSTs a signed event to
        it whenever one of its subscribed event types occurs. The signing secret
        is returned only when it is created or rotated.
      type: object
      properties:
        id:
          description: Unique identifier for the webhook.
          type: string
        projectId:
          description: The project the webhook belongs to.
          type: string
        endpoint:
          description: >-
            HTTPS URL that event deliveries are POSTed to. Must be publicly
            reachable.
          type: string
          format: uri
          maxLength: 2048
          pattern: ^https://[^/?#]+
        eventTypes:
          description: Event types this webhook subscribes to. Unknown types are rejected.
          type: array
          items:
            type: string
            enum:
              - functions.builds.running
              - functions.builds.completed
              - functions.builds.failed
              - functions.invocations.pending
              - functions.invocations.running
              - functions.invocations.completed
              - functions.invocations.failed
          minItems: 1
          uniqueItems: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - projectId
        - endpoint
        - eventTypes
        - createdAt
        - updatedAt
  securitySchemes:
    BrowserbaseAuth:
      type: apiKey
      in: header
      name: X-BB-API-Key
      description: Your [Browserbase API Key](https://www.browserbase.com/settings).

````