Skip to content

Creating a new Workweek

Request

This endpoint returns structured Workweek objects. As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array and will be indexed by ID in the workweeks top-level JSON key. Please see our Response Format section for more information.

Query
enable_workweeksboolean

Required when creating a workweek for the first time.

includestring

Any of the below associations can be included in your request by providing the include param, e.g. include=association1,association2.

  • workweek_memberships (WorkweekMembership) - References the workweek memberships that use the workweek.
Bodyapplication/jsonrequired
workweekobject
{ "workweek": { "start_date": "2019-08-24", "sunday_minutes": 0, "monday_minutes": 0, "tuesday_minutes": 0, "wednesday_minutes": 0, "thursday_minutes": 0, "friday_minutes": 0, "saturday_minutes": 0 } }

Responses

Workweek has been created.

Bodyapplication/json
countinteger, (int32)
metaobject
resultsArray of objects
workweeksobject
workweek_membershipsobject
Response
{ "count": 0, "meta": { "count": 0, "page_count": 0, "page_number": 0, "page_size": 0 }, "results": [ { "key": "string", "id": "string" } ], "workweeks": { "property1": { "created_at": "2019-08-24T14:15:22Z", "default": true, "end_date": "2019-08-24", "friday_minutes": 0, "monday_minutes": 0, "saturday_minutes": 0, "start_date": "2019-08-24", "sunday_minutes": 0, "thursday_minutes": 0, "total_minutes": 0, "tuesday_minutes": 0, "updated_at": "2019-08-24T14:15:22Z", "wednesday_minutes": 0, "workweek_membership_ids": [ "string" ] }, "property2": { "created_at": "2019-08-24T14:15:22Z", "default": true, "end_date": "2019-08-24", "friday_minutes": 0, "monday_minutes": 0, "saturday_minutes": 0, "start_date": "2019-08-24", "sunday_minutes": 0, "thursday_minutes": 0, "total_minutes": 0, "tuesday_minutes": 0, "updated_at": "2019-08-24T14:15:22Z", "wednesday_minutes": 0, "workweek_membership_ids": [ "string" ] } }, "workweek_memberships": { "property1": { "created_at": "2019-08-24T14:15:22Z", "end_date": "2019-08-24", "start_date": "2019-08-24", "updated_at": "2019-08-24T14:15:22Z", "user_id": 0, "workweek_id": "string" }, "property2": { "created_at": "2019-08-24T14:15:22Z", "end_date": "2019-08-24", "start_date": "2019-08-24", "updated_at": "2019-08-24T14:15:22Z", "user_id": 0, "workweek_id": "string" } } }