> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/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.105.0
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: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - 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: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });


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

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            client.webhooks.headers.update(
                webhook_id="webhook_id",
                headers={
                    "foo": "string"
                },
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\terr := client.Webhooks.Headers.Update(\n\t\tcontext.TODO(),\n\t\t\"webhook_id\",\n\t\tdodopayments.WebhookHeaderUpdateParams{\n\t\t\tHeaders: dodopayments.F(map[string]string{\n\t\t\t\t\"foo\": \"string\",\n\t\t\t}),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - 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)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $result = $client->webhooks->headers->update(
                'webhook_id', headers: ['foo' => 'string']
              );

              var_dump($result);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System.Collections.Generic;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Webhooks.Headers;

            DodoPaymentsClient client = new();

            HeaderUpdateParams parameters = new()
            {
                WebhookID = "webhook_id",
                Headers = new Dictionary<string, string>() { { "foo", "string" } },
            };

            await client.Webhooks.Headers.Update(parameters);
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

````