Webhooks
Introduction
It’s possible to retrieve change-events of paid presences with webhooks.
Caution
Read the Webhooks page. There is important information on required implementation!
Tip
Check the Swagger page for more technical information on the endpoints.
Endpoint details
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks
Body properties
This list of properties is applicable for this endpoint.
| Property | Type | Description |
|---|---|---|
destinationUrl |
string | The URL where webhook notifications will be sent. |
collectionName |
string | The name of the collection to subscribe to (paid-presences). |
Event properties
This list of properties is posted to your consumer endpoint when a paid presence changes.
| Property | Type | Description |
|---|---|---|
changeVersion |
string | Property to indicate the order of changes. |
id |
integer | Unique identifier for the paid presence record (read-only). |
person.id |
integer | Internal ID of the person for whom this paid presence applies. |
date |
string | Date for which the paid presence is recorded (YYYY-MM-DD). |
durationInMinutes |
integer | Duration of the paid presence in minutes. |
shiftDefinition.id |
integer | Internal ID of the linked shift definition (optional). |
External references
It’s possible to use predefined external references and custom external references. More information can be found on the External References Page
For a list of predefined external references, see the external reference options section.
Note
Check the query options below the endpoint on the Swagger page for the relevant external references.
Good to know
Multiple instances per day
Unlike calculated totals which return a single record per person per day, paid presences can return multiple records for the same person on the same date. This happens when the paid presence is divided across multiple shifts based on the configuration in myProtime.
When paid presences change, you may receive multiple webhook events for the same person and date if they have multiple shift assignments.
Shift definition behaviour
The shiftDefinition is optional and will be included when the paid presence is associated with a specific shift. If no shift is assigned, this field will be omitted from the webhook event payload.
Examples
Creating a webhook for paid presences
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/webhooks
{
"destinationUrl": "https://www.fictional-customer.com/protime/paid-presences",
"collectionName": "paid-presences"
}