> ## Documentation Index
> Fetch the complete documentation index at: https://dodopayments-mintlify-external-integration-datafast-autosen.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Webhook Headers

> Update the headers for a specific webhook.



## OpenAPI

````yaml patch /webhooks/{webhook_id}/headers
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.61.5
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /webhooks/{webhook_id}/headers:
    patch:
      tags:
        - Webhooks
      summary: Patch a webhook by id
      operationId: patch_webhook_headers
      parameters:
        - name: webhook_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookHeadersReq'
        required: true
      responses:
        '200':
          description: Webhook headers patched successfully
        '404':
          description: Webhook Not Found
        '500':
          description: Something went wrong.
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: 'My Bearer Token',
            });


            await client.webhooks.headers.update('webhook_id', { headers: { foo:
            'string' } });
        - lang: Python
          source: |-
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token="My Bearer Token",
            )
            client.webhooks.headers.update(
                webhook_id="webhook_id",
                headers={
                    "foo": "string"
                },
            )
        - lang: Go
          source: |
            package main

            import (
              "context"

              "github.com/dodopayments/dodopayments-go"
              "github.com/dodopayments/dodopayments-go/option"
            )

            func main() {
              client := dodopayments.NewClient(
                option.WithBearerToken("My Bearer Token"),
              )
              err := client.Webhooks.Headers.Update(
                context.TODO(),
                "webhook_id",
                dodopayments.WebhookHeaderUpdateParams{
                  Headers: dodopayments.F(map[string]string{
                  "foo": "string",
                  }),
                },
              )
              if err != nil {
                panic(err.Error())
              }
            }
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import com.dodopayments.api.core.JsonValue;

            import
            com.dodopayments.api.models.webhooks.headers.HeaderUpdateParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    HeaderUpdateParams params = HeaderUpdateParams.builder()
                        .webhookId("webhook_id")
                        .headers(HeaderUpdateParams.Headers.builder()
                            .putAdditionalProperty("foo", JsonValue.from("string"))
                            .build())
                        .build();
                    client.webhooks().headers().update(params);
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.core.JsonValue

            import
            com.dodopayments.api.models.webhooks.headers.HeaderUpdateParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val params: HeaderUpdateParams = HeaderUpdateParams.builder()
                    .webhookId("webhook_id")
                    .headers(HeaderUpdateParams.Headers.builder()
                        .putAdditionalProperty("foo", JsonValue.from("string"))
                        .build())
                    .build()
                client.webhooks().headers().update(params)
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            result = dodo_payments.webhooks.headers.update("webhook_id",
            headers: {foo: "string"})


            puts(result)
components:
  schemas:
    WebhookHeadersReq:
      type: object
      title: Webhook Headers Request
      required:
        - headers
      properties:
        headers:
          type: object
          description: Object of header-value pair to update or add
          additionalProperties:
            type: string
          propertyNames:
            type: string
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````