Webhook endpoints
7 operations under webhook-endpoints. Examples read $API and $KEY from your shell.
- GET /v1/webhook-endpoints
- POST /v1/webhook-endpoints
- GET /v1/webhook-endpoints/{id}
- PATCH /v1/webhook-endpoints/{id}
- DELETE /v1/webhook-endpoints/{id}
- POST /v1/webhook-endpoints/{id}/test
- POST /v1/webhook-endpoints/{id}/rotate-secret
GET /v1/webhook-endpoints
Parameters
limitinteger required in querystarting_afterstring optional in query
Responses
200 Default Response
object
dataarray requiredEach item:
idstring requiredurlstring requireddescriptionstring required (nullable)enabled_eventsarray of string requiredstatusstring required one ofenabled,disabledenabled_atstring required (nullable)last_test_atstring required (nullable)last_test_statusinteger required (nullable)created_atstring requiredupdated_atstring requiredversioninteger required
has_moreboolean required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/webhook-endpoints?limit=1" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/webhook-endpoints", {
params: { query: { limit: 1 } },
});POST /v1/webhook-endpoints
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Request body
application/json, required
object
urlstring requireddescriptionstring optionalenabled_eventsarray of string optional
Responses
201 Default Response
object
idstring requiredurlstring requireddescriptionstring required (nullable)enabled_eventsarray of string requiredstatusstring required one ofenabled,disabledenabled_atstring required (nullable)last_test_atstring required (nullable)last_test_statusinteger required (nullable)created_atstring requiredupdated_atstring requiredversioninteger requiredsecretstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/webhook-endpoints" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"url":"<url>"}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/webhook-endpoints", {
body: {
"url": "<url>"
},
});GET /v1/webhook-endpoints/{id}
Parameters
idstring required in path
Responses
200 Default Response
object
idstring requiredurlstring requireddescriptionstring required (nullable)enabled_eventsarray of string requiredstatusstring required one ofenabled,disabledenabled_atstring required (nullable)last_test_atstring required (nullable)last_test_statusinteger required (nullable)created_atstring requiredupdated_atstring requiredversioninteger required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/webhook-endpoints/$ID" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/webhook-endpoints/{id}", {
params: { path: { id: "<id>" } },
});PATCH /v1/webhook-endpoints/{id}
Parameters
idstring required in path
Request body
application/json, required
object
urlstring optionaldescriptionstring optional (nullable)enabled_eventsarray of string optionaldisabledboolean optional one oftrue
Responses
200 Default Response
object
idstring requiredurlstring requireddescriptionstring required (nullable)enabled_eventsarray of string requiredstatusstring required one ofenabled,disabledenabled_atstring required (nullable)last_test_atstring required (nullable)last_test_statusinteger required (nullable)created_atstring requiredupdated_atstring requiredversioninteger required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X PATCH \
"$API/v1/webhook-endpoints/$ID" \
-H "authorization: Bearer $KEY" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.PATCH("/v1/webhook-endpoints/{id}", {
params: { path: { id: "<id>" } },
body: {},
});DELETE /v1/webhook-endpoints/{id}
Parameters
idstring required in path
Responses
204 Default Response
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X DELETE \
"$API/v1/webhook-endpoints/$ID" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.DELETE("/v1/webhook-endpoints/{id}", {
params: { path: { id: "<id>" } },
});POST /v1/webhook-endpoints/{id}/test
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
Responses
200 Default Response
object
endpointobject requiredidstring requiredurlstring requireddescriptionstring required (nullable)enabled_eventsarray of string requiredstatusstring required one ofenabled,disabledenabled_atstring required (nullable)last_test_atstring required (nullable)last_test_statusinteger required (nullable)created_atstring requiredupdated_atstring requiredversioninteger required
testobject requiredsucceededboolean requiredstatus_codeinteger required (nullable)errorstring required (nullable)
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/webhook-endpoints/$ID/test" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/webhook-endpoints/{id}/test", {
params: { path: { id: "<id>" } },
body: {},
});POST /v1/webhook-endpoints/{id}/rotate-secret
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Parameters
idstring required in path
Request body
application/json, required
object
Responses
200 Default Response
object
idstring requiredurlstring requireddescriptionstring required (nullable)enabled_eventsarray of string requiredstatusstring required one ofenabled,disabledenabled_atstring required (nullable)last_test_atstring required (nullable)last_test_statusinteger required (nullable)created_atstring requiredupdated_atstring requiredversioninteger requiredsecretstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/webhook-endpoints/$ID/rotate-secret" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/webhook-endpoints/{id}/rotate-secret", {
params: { path: { id: "<id>" } },
body: {},
});