Webhooks 请求
一旦有效的 hook 事件被触发,Logto 将找到相应的 webhooks,并根据每个 hook 配置发送一个 POST 请求。
请求头
| Key | Customizable | Notes |
|---|---|---|
| user-agent | ✅ | 默认是 Logto (https://logto.io/)。 |
| content-type | ✅ | 默认是 application/json。 |
| logto-signature-sha-256 | 请求体的签名,参考 保护你的 webhooks。 |
你可以通过使用相同的 key 自定义请求 头来覆盖可自定义的头。
交互 hook 事件请求体
可用事件:PostRegister,PostSignIn,PostResetPassword
请求体是一个包含三种类型数据字段的 JSON 对象:
type UserEntity = {
id: string;
username?: string;
primaryEmail?: string;
primaryPhone?: string;
name?: string;
avatar?: string;
customData?: object;
identities?: object;
lastSignInAt?: string;
createdAt?: string;
applicationId?: string;
isSuspended?: boolean;
};
type ApplicationEntity = {
id: string;
name: string;
description?: string;
};
| Field | Type | Optional | Notes |
|---|---|---|---|
| hookId | string | 在 Logto 中的标识符。 | |
| event | string |