Endpoint settings
An organisation can have up to 20 endpoints, and so can an account. That is plenty for most integrations: one endpoint per receiving system is the usual pattern.
Send every setting that has named values, such as
payloadStyle, ordering and status, by name. A number in their place is refused.
Create, read, change and delete
A
201 answer carries a Location header with the new endpoint’s address.
Ids are prefixed so you can tell them apart: endpoints start ep_, events evt_, deliveries dlv_, signing secrets sec_ and replays rpl_. The rest of an id is a sortable, time-based code, so ids created later sort after earlier ones.
Change settings
PATCH /endpoints/{endpointId} takes a JSON Merge Patch (RFC 7396):
- a field you leave out stays as it is;
- a field you send as
nullis removed; - any other value replaces it.
eventTypes, organisationIds, excludedOrganisationIds and alertContacts replace the whole list. They change the same lists as the endpoint’s event-types, organisations, excluded-organisations and alert-contacts resources, which add and remove single entries. Use those to add or remove one entry without resending the rest.
Two changes to the same endpoint, or to the same default alert-contact list, at the same moment both apply. If the endpoint keeps changing under your request, you get a 409 with concurrent_change; send the request again.
Signing secret and public key
Creating an endpoint answers with the endpoint and two values for checking its deliveries:
You need only one of them, and the public key is recommended: your receiver then holds nothing that could sign a fake delivery. Each rotation issues a new secret and a new public key together. See Verify signatures.
Subscriptions
eventTypes holds up to 100 values of three kinds, which you can mix:
- an exact type, such as
payslip.finalised; - a family, such as
payslip.*, meaning every event whose name startspayslip., including ones added later; *, meaning every event.
A remove answers with what it removed. Removing a type the endpoint does not have is a
404, so a typo does not look like success. An endpoint always keeps at least one type: to stop all deliveries, pause it or delete it.
Custom headers
If your receiver sits behind its own gateway that expects, say, anAuthorization or X-Api-Key header, add it as a custom header and Flow Payroll sends it with every delivery:
- Up to 10 headers, each value up to 1,024 characters.
- Values are stored encrypted and never shown again. The endpoint shows only their names, in
customHeaderNames. PATCHwithcustomHeadersreplaces them all; sendnullor{}to remove them.- You cannot set
Host,Content-Length,Content-Type,Transfer-Encoding,X-Request-Id, or any header startingwebhook-orX-Flow-: Flow Payroll sets those itself.
Alert emails
When an endpoint has been failing for a day, and again if Flow Payroll disables it, we email the people who can fix it. You choose who that is, once for all your endpoints or per endpoint. For each email we use the first of these that has any addresses:- The endpoint’s own alert contacts,
alertContactson the endpoint. - The organisation’s default alert contacts, for an endpoint that belongs to one organisation.
- The account’s default alert contacts, shared by every organisation on the account.
- Otherwise, whoever created the endpoint and the account owner. An endpoint created with an API token has no person behind it, so only the account owner is told.
Who is actually emailed
Every alert-contacts response carries the list set at that level (emails, empty when it is not set) and who is actually emailed (effective):
A level is either set or not set. Removing its last address, or replacing its list with
[], clears it, and it inherits from the next level again.
Defaults for an organisation or the account
These act on the organisation you are signed in to. Add
scope=customer to act on the account’s defaults instead, which needs account-wide access, as account-wide endpoints do. A change applies to every endpoint straight away; allow a minute before the next email uses it.
One endpoint’s list
You can also set
alertContacts when you create the endpoint, or with PATCH /endpoints/{endpointId}.
Rules for every list
- Up to 10 addresses. Each must be a single plain address, such as
ops@example.com: no names, and no lists in one entry. - Addresses are stored in lower case, and a duplicate is kept once.
- A remove answers with what it removed. Removing an address the list does not have is a
404. - Removing the last address, or sending an empty list, hands over to the next level.
Pause and resume
PATCH /endpoints/{endpointId} with {"status": "Paused"} stops deliveries, for example while you deploy a new receiver. Events that happen meanwhile are recorded as Skipped rather than queued, so nothing floods in when you resume. Set {"status": "Active"} to resume, then replay the window with "statuses": ["Skipped"] if you want what you missed.
When Flow Payroll disables an endpoint
An endpoint that has failed every delivery for five days in a row, or that answered410 Gone, is set to DisabledBySystem, and statusReason says which (failing_for_5_days or endpoint_gone). New events are recorded as Skipped. To bring it back, fix the receiver and set {"status": "Active"}. See When an endpoint keeps failing.
Make requests safe to retry
Send anIdempotency-Key header, a unique value you choose such as a UUID, when you create an endpoint, rotate a secret, resend a delivery or start a replay. If the request times out and you send it again with the same key and the same body within 24 hours, you get the first answer back instead of a second endpoint. The same key sent by someone else, or with a different body, is a 409 with idempotency_key_reused.
Scope values
Wherever a route takesscope, send organisation (the default) or customer. GET /endpoints also takes all. Any other value is a 400 with invalid_scope.