# Webhooks

Moment has a number of webhooks available for you to be used when there is a need to get information about changes happening in Moment.

### Current

* [Claims](https://docs.milientsoftware.com/help/moment-by-topic/integrations/webhooks/claims)
* [Customers](https://docs.milientsoftware.com/help/moment-by-topic/integrations/webhooks/customers)
* [Invoices](https://docs.milientsoftware.com/help/moment-by-topic/integrations/webhooks/invoices)
* [Offers](https://docs.milientsoftware.com/help/moment-by-topic/integrations/webhooks/offers)
  * Changes
  * Decisions (Accepted/Declined)
* [Projects](https://docs.milientsoftware.com/help/moment-by-topic/integrations/webhooks/projects)

For all of these, when there are changes to object, the webhook is triggered. For offers there is also one specific to be triggered just when an offer is accepted or declined.

### Configuration

To take advantage of webhooks in Moment, go to Setup > Settings > Integrations. Click on the button "+ New integration".

![](https://497021537-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsGm2gYUXX6xCfrrWgU%2F-MfgJ6QfEDwj_iDkn_7h%2F-MfgjlGx6AatYK0TvyCa%2Fimage.png?alt=media\&token=8a785c3f-c34e-40b6-82c8-0d947e786102)

Select the webhook that you want to use, these are listed one by one. In the example below, customers is selected. Enter the URL where you want the POST notification to be sent when changes occur.

![](https://497021537-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsGm2gYUXX6xCfrrWgU%2F-MfgJ6QfEDwj_iDkn_7h%2F-MfgkXk7KA8Cs35XlSFR%2Fimage.png?alt=media\&token=9f67fc92-a495-403a-908c-3ced1f558388)

{% hint style="success" %}
Tip: An easy way of testing webhooks is to set up a temporary Request Bin on <https://requestbin.com/> .
{% endhint %}

### How to use

Moment will send HTTP POST messages to the URL that has been configured when any elements of the selected type is updated. The information provided is limited, but will give you enough information as to make an API call to fetch updated information.

#### Example:&#x20;

#### Invoice is finalized

A common use case for webhooks is when you want to register invoices in an accounting system as soon as they are finalized in Moment. After setting up the webhook integration, you will get a POST containing some basic information whenever an invoice is finalized:

```javascript
{
    "event": "CREATE_NEW",
    "invoice": {
        "id": 106939080,
        "invoiceNumber": 1,
        "customer": {
            "id": 62788973,
            "customerNumber": "10001"
        },
        "project": {
            "id": 62788980,
            "projectNumber": "1"
        }
    }
}
```

You can use this information to update your accounting system by fetching the invoice data from our invoice API endpoint (see detailed documentation [here](https://app.moment.team/api/1.0/docs/#/Invoices/getOneAsDtoRequestUsingGET_1)), using the id from the webhook (106939080):

Create a GET request with this URL:

```javascript
https://app.moment.team/api/1.0/companies/{yourcompany}/invoices/10693908
```

See the example for result in our swagger documentation [here](https://app.moment.team/api/1.0/docs/#/Invoices/getOneAsDtoRequestUsingGET_8).


---

# Agent Instructions: 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:

```
GET https://docs.milientsoftware.com/help/moment-by-topic/integrations/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
