Kantata Kantata OX Knowledge Base Release Notes Status Page

Workweek Memberships

A Workweek Membership represents the relationship of a user to a workweek.

Fetching a list of Workweek Memberships

The Workweek Memberships endpoint provides a list of all workweek memberships that belongs to the account of the user making the request. The response will contain an array of workweek membership objects, sorted by their start_date.

This endpoint returns structured Workweek Membership 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 workweek_memberships top-level JSON key. Please see our Response Format section for more information.

Request
query Parameters
created_after
string

Filter for records created after a specified datetime.

created_before
string

Filter for records created before a specified datetime.

effective_date
string <date>

Includes only workweek memberships with a start date before, and an end date after, the specified date.

include
string

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

  • user (User) - References the user to whom the workweek membership belongs.
  • workweek (Workweek) - References the associated 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: start_date:asc and start_date:desc.

page
integer <int32>
Default: 1
participants_for_workspace_id
integer <int32>

Limit Workweek Memberships by those participating in the workspace of the specified workspace ID.

participating_with
boolean

Limits workweek memberships to those associated with the user making the request.

per_page
integer <int32> <= 200
Default: 20
updated_after
string

Filter for records updated after a specified datetime.

updated_before
string

Filter for records updated before a specified datetime.

user_ids
Array of integers <int32>

Includes only workweek memberships that belong to the specified user IDs.

Responses
200

A list of Workweek Memberships have been retrieved.

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

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

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

Creating a new Workweek Membership

This endpoint returns structured Workweek Membership 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 workweek_memberships top-level JSON key. Please see our Response Format section for more information.

Request
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.

  • user (User) - References the user to whom the workweek membership belongs.
  • workweek (Workweek) - References the associated workweek.
Request Body schema: application/json
object
user_id
required
integer <int32>

The ID of the user to whom the workweek belongs.

start_date
string <date>

The start date of the workweek (must be a Sunday).

sunday_minutes
integer <int32>

The number of available working minutes on Sunday.

monday_minutes
integer <int32>

The number of available working minutes on Monday.

tuesday_minutes
integer <int32>

The number of available working minutes on Tuesday.

wednesday_minutes
integer <int32>

The number of available working minutes on Wednesday.

thursday_minutes
integer <int32>

The number of available working minutes on Thursday.

friday_minutes
integer <int32>

The number of available working minutes on Friday.

saturday_minutes
integer <int32>

The number of available working minutes on Saturday.

Responses
200

Workweek Membership has been created.

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

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

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

Switch to default workweek

Switches the specified user to the account default workweek, starting on the specified date.

This endpoint returns structured Workweek Membership 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 workweek_memberships top-level JSON key. Please see our Response Format section for more information.

Request
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.

  • user (User) - References the user to whom the workweek membership belongs.
  • workweek (Workweek) - References the associated workweek.
Request Body schema: application/json
object
user_id
integer <int32>

The ID of the user being switched to the default workeek.

start_date
string <date>

Switches to default workweek from the specified date. If not specified, defaults to today.

Responses
200

Workweek Membership has been updated.

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

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

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

Fetching a single Workweek Membership

This endpoint returns structured Workweek Membership 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 workweek_memberships 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.

  • user (User) - References the user to whom the workweek membership belongs.
  • workweek (Workweek) - References the associated workweek.
Responses
200

The Workweek Membership has been retrieved.

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

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

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

Updating an existing Workweek Membership

This endpoint returns structured Workweek Membership 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 workweek_memberships 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.

  • user (User) - References the user to whom the workweek membership belongs.
  • workweek (Workweek) - References the associated workweek.
Request Body schema: application/json
object
start_date
string <date>

The start date of the workweek (must be a Sunday).

sunday_minutes
integer <int32>

The number of available working minutes on Sunday.

monday_minutes
integer <int32>

The number of available working minutes on Monday.

tuesday_minutes
integer <int32>

The number of available working minutes on Tuesday.

wednesday_minutes
integer <int32>

The number of available working minutes on Wednesday.

thursday_minutes
integer <int32>

The number of available working minutes on Thursday.

friday_minutes
integer <int32>

The number of available working minutes on Friday.

saturday_minutes
integer <int32>

The number of available working minutes on Saturday.

Responses
200

Workweek Membership has been updated.

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

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

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

Deleting an existing Workweek Membership

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 Membership has been deleted.

400

Bad Request

401

Unauthorized request

403

Forbidden request

404

Page Not Found

422

Unprocessable Entity

503

Service is unavailable

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