Webhooks
Update Webhook Headers
Update the headers for a specific webhook.
PATCH
/
webhooks
/
{webhook_id}
/
headers
JavaScript
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('whk_YdWqVEGKmSYKbsIyDxEab', { headers: { foo: 'string' } });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="whk_YdWqVEGKmSYKbsIyDxEab",
headers={
"foo": "string"
},
)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(),
"whk_YdWqVEGKmSYKbsIyDxEab",
dodopayments.WebhookHeaderUpdateParams{
Headers: dodopayments.F(map[string]string{
"foo": "string",
}),
},
)
if err != nil {
panic(err.Error())
}
}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("whk_YdWqVEGKmSYKbsIyDxEab")
.headers(HeaderUpdateParams.Headers.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build())
.build();
client.webhooks().headers().update(params);
}
}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("whk_YdWqVEGKmSYKbsIyDxEab")
.headers(HeaderUpdateParams.Headers.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build())
.build()
client.webhooks().headers().update(params)
}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("whk_YdWqVEGKmSYKbsIyDxEab", headers: {foo: "string"})
puts(result)<?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(
'whk_YdWqVEGKmSYKbsIyDxEab', headers: ['foo' => 'string']
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using System.Collections.Generic;
using DodoPayments.Client;
using DodoPayments.Client.Models.Webhooks.Headers;
DodoPaymentsClient client = new();
HeaderUpdateParams parameters = new()
{
WebhookID = "whk_YdWqVEGKmSYKbsIyDxEab",
Headers = new Dictionary<string, string>() { { "foo", "string" } },
};
await client.Webhooks.Headers.Update(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let webhook_id = "webhook_id";
let result = client
.webhooks()
.headers()
.update()
.webhook_id(webhook_id)
.body(dodopayments::models::WebhooksHeadersUpdateParams {
headers: Some(std::collections::HashMap::from([("foo".to_string(), "string".to_string())])),
..Default::default()
})
.await?;
println!("{result:?}");
Ok(())
}curl --request PATCH \
--url https://test.dodopayments.com/webhooks/{webhook_id}/headers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"headers": {}
}'Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Webhook ID
Body
application/json
Object of header-value pair to update or add
Show child attributes
Show child attributes
Response
Webhook headers patched successfully
Last modified on March 25, 2026
Was this page helpful?
⌘I
JavaScript
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('whk_YdWqVEGKmSYKbsIyDxEab', { headers: { foo: 'string' } });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="whk_YdWqVEGKmSYKbsIyDxEab",
headers={
"foo": "string"
},
)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(),
"whk_YdWqVEGKmSYKbsIyDxEab",
dodopayments.WebhookHeaderUpdateParams{
Headers: dodopayments.F(map[string]string{
"foo": "string",
}),
},
)
if err != nil {
panic(err.Error())
}
}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("whk_YdWqVEGKmSYKbsIyDxEab")
.headers(HeaderUpdateParams.Headers.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build())
.build();
client.webhooks().headers().update(params);
}
}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("whk_YdWqVEGKmSYKbsIyDxEab")
.headers(HeaderUpdateParams.Headers.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build())
.build()
client.webhooks().headers().update(params)
}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("whk_YdWqVEGKmSYKbsIyDxEab", headers: {foo: "string"})
puts(result)<?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(
'whk_YdWqVEGKmSYKbsIyDxEab', headers: ['foo' => 'string']
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using System.Collections.Generic;
using DodoPayments.Client;
using DodoPayments.Client.Models.Webhooks.Headers;
DodoPaymentsClient client = new();
HeaderUpdateParams parameters = new()
{
WebhookID = "whk_YdWqVEGKmSYKbsIyDxEab",
Headers = new Dictionary<string, string>() { { "foo", "string" } },
};
await client.Webhooks.Headers.Update(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let webhook_id = "webhook_id";
let result = client
.webhooks()
.headers()
.update()
.webhook_id(webhook_id)
.body(dodopayments::models::WebhooksHeadersUpdateParams {
headers: Some(std::collections::HashMap::from([("foo".to_string(), "string".to_string())])),
..Default::default()
})
.await?;
println!("{result:?}");
Ok(())
}curl --request PATCH \
--url https://test.dodopayments.com/webhooks/{webhook_id}/headers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"headers": {}
}'