Riferimento API
Endpoint webhook
Un endpoint webhook è un tuo URL che riceve gli eventi di Okaymate nel momento in cui accadono. Un'attività può averne 10. Leggi Webhook per gli eventi, i loro payload e come verificare una firma.
L'oggetto endpoint webhook
Un tuo URL a cui Okaymate invia gli eventi. Vedi Webhook per gli eventi e come verificarli.
Attributi
- idstringIdentificatore univoco dell'endpoint.
- objectstringSempre
webhook_endpoint. - urlstringL'URL HTTPS a cui vengono inviati gli eventi.
- descriptionstring o nullLa tua nota sull'endpoint.
- eventsarray di stringsI tipi di evento che riceve.
lead.createdmessage.receivedmessage.sent - statusstringSe gli vengono inviati gli eventi.
enableddisabled - created_atstringQuando è stato creato l'endpoint, ISO 8601.
- last_deliveryobject o nullL'ultimo evento che gli è stato inviato,
nullprima del primo. - secretstringIl segreto di firma,
whsec_e 32 caratteri. Solo nella risposta di creazione, mostrato una sola volta.
{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/okaymate",
"description": "Helpdesk sync",
"events": ["lead.created", "message.received"],
"status": "enabled",
"created_at": "2026-11-02T10:14:22.000Z",
"last_delivery": {
"status": "succeeded",
"at": "2026-11-24T09:12:44.000Z",
"status_code": 200
}
}Elenca gli endpoint webhook
Restituisce gli endpoint webhook dell'attività, dal più recente, senza i loro segreti.
Restituisce
Un elenco di oggetti endpoint webhook. has_more è sempre false.
curl https://okaymate.ai/api/v1/webhook_endpoints \
-H "Authorization: Bearer $OKAYMATE_API_KEY"{
"object": "list",
"data": [
{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/okaymate",
"description": "Helpdesk sync",
"events": ["lead.created", "message.received"],
"status": "enabled",
"created_at": "2026-11-02T10:14:22.000Z",
"last_delivery": {
"status": "succeeded",
"at": "2026-11-24T09:12:44.000Z",
"status_code": 200
}
}
],
"has_more": false,
"next_cursor": null
}Crea un endpoint webhook
Registra un URL per uno o più tipi di evento. Salva il secret della risposta, perché è l'unica volta che lo vedrai.
Parametri del body
- urlstringObbligatorioUn URL HTTPS su un indirizzo pubblico.
- eventsarray di stringsObbligatorioI tipi di evento da inviare.
lead.createdmessage.receivedmessage.sent - descriptionstringUna nota per te.
Restituisce
Il nuovo oggetto endpoint webhook con il suo secret.
Errori
- Manca un parametro obbligatorio.
paramlo indica. - Un parametro ha un valore che l'API non accetta, come un URL che non è HTTPS o che punta a un indirizzo privato, oppure l'attività ha già 10 endpoint.
paramlo indica.
curl -X POST https://okaymate.ai/api/v1/webhook_endpoints \
-H "Authorization: Bearer $OKAYMATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/okaymate",
"events": ["lead.created", "message.received"],
"description": "Helpdesk sync"
}'{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/okaymate",
"description": "Helpdesk sync",
"events": ["lead.created", "message.received"],
"status": "enabled",
"created_at": "2026-11-24T09:20:03.000Z",
"last_delivery": null,
"secret": "whsec_4QeX7nP2kR9tLm3Vb8YzC1dF6hJ0sWuA"
}Recupera un endpoint webhook
Restituisce un endpoint webhook, senza il suo segreto.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Restituisce
Errori
- Nessun endpoint webhook con questo ID nell'attività.
curl https://okaymate.ai/api/v1/webhook_endpoints/wh3LpX9dKe \
-H "Authorization: Bearer $OKAYMATE_API_KEY"{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/okaymate",
"description": "Helpdesk sync",
"events": ["lead.created", "message.received"],
"status": "enabled",
"created_at": "2026-11-02T10:14:22.000Z",
"last_delivery": {
"status": "succeeded",
"at": "2026-11-24T09:12:44.000Z",
"status_code": 200
}
}Aggiorna un endpoint webhook
Modifica un endpoint. Cambiano solo i campi che invii. Un endpoint disattivato non riceve eventi.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Parametri del body
- urlstringUn nuovo URL HTTPS.
- eventsarray di stringsI tipi di evento da inviare.
lead.createdmessage.receivedmessage.sent - descriptionstringUna nota per te.
- statusstringAttiva o disattiva l'endpoint.
enableddisabled
Restituisce
L'oggetto endpoint webhook aggiornato.
Errori
- Nessun endpoint webhook con questo ID nell'attività.
- Un parametro ha un valore che l'API non accetta.
paramlo indica.
curl -X PATCH \
https://okaymate.ai/api/v1/webhook_endpoints/wh3LpX9dKe \
-H "Authorization: Bearer $OKAYMATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "disabled"
}'{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/okaymate",
"description": "Helpdesk sync",
"events": ["lead.created", "message.received"],
"status": "disabled",
"created_at": "2026-11-02T10:14:22.000Z",
"last_delivery": {
"status": "succeeded",
"at": "2026-11-24T09:12:44.000Z",
"status_code": 200
}
}Elimina un endpoint webhook
Elimina un endpoint. Non riceve più eventi.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Restituisce
Un oggetto con l'id dell'endpoint e deleted impostato su true.
Errori
- Nessun endpoint webhook con questo ID nell'attività.
curl -X DELETE \
https://okaymate.ai/api/v1/webhook_endpoints/wh3LpX9dKe \
-H "Authorization: Bearer $OKAYMATE_API_KEY"{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"deleted": true
}Invia un evento di test
Invia subito all'endpoint un evento message.received di esempio, con test impostato su true. Un solo tentativo, senza ripetizioni.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Restituisce
Un oggetto con lo status della consegna, succeeded o failed, e lo status_code con cui ha risposto il tuo endpoint.
Errori
- Nessun endpoint webhook con questo ID nell'attività.
curl -X POST \
https://okaymate.ai/api/v1/webhook_endpoints/wh3LpX9dKe/test \
-H "Authorization: Bearer $OKAYMATE_API_KEY"{
"status": "succeeded",
"status_code": 200
}