Connecting Zapier, Make or your own software with API keys and webhooks
On the Business plan you can let other software read and add your records, and tell it when something happens. A key lets a program use your account without a password. A webhook is a web address we send a message to when something happens, so another tool can act at once. It is for tools like Zapier and Make, or software you or a developer write.
Make a key. An owner opens Settings, then Open API and webhooks.
- Under API keys, give the tool a name, such as the tool it is for.
- Choose the access: Read only can look but never change anything, and Read and write can add and change records.
- Choose Make a key and copy it straight away. It is shown only once.
- Give each tool its own key, so you can Revoke one without breaking the others.
Use it. Send the key as a header, Authorization: Bearer YOUR_KEY, to your company's address followed by /api/v1. The page shows the exact address and an example. Answers are JSON, lists come newest first 25 to a page, and ?updated_since= keeps only what changed since a time. Money is in pence, and a key is limited to 120 calls a minute. You can list and add clients and leads, list and schedule visits, list repeating bookings, list invoices, make and send quotes, and list and record payments. The page lists every call and what it needs.
Add a webhook. Under Webhooks, enter the address to send to (it must be https), tick the events you want, and choose Add webhook. The events are a client added, a lead added, a visit marked done, an invoice issued and an invoice paid in full. Choose Send a test to check it arrives.
Check a message is ours. Each message is a POST of JSON with an id, the event, the time and the record. Its headers include Gleam-Event, Gleam-Delivery (a unique id, so you can ignore a repeat) and Gleam-Signature. To check the signature, compute the HMAC-SHA256 of the time, a full stop and the raw body using the webhook's secret, in hex, compare it with the v1 value, and reject a message more than five minutes old. Answer with any 2xx within 10 seconds. If you do not, we try again after 1 minute, 5 minutes, 30 minutes and 2 hours.
If it keeps failing. A webhook that fails 20 times in a row is switched off. Fix the address, then choose Switch on. You can also switch one off, or remove it, at any time.