Update Webhook Endpoint - Polar

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

PATCH

https://api.polar.sh/v1/webhooks/endpoints/{id}

Try it

Python

from polar.v2026_04 import Polar

polar = Polar("polar_oat_xxx")

response = polar.webhooks.update_webhook_endpoint(
    '00000000-0000-4000-8000-000000000000',
)
print(response)

JavaScript

import { createPolar } from "@polar-sh/sdk/2026-04";

const polar = createPolar({
  accessToken: "polar_oat_xxx",
});

const response = await polar.webhooks.updateWebhookEndpoint(
  "00000000-0000-4000-8000-000000000000",
  {},
);
console.log(response);

Curl

curl --request PATCH \
  --url https://api.polar.sh/v1/webhooks/endpoints/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
  "name": "<string>",
  "events": [],
  "enabled": true
}
'```

#### Fetch API

```javascript
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    url: 'https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0',
    name: '<string>',
    events: [],
    enabled: true
  })
};

fetch('https://api.polar.sh/v1/webhooks/endpoints/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.polar.sh/v1/webhooks/endpoints/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'url' => 'https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0',
    'name' => '<string>',
    'events' => [],
    'enabled' => true
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error ": . $err;
} else {
  echo $response;
}
?>

Go

package main

import (
    "fmt"
    "strings"
    "net/http"
    "io"
)

func main() {

url := "https://api.polar.sh/v1/webhooks/endpoints/{id}"

payload := strings.NewReader("{\n  \"url\": \"https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0\",\n  \"name\": \"<string>\",\n  \"events\": [],\n  \"enabled\": true\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
    req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}

Response

Success - 200

{
  "created_at": "2026-01-01T00:00:00.000000Z",
  "modified_at": "2026-01-01T00:00:00.000000Z",
  "id": "<string>",
  "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
  "api_version": "<string>",
  "format": "raw",
  "secret": "whsec_ovyN6cPrTv56AApvzCaJno08SSmGJmgbWilb33N2JuK",
  "organization_id": "<string>",
  "events": [
    "checkout.created"
  ],
  "enabled": true,
  "uses_standard_webhook_signature": true,
  "name": "<string>"
}

Error - 404

{
  "error": "ResourceNotFound",
  "detail": "<string>"
}

Validation Error - 422

{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Authorizations

You can generate a Personal Access Token from your settings.

Path Parameters

Body

Example: "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0"

Available options: 2026-04, 2026-10

Available options: raw, discord, slack