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

# Update a webhook

> Changes any subset of `url`, `secret`, `events` and `active`. Fields you omit keep their current value; a field you send, including an empty string, replaces it.



## OpenAPI

````yaml openapi-sms.yaml PUT /webhooks/{id}
openapi: 3.0.3
info:
  title: Vobiz Messaging API
  description: >
    Send and receive SMS, MMS and RCS messages, buy messaging numbers, register
    for

    US 10DLC and toll-free, run broadcasts, manage conversations, opt-outs and
    webhooks.


    **Base URL:** `https://api.vobiz.ai/api/v1/sms`


    **Authentication:** every request needs the `X-Auth-ID` and `X-Auth-Token`
    headers.

    The account is taken from your credentials; you never put an account ID in a
    path or body.

    Field names in this API are camelCase.
  version: '1.0'
  contact:
    email: support@vobiz.ai
    url: https://vobiz.ai
servers:
  - url: https://api.vobiz.ai/api/v1/sms
    description: Production
security:
  - AuthID: []
    AuthToken: []
tags:
  - name: Messages
    description: Send messages and inspect their delivery state.
  - name: Numbers
    description: >-
      Messaging-capable numbers on your account, inventory search, purchase and
      release.
  - name: Coverage
    description: Where you can send, per country.
  - name: Conversations
    description: Two-way threads between one of your numbers and a contact.
  - name: Opt-outs
    description: Numbers that must not receive messages on a channel.
  - name: Webhooks
    description: Subscriptions that deliver message and broadcast events to your server.
  - name: Broadcasts
    description: Bulk sends from an uploaded recipient list.
  - name: RCS Senders
    description: RCS sender (agent) identities and their message templates.
  - name: 10DLC Brands
    description: US 10DLC brand registration.
  - name: 10DLC Campaigns
    description: US 10DLC campaigns, toll-free verification and supporting documents.
paths:
  /webhooks/{id}:
    put:
      tags:
        - Webhooks
      summary: Update a webhook
      description: >-
        Changes any subset of `url`, `secret`, `events` and `active`. Fields you
        omit keep their current value; a field you send, including an empty
        string, replaces it. Set `active` to `false` to pause deliveries without
        losing the subscription, and back to `true` to resume. The response is
        `{"status":"ok"}`, so call `GET /webhooks/{id}` to read the updated
        subscription.
      operationId: update-webhook
      parameters:
        - name: id
          in: path
          required: true
          description: The subscription `id` (UUID) to change.
          schema:
            type: string
            format: uuid
          example: 2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
            examples:
              events:
                summary: Change the events
                value:
                  events:
                    - message.delivered
                    - message.failed
              pause:
                summary: Pause deliveries
                value:
                  active: false
              rotate:
                summary: Rotate the secret and move the endpoint
                value:
                  url: https://example.com/vobiz/webhooks-v2
                  secret: YOUR_NEW_WEBHOOK_SECRET
      responses:
        '200':
          description: Updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusOk'
              example:
                status: ok
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: The subscription does not exist on your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: subscription not found
        '500':
          $ref: '#/components/responses/ServerError'
      x-codeSamples:
        - lang: typescript
          label: Node SDK
          source: >
            import { VobizClient } from "@vobiz/sdk";


            const client = new VobizClient({ apiKey: "MA_XXXXXXXX", authToken:
            "YOUR_AUTH_TOKEN" });


            await client.sms.webhooks.updateWebhook({
                id: "2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
                events: ["message.delivered", "message.failed"]
            })
        - lang: python
          label: Python SDK
          source: |
            from vobiz import Vobiz

            client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")

            client.sms.webhooks.update_webhook(
                id="2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
                events=[
                    "message.delivered",
                    "message.failed"
                ],
            )
        - lang: go
          label: Go SDK
          source: |
            import (
                "context"

                vobiz "github.com/vobiz-ai/Vobiz-Go-SDK"
                "github.com/vobiz-ai/Vobiz-Go-SDK/client"
                "github.com/vobiz-ai/Vobiz-Go-SDK/option"
                "github.com/vobiz-ai/Vobiz-Go-SDK/sms"
            )

            c := client.NewClient(
                option.WithAPIKey("MA_XXXXXXXX"),
                option.WithAuthToken("YOUR_AUTH_TOKEN"),
            )

            request := &sms.UpdateWebhookRequest{
                    ID: "2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
                    Events: []sms.WebhookEvent{
                        sms.WebhookEventMessageDelivered,
                        sms.WebhookEventMessageFailed,
                    },
                }
            c.Sms.Webhooks.UpdateWebhook(
                    context.TODO(),
                    request,
                )
        - lang: java
          label: Java SDK
          source: |
            import com.vobiz.api.VobizApiClient;

            VobizApiClient client = VobizApiClient
                .builder()
                .apiKey("MA_XXXXXXXX")
                .authToken("YOUR_AUTH_TOKEN")
                .build();

            client.sms().webhooks().updateWebhook(
                "2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
                UpdateWebhookRequest
                    .builder()
                    .events(
                        Optional.of(
                            Arrays.asList(WebhookEvent.MESSAGE_DELIVERED, WebhookEvent.MESSAGE_FAILED)
                        )
                    )
                    .build()
            );
        - lang: ruby
          label: Ruby SDK
          source: >
            require 'vobiz'


            client = Vobiz::Client.new(api_key: 'MA_XXXXXXXX', auth_token:
            'YOUR_AUTH_TOKEN')


            client.sms.webhooks.update_webhook(
              id: "2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
              events: %w[message.delivered message.failed]
            )
        - lang: csharp
          label: C# SDK
          source: |
            using Vobiz;
            using Vobiz.Sms;

            var client = new VobizApiClient("YOUR_AUTH_TOKEN", "MA_XXXXXXXX");

            await client.Sms.Webhooks.UpdateWebhookAsync(
                new UpdateWebhookRequest
                {
                    Id = "2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
                    Events = new List<WebhookEvent>()
                    {
                        WebhookEvent.MessageDelivered,
                        WebhookEvent.MessageFailed,
                    },
                }
            );
        - lang: php
          label: PHP SDK
          source: >
            <?php


            require 'vendor/autoload.php';


            use Vobiz\VobizClient;


            $client = new VobizClient(apiKey: 'MA_XXXXXXXX', authToken:
            'YOUR_AUTH_TOKEN');


            $client->sms->webhooks->updateWebhook(
                '2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e',
                new UpdateWebhookRequest([
                    'events' => [
                        WebhookEvent::MessageDelivered->value,
                        WebhookEvent::MessageFailed->value,
                    ],
                ]),
            );
