Webhooks

Get notified when something in Moment has changed.

While the API allows you to extract pretty much anything you want from Moment, it doesn't provide you with a way of knowing when something has changed. You can use the Webhook integration for this.

Setup

Add the integration in Moment in Setup -> Settings -> Integrations:

Tip: An easy way of testing webhooks is to set up a temporary Request Bin on https://requestbin.com/ .

Receiving webhooks

Once configured, Moment will make an HTTP POST to the configured URL when any of the selected element types are updated. It's up to you, the receiver, to react on this information. The information in the POST request is quite limited, but will allow you to make new calls to our API to fetch the updated information.

Example: When an 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:

{
"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), using the id from the webhook (106939080):

get
Get a single invoice

https://app.moment.team/api/1.0/companies/{company}/invoices/{id}
Request
Response
Request
Path Parameters
id
required
string
Invoice id (106939080)
company
required
string
Company code
Response
200: OK