Working Time Model Templates
Valid Attributes
| 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. |
Create
This endpoint creates a new working time model template in an account.
HTTP Request
POST /api/v1/working_time_model_templates
Example request
{ "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 } ] } }}Example response
{ "data": { "id": "d8d720b7-4410-4d00-bc5d-f3bc6bb2abe5", "type": "working_time_model_template", "attributes": { ... } }}List
This endpoint returns the working time model templates in an account.
HTTP Request
GET /api/v1/working_time_model_templates
Example response
{ "data": [ { "id": "d8d720b7-4410-4d00-bc5d-f3bc6bb2abe5", "type": "working_time_model_template", "attributes": { ... } } ]}Show
This endpoint returns a specific working time model template by its id.
HTTP Request
GET /api/v1/working_time_model_templates/:working_time_model_template_id
URL Parameters
| Parameter | Description |
|---|---|
| working_time_model_template_id | The ID of the working time model template to return |
Example response
{ "data": { "id": "d8d720b7-4410-4d00-bc5d-f3bc6bb2abe5", "type": "working_time_model_template", "attributes": { ... } }}Update
This endpoint updates a specific working time model template given its id.
HTTP Request
PUT /api/v1/working_time_model_templates/:working_time_model_template_id
URL Parameters
| Parameter | Description |
|---|---|
| working_time_model_template_id | The ID of the working time model template to update |
Example request
{ "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 } ] } }}Example response
{ "data": { "id": "3b297e8b-d5d1-402a-92b1-ad66db0982a4", "type": "working_time_model_template", "attributes": { ... } }}Delete
This endpoint deletes a specific working time model template given its id.
HTTP Request
DELETE /api/v1/working_time_model_templates/:working_time_model_template_id
URL Parameters
| Parameter | Description |
|---|---|
| working_time_model_template_id | The ID of the working time model template to delete |
Example response
{ "data": { "id": "3b297e8b-d5d1-402a-92b1-ad66db0982a4", "type": "working_time_model_template", "attributes": { ... } }}