post https://services.fountain.com/api/serviceattendance/processes/demand/bulkCreate
The bulk demand creation endpoint was designed to create daily demand for a given period, location, and role.
Fields
Here's a description of the fields allowed for the endpoint:
externalId (string)(optional)
: the id of the demand from an external service.name (string)(optional)
: the demand name.locationUuid (string)
: the uuid of the location to create the demand in.jobUuid (string)
: the uuid of the job to create the demand for.startDate (string)
: date to start creating demand.endDate (string)
: date to stop creating demand.daysOfWeek (number[])
: The days of the week to create the demand in (0 is Sunday, 6 is Saturday)headcountChanges (array)
: The headcount changes across the day (at least one change is required)startTime (string)
: The time in which the headcount change takes place. The date from the datetime string is not important. Only the datetime is.endTime (string)(optional - will default to EOD if not provided)
: The time in which the headcount change ends. The date from the datetime string is not important. Only the datetime is.minimumHeadcount (number)
: The minimum headcount of the change. 0 is the minimum.maximumHeadcount (number)(optional)
: The maximum headcount of the change. 0 is the minimum.
Examples
Example 1
curl --location '<environment_url>/api/serviceattendance/processes/demand/bulkCreate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <insert_token>' \
--data '{
"locationUuid": "c349681c-3567-4010-b45c-38b3622c02af",
"jobUuid": "58907792-980f-4cc0-bed7-38ea0d08b8df",
"startDate": "2025-04-14T00:00:00Z",
"endDate": "2025-04-19T00:00:00Z",
"daysOfWeek": [1, 3, 5],
"headcountChanges": [
{
"startTime": "2025-04-07T09:00:00.000",
"endTime": "2025-04-07T16:00:00.000",
"minimumHeadcount": 2
}
]
}'
2025-04-14
falls on Monday and 2025-2024-19
falls on Saturday. Since we're passing [1, 3, 5] (Monday, Wednesday, and Friday) as the value for daysOfWeek
, demand will be created for those three days only. And since there's only one headcount change that goes from 9am to 4pm, this will mean that on Monday, Wednesday and Friday you'll need at least 2 workers between 9am and 4pm.
Example 2
curl --location '<environment_url>/api/serviceattendance/processes/demand/bulkCreate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <insert_token>' \
--data '{
"locationUuid": "c349681c-3567-4010-b45c-38b3622c02af",
"jobUuid": "58907792-980f-4cc0-bed7-38ea0d08b8df",
"startDate": "2025-04-14T00:00:00Z",
"endDate": "2025-04-19T00:00:00Z",
"daysOfWeek": [1, 3, 5],
"headcountChanges": [
{
"startTime": "2025-04-07T09:00:00.000",
"endTime": "2025-04-07T12:00:00.000",
"minimumHeadcount": 3
},
{
"startTime": "2025-04-07T12:00:00.000",
"endTime": "2025-04-07T15:00:00.000",
"minimumHeadcount": 0
},
{
"startTime": "2025-04-07T15:00:00.000",
"minimumHeadcount": 1
}
]
}'
Demand will be created for the same days as the previous example (Monday, Wednesday, and Friday). In this case, there are three headcount changes for the demand:
- From 9am to 12pm, there need to be at least 3 workers at the same time
- From 12pm to 3pm, there shouldn't be ANY workers scheduled
- From 3pm until the end of the day, there needs to be at least 1 worker scheduled at all times