Update a webhook endpoint
const url = 'https://api.koneth.com/api/v1/organizations/b7378db4-5a7a-4e69-a8df-04f2e6d94243/webhooks/0f6f2d88-9357-4ce6-9b9e-76db2f98bb2e';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://api.example.com/koneth/events-v2","events":["position.opened","position.closed"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.koneth.com/api/v1/organizations/b7378db4-5a7a-4e69-a8df-04f2e6d94243/webhooks/0f6f2d88-9357-4ce6-9b9e-76db2f98bb2e \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://api.example.com/koneth/events-v2", "events": [ "position.opened", "position.closed" ] }'Changes where an endpoint points, what it listens for, or which server it covers. A field you leave out is left alone, so a request that edits the events cannot reset the target server by omission.
Moving the URL sends the endpoint back to pending and issues a fresh
challenge, because the verification on file was answered by the address
that was there before. verificationRequired says whether that happened,
and deliveries stop until the endpoint verifies again. Editing the events
or the server does not interrupt delivery.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”UUID of the organization the signed-in user belongs to.
Example
b7378db4-5a7a-4e69-a8df-04f2e6d94243UUID of a webhook endpoint in the organization.
Example
0f6f2d88-9357-4ce6-9b9e-76db2f98bb2eRequest Bodyrequired
Section titled “Request Bodyrequired”object
HTTPS address that receives the deliveries. Changing it sends
the endpoint back to pending for a fresh challenge.
Deliver only this server’s events, or null for every server
in the organization.
Example
{ "url": "https://api.example.com/koneth/events-v2", "events": [ "position.opened", "position.closed" ]}Responses
Section titled “Responses”Endpoint updated.
object
object
True when the URL moved and the endpoint has to answer a fresh challenge before it receives anything again.
Example
{ "endpoint": { "id": "0f6f2d88-9357-4ce6-9b9e-76db2f98bb2e", "name": "api.example.com", "url": "https://api.example.com/koneth/events-v2", "events": [ "position.opened", "position.closed" ], "serverId": null, "status": "pending", "verificationRequired": true }}Invalid request.
object
Validation issue details when the request fails schema validation.
object
Examplegenerated
{ "error": "example", "issues": [ {} ]}The Console session is missing or expired.
object
Validation issue details when the request fails schema validation.
object
Example
{ "error": "Authentication required"}The signed-in user is not an organization Owner or Finance member.
object
Validation issue details when the request fails schema validation.
object
Example
{ "error": "Insufficient organization permission"}The requested resource was not found.
object
Validation issue details when the request fails schema validation.
object
Examplegenerated
{ "error": "example", "issues": [ {} ]}Unexpected server error.
object
Validation issue details when the request fails schema validation.
object
Example
{ "error": "Internal server error"}