components:
  schemas:
    UpdateWebhookRequest:
      type: object
      description: >-
        The fields to change. Send any subset; fields you omit keep their
        current value.
      properties:
        url:
          type: string
          format: uri
          example: https://example.com/vobiz/webhooks-v2
          description: >-
            New HTTPS URL for deliveries. Replaces the current URL as sent, so
            always send a full valid URL.
        secret:
          type: string
          example: YOUR_NEW_WEBHOOK_SECRET
          description: >-
            New signing secret for `X-Webhook-Signature`. Deliveries are signed
            with the new value from this point, so update your verifier at the
            same time.
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
          example:
            - message.delivered
            - message.failed
          description: >-
            New list of event names to deliver, matched exactly. Replaces the
            whole list; it is not merged with the current events.
        active:
          type: boolean
          description: >-
            `false` pauses deliveries and keeps the subscription; `true` resumes
            them.
    StatusOk:
      type: object
      properties:
        status:
          type: string
          example: ok
          description: Always `ok` when the action succeeded.
      description: >-
        Confirmation returned by actions that have no resource to return, such
        as marking a conversation read or creating or deleting an opt-out.
    Error:
      type: object
      description: >-
        The body of every error response: a flat object with one `error` string
        that explains what went wrong. Use the HTTP status code to decide how to
        handle the error, and log `error` for diagnosis.
      required:
        - error
      properties:
        error:
          type: string
          example: 'recipient has opted out: +14155550123'
          description: >-
            Human-readable explanation of the error, for example `phoneNumber is
            required` or `recipient has opted out: +14155550123`. Branch on the
            HTTP status code rather than on this text.
    WebhookEvent:
      type: string
      description: >-
        A messaging event name you can subscribe to: `message.status` (delivery
        state changed), `message.delivered` (reached the handset),
        `message.failed` (could not be delivered), `message.received` (inbound
        message) or `broadcast.updated` (broadcast status or counters changed).
      enum:
        - message.status
        - message.delivered
        - message.failed
        - message.received
        - broadcast.updated
  responses:
    BadRequest:
      description: The request body or a parameter is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid request body
    Unauthorized:
      description: Missing or invalid `X-Auth-ID` / `X-Auth-Token`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: missing or invalid credentials
    ServerError:
      description: Unexpected error. Retry with the same idempotency key where one applies.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal error
  securitySchemes:
    AuthID:
      type: apiKey
      in: header
      name: X-Auth-ID
      description: Your Vobiz account Auth ID (`MA_XXXXXXXX`).
    AuthToken:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: Your Vobiz account Auth Token.

````

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