curl --request PATCH \
--url https://api.cope.com/v1/webhooks/endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"active": true,
"description": "<string>",
"event_types": [
"<string>"
],
"notification_email": "jsmith@example.com",
"url": "https://checkout.example.com/cope/webhooks"
}
'import requests
url = "https://api.cope.com/v1/webhooks/endpoints/{id}"
payload = {
"active": True,
"description": "<string>",
"event_types": ["<string>"],
"notification_email": "jsmith@example.com",
"url": "https://checkout.example.com/cope/webhooks"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
active: true,
description: '<string>',
event_types: ['<string>'],
notification_email: 'jsmith@example.com',
url: 'https://checkout.example.com/cope/webhooks'
})
};
fetch('https://api.cope.com/v1/webhooks/endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cope.com/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([
'active' => true,
'description' => '<string>',
'event_types' => [
'<string>'
],
'notification_email' => 'jsmith@example.com',
'url' => 'https://checkout.example.com/cope/webhooks'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cope.com/v1/webhooks/endpoints/{id}"
payload := strings.NewReader("{\n \"active\": true,\n \"description\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"notification_email\": \"jsmith@example.com\",\n \"url\": \"https://checkout.example.com/cope/webhooks\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.cope.com/v1/webhooks/endpoints/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"description\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"notification_email\": \"jsmith@example.com\",\n \"url\": \"https://checkout.example.com/cope/webhooks\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/webhooks/endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"description\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"notification_email\": \"jsmith@example.com\",\n \"url\": \"https://checkout.example.com/cope/webhooks\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"active": true,
"created_at": "2023-11-07T05:31:56Z",
"event_types": [
"<string>"
],
"id": "<string>",
"notification_email": "jsmith@example.com",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"description": "<string>",
"disabled_reason": "<string>"
}
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Update a webhook endpoint
curl --request PATCH \
--url https://api.cope.com/v1/webhooks/endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"active": true,
"description": "<string>",
"event_types": [
"<string>"
],
"notification_email": "jsmith@example.com",
"url": "https://checkout.example.com/cope/webhooks"
}
'import requests
url = "https://api.cope.com/v1/webhooks/endpoints/{id}"
payload = {
"active": True,
"description": "<string>",
"event_types": ["<string>"],
"notification_email": "jsmith@example.com",
"url": "https://checkout.example.com/cope/webhooks"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
active: true,
description: '<string>',
event_types: ['<string>'],
notification_email: 'jsmith@example.com',
url: 'https://checkout.example.com/cope/webhooks'
})
};
fetch('https://api.cope.com/v1/webhooks/endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cope.com/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([
'active' => true,
'description' => '<string>',
'event_types' => [
'<string>'
],
'notification_email' => 'jsmith@example.com',
'url' => 'https://checkout.example.com/cope/webhooks'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cope.com/v1/webhooks/endpoints/{id}"
payload := strings.NewReader("{\n \"active\": true,\n \"description\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"notification_email\": \"jsmith@example.com\",\n \"url\": \"https://checkout.example.com/cope/webhooks\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.cope.com/v1/webhooks/endpoints/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"description\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"notification_email\": \"jsmith@example.com\",\n \"url\": \"https://checkout.example.com/cope/webhooks\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cope.com/v1/webhooks/endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"description\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"notification_email\": \"jsmith@example.com\",\n \"url\": \"https://checkout.example.com/cope/webhooks\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"active": true,
"created_at": "2023-11-07T05:31:56Z",
"event_types": [
"<string>"
],
"id": "<string>",
"notification_email": "jsmith@example.com",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"description": "<string>",
"disabled_reason": "<string>"
}
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"param": "<string>"
}
],
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required. At most 255 characters of valid UTF-8 with no NUL byte; a missing key is refused with 400 idempotency_key_required and a malformed one with 400 invalid_idempotency_key. A retry with the same key and body returns the original successful response for 24 hours; a request that failed can be sent again under the same key. The same key with a different body is refused with 409 idempotency_key_conflict, and while the first request is still running with 409 idempotency_key_in_progress and a Retry-After header.
1 - 255Path Parameters
^whs_[A-Za-z0-9_-]+$Body
500A type the endpoint already subscribes to can be kept or removed. Removing one listed with accepts_new_subscriptions false, or no longer listed, is permanent: it cannot be added back. A type the list adds must be one GET /v1/webhooks/event-types lists with accepts_new_subscriptions true (absent means true). One listed with false is refused with 422 validation_failed and an event_types error reading No longer offered for new subscriptions: <types>; one not listed is refused the same way as Unknown event type: <types>. A list naming both kinds gets both errors in one response.
1Where COPE sends the notice when it disables this endpoint automatically. An update through this API replaces it; the COPE dashboard sets it when it creates an endpoint and does not change it.
2048^https://"https://checkout.example.com/cope/webhooks"
Response
Webhook resource
Show child attributes
Show child attributes