Create a webhook
Registers an HTTPS endpoint for the events you list. It receives only events you yourself
may see. The answer carries the signing secret — the only time it is shown; store it.
At most 10 endpoints per person per workspace.
Authorization
personalToken Your personal access token from Profile → Access Token in Lalexi. It acts with exactly your role: what you may see and do in the workspace, and nothing more. Everything done with it is recorded as done by you.
In: header
Header Parameters
The workspace to work in (an id from GET /me). Optional when you belong to a single
workspace; required otherwise (400 workspace_required).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.lalexi.com/v1/webhooks" \ -H "X-Workspace-Id: 7" \ -H "Content-Type: application/json" \ -d '{ "url": "https://crm.example.com/hooks/lalexi", "events": [ "message.created", "conversation.updated" ] }'{
"id": 0,
"url": "http://example.com",
"events": [
"message.created"
],
"active": true,
"consecutive_failures": 0,
"last_delivery_at": "2019-08-24T14:15:22Z",
"last_status": 0,
"last_error": "string",
"created_at": "2019-08-24T14:15:22Z",
"secret": "string"
}{
"error": {
"code": "workspace_required",
"message": "You belong to several workspaces: pass the X-Workspace-Id header."
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is missing or invalid."
}
}{
"error": {
"code": "forbidden",
"message": "You are not allowed to do this."
}
}{
"error": {
"code": "not_found",
"message": "Resource not found."
}
}{
"error": {
"code": "validation_failed",
"message": "The request is invalid.",
"details": {
"email": [
"is invalid"
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the number of seconds in Retry-After."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}