Kantata Kantata OX Knowledge Base
Release Notes
Status Page

Workweeks

Workweeks in Kantata OX are owned by an Account. They can be used as the default for an Account or can be associated to a User through a Workweek Membership.

Fetching a list of Workweeks

The Workweeks endpoint provides a list of every default Workweek that belongs to the Account of the User making the request. The response will contain an array of Workweek objects, sorted by their start_date.

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.

Request
query Parameters
created_after
string <date-time>

Filter for records created after a specified datetime. The datetime must be in ISO 8601 format.

created_before
string <date-time>

Filter for records created before a specified datetime. The datetime must be in ISO 8601 format.

effective_date
string <date>

Includes only workweeks that are effective on and after the specified date. The date must be in ISO 8601 format.

include
string

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.
only
string

Allows you to request one or more resources directly by ID. Multiple IDs can be supplied in a comma separated list, like GET /api/v1/workspaces.json?only=5,6,7.

order
string
Default: "start_date:asc"

Supply order with the name of a valid sort field for the endpoint and a direction.

Valid values: created_at:asc, created_at:desc, start_date:asc, and start_date:desc.

page
integer <int32>
Default: 1
per_page
integer <int32> <= 200
Default: 20
updated_after
string <date-time>

Filter for records updated after a specified datetime. The datetime must be in ISO 8601 format.

updated_before
string <date-time>

Filter for records updated before a specified datetime. The datetime must be in ISO 8601 format.

Responses
200

A list of Workweeks have been retrieved.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

get/workweeks
Request samples
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "workweeks": {
    },
  • "workweek_memberships": {
    }
}

Creating a new Workweek

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.

Request
query Parameters
enable_workweeks
boolean

Required when creating a workweek for the first time.

include
string

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.
Request Body schema: application/json
required
object
start_date
string <date>

The start date of the workweek (must be a Sunday). The date must be in ISO 8601 format.

sunday_minutes
integer <int32>

The number of workable minutes on Sunday.

monday_minutes
integer <int32>

The number of workable minutes on Monday.

tuesday_minutes
integer <int32>

The number of workable minutes on Tuesday.

wednesday_minutes
integer <int32>

The number of workable minutes on Wednesday.

thursday_minutes
integer <int32>

The number of workable minutes on Thursday.

friday_minutes
integer <int32>

The number of workable minutes on Friday.

saturday_minutes
integer <int32>

The number of workable minutes on Saturday.

Responses
200

Workweek has been created.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

post/workweeks
Request samples
application/json
{
  • "workweek": {
    }
}
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "workweeks": {
    },
  • "workweek_memberships": {
    }
}

Fetching a single Workweek

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.

Request
path Parameters
id
required
integer

The ID of the Model.

query Parameters
include
string

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.
Responses
200

The Workweek has been retrieved.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

get/workweeks/{id}
Request samples
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "workweeks": {
    },
  • "workweek_memberships": {
    }
}

Updating an existing Workweek

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.

Request
path Parameters
id
required
integer

The ID of the Model.

query Parameters
include
string

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.
Request Body schema: application/json
required
object
start_date
string <date>

The start date of the workweek (must be a Sunday). The date must be in ISO 8601 format.

sunday_minutes
integer <int32>

The number of workable minutes on Sunday.

monday_minutes
integer <int32>

The number of workable minutes on Monday.

tuesday_minutes
integer <int32>

The number of workable minutes on Tuesday.

wednesday_minutes
integer <int32>

The number of workable minutes on Wednesday.

thursday_minutes
integer <int32>

The number of workable minutes on Thursday.

friday_minutes
integer <int32>

The number of workable minutes on Friday.

saturday_minutes
integer <int32>

The number of workable minutes on Saturday.

Responses
200

Workweek has been updated.

Response Schema: application/json
count
integer <int32>
object
Array of objects
object
object
400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

put/workweeks/{id}
Request samples
application/json
{
  • "workweek": {
    }
}
Response samples
application/json
{
  • "count": 0,
  • "meta": {
    },
  • "results": [
    ],
  • "workweeks": {
    },
  • "workweek_memberships": {
    }
}

Deleting an existing Workweek

The response will contain no content and an HTTP 204 status code if the request was successful, or a standard Kantata OX error message explaining why the object could not be deleted.

Request
path Parameters
id
required
integer

The ID of the Model.

Responses
204

Workweek has been deleted.

400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

delete/workweeks/{id}
Request samples
Response samples
application/json
{
  • "errors": [
    ]
}