Shifts Webhooks
Sent when shifts are added, updated, or removed.
If you need to access to shift data as soon as it is available:
- The
shifts.partially_synced
webhook is sent when shifts going back a specified number of days prior (starting from the date when the account was added) have been retrieved during initial data retrieval for a newly connected account. - The
shifts.fully_synced
webhook is sent when all shifts have been retrieved during initial data retrieval for a newly connected account.
Because some accounts can contain hundreds of shifts, we recommend subscribing to the shifts.partially_synced
webhook when especially time-sensitive. The shifts.fully_synced
webhook will only be sent when all shift data has been retrieved, which may take up to several hours in these cases.
#Added
The shifts.added
webhook is sent only when an account's data is refreshed (does not include initial data retrieval) and a new shift is retrieved.
- #eventsarray of stringsrequired
shifts.added
- #namestringrequired
Your name for the webhook subscription.
- #urlstringrequired
Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.
- #secretstringoptional
Optional secret used to verify webhooks.
- #eventstring
shifts.added
- #namestring
Name used for the webhook subscription.
- #dataobject
- #accountstring (uuid)
ID of the account.
- #userstring (uuid)
ID of the user.
- #available_fromstring (datetime)
Timestamp (ISO 8601) of the earliest available shift.
- #available_tostring (datetime)
Timestamp (ISO 8601) of the most recent shift.
- #available_countinteger
Number of shifts currently available for this account.
- #added_countinteger
Number of shifts retrieved during a data refresh.
- #added_fromstring (datetime)
Timestamp (ISO 8601) of the earliest shift retrieved during a data refresh.
- #added_tostring (datetime)
Timestamp (ISO 8601) of the most recent shift retrieved during a data refresh.
1curl --request POST \
2 --url https://api.argyle.com/v2/webhooks \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '{
6 "events": ["shifts.added"],
7 "name": "name-for-the-webhook-subscription",
8 "url": "https://your-webhook-backend.com",
9 "secret": "optional-secret"
10 }'
1{
2 "event": "shifts.added",
3 "name": "name-for-the-webhook-subscription",
4 "data": {
5 "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
6 "user": "018051aa-f7a9-a0db-2f38-6cfa325e9d69",
7 "available_from": "2016-04-16T05:32:41Z",
8 "available_to": "2023-03-03T00:00:00Z",
9 "available_count": 412,
10 "added_count": 6,
11 "added_from": "2023-03-02T00:00:00Z",
12 "added_to": "2023-03-03T00:00:00Z"
13 }
14}
#Updated
The shifts.updated
webhook is sent when there is any change to a property value of the shift object.
For example, after a shift is completed the shift object's status
value changes from in_progress
to completed
.
- #eventsarray of stringsrequired
shifts.updated
- #namestringrequired
Your name for the webhook subscription.
- #urlstringrequired
Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.
- #secretstringoptional
Optional secret used to verify webhooks.
- #eventstring
shifts.updated
- #namestring
Name used for the webhook subscription.
- #dataobject
- #accountstring (uuid)
ID of the account.
- #userstring (uuid)
ID of the user.
- #available_fromstring (datetime)
Timestamp (ISO 8601) of the account's earliest available shift.
- #available_tostring (datetime)
Timestamp (ISO 8601) of the account's most recent shift.
- #available_countinteger
Number of shifts currently available for this account.
- #updated_countinteger
Number of shifts updated.
- #updated_shiftsarray of strings (uuid's)
ID's of the updated shifts.
- #updated_fromstring (datetime)
Timestamp (ISO 8601) of the earliest updated shift.
- #updated_tostring (datetime)
Timestamp (ISO 8601) of the most recent updated shift.
1curl --request POST \
2 --url https://api.argyle.com/v2/webhooks \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '{
6 "events": ["shifts.updated"],
7 "name": "name-for-the-webhook-subscription",
8 "url": "https://your-webhook-backend.com",
9 "secret": "optional-secret"
10 }'
1{
2 "event": "shifts.updated",
3 "name": "name-for-the-webhook-subscription",
4 "data": {
5 "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
6 "user": "018051aa-f7a9-a0db-2f38-6cfa325e9d69",
7 "available_from": "2016-04-16T05:32:41Z",
8 "available_to": "2023-03-03T00:00:00Z",
9 "available_count": 412,
10 "updated_count": 2,
11 "updated_shifts": [
12 "0187b43a-35fa-56e2-1a95-f7e4232a4b3a",
13 "0187dbfa-6f5e-a33a-af26-7e12ff408fea"
14 ],
15 "updated_from": "2023-03-02T00:00:00Z",
16 "updated_to": "2023-03-03T00:00:00Z"
17 }
18}
#Removed
The shifts.removed
webhook is sent when a shift object has been deleted after a previous shift was not found when an account's data was refreshed.
- #eventsarray of stringsrequired
shifts.removed
- #namestringrequired
Your name for the webhook subscription.
- #urlstringrequired
Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.
- #secretstringoptional
Optional secret used to verify webhooks.
- #eventstring
shifts.removed
- #namestring
Name used for the webhook subscription.
- #dataobject
- #accountstring (uuid)
ID of the account.
- #userstring (uuid)
ID of the user.
- #available_fromstring (datetime)
Timestamp (ISO 8601) of the account's earliest available shift.
- #available_tostring (datetime)
Timestamp (ISO 8601) of the account's most recent shift.
- #available_countinteger
Number of shifts currently available for this account.
- #removed_countinteger
Number of shifts removed.
- #removed_shiftsarray of strings (uuid's)
ID's of the removed shifts.
- #removed_fromstring (datetime)
Timestamp (ISO 8601) of the earliest removed shift.
- #removed_tostring (datetime)
Timestamp (ISO 8601) of the most recent removed shift.
1curl --request POST \
2 --url https://api.argyle.com/v2/webhooks \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '{
6 "events": ["shifts.removed"],
7 "name": "name-for-the-webhook-subscription",
8 "url": "https://your-webhook-backend.com",
9 "secret": "optional-secret"
10 }'
1{
2 "event": "shifts.removed",
3 "name": "name-for-the-webhook-subscription",
4 "data": {
5 "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
6 "user": "018051aa-f7a9-a0db-2f38-6cfa325e9d69",
7 "available_from": "2016-04-16T05:32:41Z",
8 "available_to": "2023-03-02T00:00:00Z",
9 "available_count": 410,
10 "removed_count": 2,
11 "removed_shifts": [
12 "0187b43a-35fa-56e2-1a95-f7e4232a4b3a",
13 "0187dbfa-6f5e-a33a-af26-7e12ff408fea"
14 ],
15 "removed_from": "2023-03-02T00:00:00Z",
16 "removed_to": "2023-03-03T00:00:00Z"
17 }
18}
#Partially synced
The shifts.partially_synced
webhook is sent when shifts going back a specified number of days prior (starting from the date when the account was added) have been retrieved. By default, this period is set to 30 days.
You can subscribe to this webhook multiple times with different numbers of specified days.
Of note:
- This webhook is sent only during initial data retrieval (not ongoing refresh).
- If the number of shifts for an account is small and captured completely with only one data pull, this webhook will not be sent. Instead the
shifts.fully_synced
webhook will be sent.
- #eventsarray of stringsrequired
shifts.partially_synced
- #namestringrequired
Your name for the webhook subscription.
- #urlstringrequired
Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.
- #secretstringoptional
Optional secret used to verify webhooks.
- #configobjectoptional
"days_synced": <Integer>
specifies how many days of synced shifts (starting from the date of the most recent shift) are needed to trigger the webhook.
- #eventstring
shifts.partially_synced
- #namestring
Name used for the webhook subscription.
- #dataobject
- #accountstring (uuid)
ID of the account.
- #userstring (uuid)
ID of the user.
- #available_fromstring (datetime)
Timestamp (ISO 8601) of the account's earliest available shift from the synced time period.
- #available_tostring (datetime)
Timestamp (ISO 8601) of the account's most recent shift from the synced time period.
- #available_countinteger
Number of shifts currently available for this account at the time this webhook is sent.
- #days_syncedinteger
Number of days of synced shift events.
1curl --request POST \
2 --url https://api.argyle.com/v2/webhooks \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '{
6 "events": ["shifts.partially_synced"],
7 "name": "name-for-the-webhook-subscription",
8 "url": "https://your-webhook-backend.com",
9 "secret": "optional-secret",
10 "config": { "days_synced": 60 }
11 }'
1{
2 "event": "shifts.partially_synced",
3 "name": "name-for-the-webhook-subscription",
4 "data": {
5 "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
6 "user": "018051aa-f7a9-a0db-2f38-6cfa325e9d69",
7 "available_from": "2023-01-02T0:000:00Z",
8 "available_to": "2023-03-03T0:000:00Z",
9 "available_count": 97,
10 "days_synced": 60
11 }
12}
#Fully synced
The shifts.fully_synced
webhook is sent when all shifts have been retrieved from a newly connected payroll account.
- #eventsarray of stringsrequired
shifts.fully_synced
- #namestringrequired
Your name for the webhook subscription.
- #urlstringrequired
Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.
- #secretstringoptional
Optional secret used to verify webhooks.
- #eventstring
shifts.fully_synced
- #namestring
Name used for the webhook subscription.
- #dataobject
- #accountstring (uuid)
ID of the account.
- #userstring (uuid)
ID of the user.
- #available_fromstring (datetime)
Timestamp (ISO 8601) of the account's earliest available shift.
- #available_tostring (datetime)
Timestamp (ISO 8601) of the account's most recent shift.
- #available_countinteger
Number of shifts currently available for this account.
1curl --request POST \
2 --url https://api.argyle.com/v2/webhooks \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '{
6 "events": ["shifts.fully_synced"],
7 "name": "name-for-the-webhook-subscription",
8 "url": "https://your-webhook-backend.com",
9 "secret": "optional-secret"
10 }'
1{
2 "event": "shifts.fully_synced",
3 "name": "name-for-the-webhook-subscription",
4 "data": {
5 "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
6 "user": "018051aa-f7a9-a0db-2f38-6cfa325e9d69",
7 "available_from": "2016-04-16T05:32:41Z",
8 "available_to": "2023-03-02T00:00:00Z",
9 "available_count": 412
10 }
11}