跳转到主要内容
POST
/
v2
/
webhook
/
endpoint
端点 - 创建
curl --request POST \
  --url https://api.chainstream.io/v2/webhook/endpoint \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://example.com",
  "channels": [
    "sol.token.migrated"
  ],
  "description": "Webhook description",
  "disabled": false,
  "filter": "<string>",
  "filterTypes": [
    "<string>"
  ],
  "metadata": {
    "key": "value"
  },
  "rateLimit": 1000,
  "secret": "<string>"
}
'
{
  "id": "ep_01HT7Z4QJ7N2Q9W8P6V3K5M1X2",
  "url": "https://example.com",
  "channels": [
    "sol.token.migrated"
  ],
  "createdAt": "2021-01-01T00:00:00.000Z",
  "description": "Webhook description",
  "disabled": false,
  "filter": "<string>",
  "filterTypes": [
    "<string>"
  ],
  "metadata": {
    "key": "value"
  },
  "rateLimit": 1000,
  "updatedAt": "2021-01-01T00:00:00.000Z"
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json

Request to create a webhook endpoint

url
string
必填

Webhook 目标 URL

示例:

"https://example.com"

channels
enum<string>[] | null

订阅的 Webhook 事件通道

Webhook event channel

可用选项:
sol.token.migrated,
sol.token.created
description
string | null

端点描述

示例:

"Webhook description"

disabled
boolean | null

端点是否已禁用

示例:

false

filter
string | null

事件筛选配置

filterTypes
string[] | null

事件类型筛选

metadata
object

端点元数据

示例:
{ "key": "value" }
rateLimit
integer<int32> | null

端点速率限制

必填范围: x >= 0
示例:

1000

secret
string | null

端点签名密钥

响应

200 - application/json

成功响应

Webhook endpoint response

id
string
必填

端点内部 ID

示例:

"ep_01HT7Z4QJ7N2Q9W8P6V3K5M1X2"

url
string
必填

Webhook 目标 URL

示例:

"https://example.com"

channels
enum<string>[] | null

订阅的 Webhook 事件通道

Webhook event channel

可用选项:
sol.token.migrated,
sol.token.created
createdAt
string | null

端点创建时间戳

示例:

"2021-01-01T00:00:00.000Z"

description
string | null

端点描述

示例:

"Webhook description"

disabled
boolean | null

端点是否已禁用

示例:

false

filter
string | null

事件筛选配置

filterTypes
string[] | null

事件类型筛选

metadata
object

端点元数据

示例:
{ "key": "value" }
rateLimit
integer<int32> | null

端点速率限制

必填范围: x >= 0
示例:

1000

updatedAt
string | null

端点最后更新时间戳

示例:

"2021-01-01T00:00:00.000Z"