Skip to content
Testnet only: a reference implementation, not a production service.Tokens and bank transfers here are simulated and have no value.

Webhook endpoints

7 operations under webhook-endpoints. Examples read $API and $KEY from your shell.

GET /v1/webhook-endpoints

Parameters

  • limit integer required in query
  • starting_after string optional in query

Responses

200 Default Response

object

  • data array required

    Each item:

    • id string required
    • url string required
    • description string required (nullable)
    • enabled_events array of string required
    • status string required one of enabled, disabled
    • enabled_at string required (nullable)
    • last_test_at string required (nullable)
    • last_test_status integer required (nullable)
    • created_at string required
    • updated_at string required
    • version integer required
  • has_more boolean required

Errors are RFC 9457 problem documents (application/problem+json).

curl

curl -s \
  "$API/v1/webhook-endpoints?limit=1" \
  -H "authorization: Bearer $KEY"
Copied

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 } },
});
Copied

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

  • url string required
  • description string optional
  • enabled_events array of string optional

Responses

201 Default Response

object

  • id string required
  • url string required
  • description string required (nullable)
  • enabled_events array of string required
  • status string required one of enabled, disabled
  • enabled_at string required (nullable)
  • last_test_at string required (nullable)
  • last_test_status integer required (nullable)
  • created_at string required
  • updated_at string required
  • version integer required
  • secret string 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>"}'
Copied

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>"
  },
});
Copied

GET /v1/webhook-endpoints/{id}

Parameters

  • id string required in path

Responses

200 Default Response

object

  • id string required
  • url string required
  • description string required (nullable)
  • enabled_events array of string required
  • status string required one of enabled, disabled
  • enabled_at string required (nullable)
  • last_test_at string required (nullable)
  • last_test_status integer required (nullable)
  • created_at string required
  • updated_at string required
  • version integer required

Errors are RFC 9457 problem documents (application/problem+json).

curl

curl -s \
  "$API/v1/webhook-endpoints/$ID" \
  -H "authorization: Bearer $KEY"
Copied

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>" } },
});
Copied

PATCH /v1/webhook-endpoints/{id}

Parameters

  • id string required in path

Request body

application/json, required

object

  • url string optional
  • description string optional (nullable)
  • enabled_events array of string optional
  • disabled boolean optional one of true

Responses

200 Default Response

object

  • id string required
  • url string required
  • description string required (nullable)
  • enabled_events array of string required
  • status string required one of enabled, disabled
  • enabled_at string required (nullable)
  • last_test_at string required (nullable)
  • last_test_status integer required (nullable)
  • created_at string required
  • updated_at string required
  • version integer 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 '{}'
Copied

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: {},
});
Copied

DELETE /v1/webhook-endpoints/{id}

Parameters

  • id string 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"
Copied

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>" } },
});
Copied

POST /v1/webhook-endpoints/{id}/test

Send an Idempotency-Key header on every POST so a retry never repeats the request.

Parameters

  • id string required in path

Request body

application/json, required

object

Responses

200 Default Response

object

  • endpoint object required
    • id string required
    • url string required
    • description string required (nullable)
    • enabled_events array of string required
    • status string required one of enabled, disabled
    • enabled_at string required (nullable)
    • last_test_at string required (nullable)
    • last_test_status integer required (nullable)
    • created_at string required
    • updated_at string required
    • version integer required
  • test object required
    • succeeded boolean required
    • status_code integer required (nullable)
    • error string 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 '{}'
Copied

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: {},
});
Copied

POST /v1/webhook-endpoints/{id}/rotate-secret

Send an Idempotency-Key header on every POST so a retry never repeats the request.

Parameters

  • id string required in path

Request body

application/json, required

object

Responses

200 Default Response

object

  • id string required
  • url string required
  • description string required (nullable)
  • enabled_events array of string required
  • status string required one of enabled, disabled
  • enabled_at string required (nullable)
  • last_test_at string required (nullable)
  • last_test_status integer required (nullable)
  • created_at string required
  • updated_at string required
  • version integer required
  • secret string 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 '{}'
Copied

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: {},
});
Copied

Edit on GitHub