> For the complete documentation index, see [llms.txt](https://docs.opencityitalia.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opencityitalia.it/sviluppatori-e-partner-tecnologici/integrazioni/integrazioni-con-il-flusso-delle-pratiche/webhooks.md).

# Webhooks

Le API non sono sufficienti per realizzare una buona integrazione tra due sistemi. Se due o più sistemi si devono aggiornare reciprocamente in base agli eventi che avvengono al proprio interno, è necessario che periodicamente ogni sistema interroghi gli altri per sapere se il loro stato è cambiato: questo approccio si chiama anche *polling*. Questo è molto oneroso e introduce un ritardo nell'aggiornamento che è tanto maggiore quanto maggiore è l'intervallo con cui un sistema interroga gli altri. D'altra parte se di intensifica la frequenza del polling si avranno maggiori costi a fronte di aggiornamenti magari poco frequenti.

Un modo più efficiente di far dialogare due sistemi è avviare una comunicazione in occasione di cambiamenti rilevanti per il sistema in ascolto e per ottenere questo, eliminando del tutto la necessità di fare *polling*, è possibile usare i Webhook.

Ogni webhook consente di inviare un aggiornamento a una API di un altro sistema che sta ascolto, in base agli eventi che si desidera comunicare.

<figure><img src="https://lh4.googleusercontent.com/e8exe7gAkCIrDo_juCe8vuZ5pE7gZgMFWfK_fROBlBNIkfKD0yZ65HMrklHda34nrUp0L3DH8yBkKbmpHOw54zGvHwSOgkknOxLqtQX70WLZAsWHKqh2h2eKLvJaH-8owANzR1yOLPDGRYw5ye6YcxuBkQ=s2048" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/UtwPk5jvScC-tzrIp7qJPOeaQO0XYcnzfCZduBeuMYgHXEKXrSaE_URtx_lGNIUo-3itJ1xB1H0T8b17plvQeA4G3_gzJzLahxOS9rc55yIXOQT4Z8eylLSoJ2Cyjt3ISXVSH9fKeWsPMwtXb5qDOj6zRQ=s2048" alt=""><figcaption></figcaption></figure>

Per fare test sui webhook si consiglia di utilizzare un servizio come [Request Inspector](https://link.opencitylabs.it/request-inspector?utm_source=opencitylabs\&utm_medium=gitbook).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.opencityitalia.it/sviluppatori-e-partner-tecnologici/integrazioni/integrazioni-con-il-flusso-delle-pratiche/webhooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
