Skip to content

Working Time Model Templates

Attribute Description Details
discarded_at Time of removal (or null) Cannot be set manually. Automatically set when deleted (soft-delete).
name The name of the working time model template Must be set; must be unique across an account.
pattern The pattern for the working time models created from the template Must be set to weekly.
workdays Array of workdays for the working time models created from the template Optional, the following table rows explain the attributes of the elements
day_of_week The day of the week represented by the workday Must be set; must be between 0 (Monday) and 6 (Sunday)
seconds The user’s target working time on the given day of week, in seconds Must be set.

This endpoint creates a new working time model template in an account.

POST /api/v1/working_time_model_templates

{
"data": {
"type": "working_time_model_template",
"attributes": {
"name": "Mo-Fr 9 to 5",
"pattern": "weekly",
"workdays": [
{
"day_of_week": 0,
"seconds": 0
},
{
"day_of_week": 2,
"seconds": 7200
}
]
}
}
}
{
"data": {
"id": "d8d720b7-4410-4d00-bc5d-f3bc6bb2abe5",
"type": "working_time_model_template",
"attributes": {
...
}
}
}

This endpoint returns the working time model templates in an account.

GET /api/v1/working_time_model_templates

{
"data": [
{
"id": "d8d720b7-4410-4d00-bc5d-f3bc6bb2abe5",
"type": "working_time_model_template",
"attributes": {
...
}
}
]
}

This endpoint returns a specific working time model template by its id.

GET /api/v1/working_time_model_templates/:working_time_model_template_id

Parameter Description
working_time_model_template_id The ID of the working time model template to return
{
"data": {
"id": "d8d720b7-4410-4d00-bc5d-f3bc6bb2abe5",
"type": "working_time_model_template",
"attributes": {
...
}
}
}

This endpoint updates a specific working time model template given its id.

PUT /api/v1/working_time_model_templates/:working_time_model_template_id

Parameter Description
working_time_model_template_id The ID of the working time model template to update
{
"data": {
"id": "3b297e8b-d5d1-402a-92b1-ad66db0982a4",
"type": "working_time_model_template",
"attributes": {
"name": "Mo-Fr 9 to 6",
"pattern": "weekly",
"workdays": [
{
"day_of_week": 0,
"seconds": 7200
},
{
"day_of_week": 2,
"seconds": 0
}
]
}
}
}
{
"data": {
"id": "3b297e8b-d5d1-402a-92b1-ad66db0982a4",
"type": "working_time_model_template",
"attributes": {
...
}
}
}

This endpoint deletes a specific working time model template given its id.

DELETE /api/v1/working_time_model_templates/:working_time_model_template_id

Parameter Description
working_time_model_template_id The ID of the working time model template to delete
{
"data": {
"id": "3b297e8b-d5d1-402a-92b1-ad66db0982a4",
"type": "working_time_model_template",
"attributes": {
...
}
}
}