Riferimento API
Endpoint webhook
Un endpoint webhook è un tuo URL che riceve gli eventi di Gemlead nel momento in cui accadono. Puoi averne 10 per account. Leggi Webhook per gli eventi, i loro payload e come verificare una firma.
L'oggetto endpoint webhook
Un tuo URL a cui Gemlead 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.createdlead.hotreply.receivedreaction.receivedsam.suggestion.readysam.reply.sentsam.handoff - statusstringSe gli vengono inviati gli eventi.
enableddisabled - filtersobjectQuali eventi riceve, in base alla buyer persona del lead. Si applicano a ogni tipo di evento.
- disabled_reasonstring o nullPerché è disattivato.
manualquando l'hai disattivato tu,failingquando l'ha fatto Gemlead dopo 3 giorni di errori di fila e almeno 8 tentativi falliti.nullquando è attivo.manualfailing - secretstringIl segreto di firma,
whsec_e 32 caratteri. Solo nelle risposte di creazione e di rinnovo del segreto. - created_atstringQuando è stato creato l'endpoint, ISO 8601.
- updated_atstringQuando l'endpoint è cambiato l'ultima volta, ISO 8601.
{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/gemlead",
"description": "CRM sync",
"events": ["lead.hot", "reply.received"],
"status": "enabled",
"filters": {
"persona_ids": ["lvWBPnytpS"]
},
"disabled_reason": null,
"created_at": "2026-09-14T09:21:05.300Z",
"updated_at": "2026-11-06T07:45:12.904Z"
}Elenca gli endpoint webhook
readRestituisce i tuoi endpoint webhook, senza i loro segreti.
Parametri di query
- limitintegerQuanti oggetti restituire, da 1 a 100. Di default 25.
- cursorstringIl
next_cursordella pagina precedente, per avere la pagina successiva. Vedi Paginazione.
Restituisce
Un elenco di oggetti endpoint webhook.
curl https://gemlead.ai/api/v1/webhook_endpoints \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "list",
"data": [
{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/gemlead",
"description": "CRM sync",
"events": ["lead.hot", "reply.received"],
"status": "enabled",
"filters": {
"persona_ids": ["lvWBPnytpS"]
},
"disabled_reason": null,
"created_at": "2026-09-14T09:21:05.300Z",
"updated_at": "2026-11-06T07:45:12.904Z"
}
],
"has_more": false,
"next_cursor": null
}Crea un endpoint webhook
writeRegistra 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 raggiungibile da internet.
- eventsarray di stringsObbligatorioI tipi di evento da inviare.
lead.createdlead.hotreply.receivedreaction.receivedsam.suggestion.readysam.reply.sentsam.handoff - descriptionstringUna nota per te.
- filtersobjectQuali eventi inviare, in base alla buyer persona del lead.
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.
paramlo indica. - Il body ha un campo che questo endpoint non accetta.
- 400url_invalidL'URL non è HTTPS, contiene credenziali o punta a un indirizzo privato.
- L'account ha già 10 endpoint.
curl -X POST https://gemlead.ai/api/v1/webhook_endpoints \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/gemlead",
"events": ["lead.hot", "reply.received"],
"description": "CRM sync",
"filters": {
"persona_ids": ["lvWBPnytpS"]
}
}'{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/gemlead",
"description": "CRM sync",
"events": ["lead.hot", "reply.received"],
"status": "enabled",
"filters": {
"persona_ids": ["lvWBPnytpS"]
},
"disabled_reason": null,
"created_at": "2026-09-14T09:21:05.300Z",
"updated_at": "2026-11-06T07:45:12.904Z",
"secret": "whsec_4QeX7nP2kR9tLm3Vb8YzC1dF6hJ0sWuA"
}Recupera un endpoint webhook
readRestituisce un endpoint webhook, senza il suo segreto.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Restituisce
Errori
- Nessun endpoint webhook con questo ID sull'account della chiave.
curl https://gemlead.ai/api/v1/webhook_endpoints/wh3LpX9dKe \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/gemlead",
"description": "CRM sync",
"events": ["lead.hot", "reply.received"],
"status": "enabled",
"filters": {
"persona_ids": ["lvWBPnytpS"]
},
"disabled_reason": null,
"created_at": "2026-09-14T09:21:05.300Z",
"updated_at": "2026-11-06T07:45:12.904Z"
}Aggiorna un endpoint webhook
writeModifica un endpoint. Imposta status su enabled per riattivare un endpoint che Gemlead ha disattivato. Riattivarlo o dargli un nuovo url fa ripartire il conteggio degli errori.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Parametri del body
- urlstringUn nuovo URL HTTPS.
- eventsarray di stringsI tipi di evento da inviare.
lead.createdlead.hotreply.receivedreaction.receivedsam.suggestion.readysam.reply.sentsam.handoff - descriptionstringUna nota per te.
- statusstringAttiva o disattiva l'endpoint.
enableddisabled - filtersobjectQuali eventi inviare, in base alla buyer persona del lead.
Restituisce
L'oggetto endpoint webhook aggiornato.
Errori
- Nessun endpoint webhook con questo ID sull'account della chiave.
- Un parametro ha un valore che l'API non accetta.
paramlo indica. - Il body ha un campo che questo endpoint non accetta.
- 400url_invalidL'URL non è HTTPS, contiene credenziali o punta a un indirizzo privato.
curl -X PATCH \
https://gemlead.ai/api/v1/webhook_endpoints/wh3LpX9dKe \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "enabled"
}'{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/gemlead",
"description": "CRM sync",
"events": ["lead.hot", "reply.received"],
"status": "enabled",
"filters": {
"persona_ids": ["lvWBPnytpS"]
},
"disabled_reason": null,
"created_at": "2026-09-14T09:21:05.300Z",
"updated_at": "2026-11-06T07:45:12.904Z"
}Elimina un endpoint webhook
writeElimina un endpoint. Le consegne ancora in attesa di un nuovo tentativo vengono scartate.
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 sull'account della chiave.
curl -X DELETE \
https://gemlead.ai/api/v1/webhook_endpoints/wh3LpX9dKe \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"deleted": true
}Rinnova il segreto di firma
writeSostituisce subito il segreto dell'endpoint, e quello vecchio smette di funzionare. Le consegne che falliscono nel frattempo vengono ritentate, firmate con il nuovo segreto.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Restituisce
L'oggetto endpoint webhook con il suo nuovo secret.
Errori
- Nessun endpoint webhook con questo ID sull'account della chiave.
curl -X POST \
https://gemlead.ai/api/v1/webhook_endpoints/wh3LpX9dKe/roll_secret \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "wh3LpX9dKe",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/gemlead",
"description": "CRM sync",
"events": ["lead.hot", "reply.received"],
"status": "enabled",
"filters": {
"persona_ids": ["lvWBPnytpS"]
},
"disabled_reason": null,
"created_at": "2026-09-14T09:21:05.300Z",
"updated_at": "2026-11-06T07:45:12.904Z",
"secret": "whsec_4QeX7nP2kR9tLm3Vb8YzC1dF6hJ0sWuA"
}Invia un evento di test
writeInvia un evento di esempio del primo tipo di evento dell'endpoint, con data.test impostato su true e ID che iniziano con test_. Un solo tentativo, senza ripetizioni.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Restituisce
Un oggetto consegna webhook con lo status e lo status_code con cui ha risposto il tuo endpoint.
Errori
- Nessun endpoint webhook con questo ID sull'account della chiave.
curl -X POST \
https://gemlead.ai/api/v1/webhook_endpoints/wh3LpX9dKe/test \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "dL5qW1zXa8",
"object": "webhook_delivery",
"endpoint_id": "wh3LpX9dKe",
"event_id": "evt_8kQ2vXr4LmT9wPz1Hc6YbN3d",
"event_type": "lead.hot",
"status": "succeeded",
"attempts": 1,
"status_code": 200,
"error": null,
"test": true,
"next_attempt_at": null,
"last_attempt_at": "2026-11-06T07:45:12.904Z",
"created_at": "2026-11-06T07:45:12.904Z"
}L'oggetto consegna webhook
Un evento inviato a un endpoint, con i suoi tentativi e l'ultima risposta del tuo server.
Attributi
- idstringIdentificatore univoco della consegna.
- objectstringSempre
webhook_delivery. - endpoint_idstringL'endpoint a cui è stato inviato.
- event_idstringL'evento inviato, l'
idricevuto dal tuo server. - event_typestringIl tipo dell'evento.
lead.createdlead.hotreply.receivedreaction.receivedsam.suggestion.readysam.reply.sentsam.handoff - statusstring
pendingfinché restano tentativi, poisucceededofailed.pendingsucceededfailed - attemptsintegerTentativi fatti finora, al massimo 8.
- status_codeinteger o nullLo stato HTTP della tua ultima risposta.
nullquando non c'è stata, dopo un timeout o un errore di connessione. - errorstring o nullCosa è andato storto all'ultimo tentativo, come lo stato e l'inizio della tua risposta, oppure un timeout.
- testboolean
trueper un evento di test. - next_attempt_atstring o nullQuando è previsto il prossimo tentativo, finché è
pending. - last_attempt_atstring o nullQuando è stato fatto l'ultimo tentativo.
- created_atstringQuando è stata creata la consegna, ISO 8601.
{
"id": "dR7mK2pVn4",
"object": "webhook_delivery",
"endpoint_id": "wh3LpX9dKe",
"event_id": "evt_3Hn7QpW2xZk9LmR4tV8bYc1D",
"event_type": "reply.received",
"status": "pending",
"attempts": 2,
"status_code": 503,
"error": "HTTP 503: Service Unavailable",
"test": false,
"next_attempt_at": "2026-11-06T08:18:10.000Z",
"last_attempt_at": "2026-11-06T08:13:10.000Z",
"created_at": "2026-11-06T08:12:10.000Z"
}Elenca le consegne
readRestituisce le ultime consegne dell'endpoint, dalla più recente, eventi di test compresi. Le consegne vengono conservate 30 giorni.
Parametri di percorso
- idstringObbligatorioL'ID dell'endpoint webhook.
Parametri di query
- limitintegerQuante consegne restituire, da 1 a 100. 25 di default.
Restituisce
Un elenco di oggetti consegna webhook. Questo elenco non ha next_cursor, aumenta limit per vederne di più.
Errori
- Nessun endpoint webhook con questo ID sull'account della chiave.
- Un parametro ha un valore che l'API non accetta.
paramlo indica.
curl -G \
https://gemlead.ai/api/v1/webhook_endpoints/wh3LpX9dKe/deliveries \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-d limit=10{
"object": "list",
"data": [
{
"id": "dR7mK2pVn4",
"object": "webhook_delivery",
"endpoint_id": "wh3LpX9dKe",
"event_id": "evt_3Hn7QpW2xZk9LmR4tV8bYc1D",
"event_type": "reply.received",
"status": "pending",
"attempts": 2,
"status_code": 503,
"error": "HTTP 503: Service Unavailable",
"test": false,
"next_attempt_at": "2026-11-06T08:18:10.000Z",
"last_attempt_at": "2026-11-06T08:13:10.000Z",
"created_at": "2026-11-06T08:12:10.000Z"
},
{
"id": "dL5qW1zXa8",
"object": "webhook_delivery",
"endpoint_id": "wh3LpX9dKe",
"event_id": "evt_8kQ2vXr4LmT9wPz1Hc6YbN3d",
"event_type": "lead.hot",
"status": "succeeded",
"attempts": 1,
"status_code": 200,
"error": null,
"test": true,
"next_attempt_at": null,
"last_attempt_at": "2026-11-06T07:45:12.904Z",
"created_at": "2026-11-06T07:45:12.904Z"
}
],
"has_more": false,
"next_cursor": null
}