RotaCloud API

The RotaCloud API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors.

Authentication

Authentication to the API is performed via HTTP Bearer Auth. You must provide an Authorization header in the format Bearer your-api-key-here. You can generate API keys from within your RotaCloud account. By default you will be authenticated as an anonymous user with administrative permissions. You can make calls on behalf of a specific user by providing a User header containing the ID of an active user within the account.

Errors

We use conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error. Codes in the 5xx range indicate an error with our servers (these are rare).

Calls which fail will generally be accompanied by a human readable description of what went wrong. This will be included in an error property on the response.

Pagination

In order to keep our servers happy, requests which return multiple items may be paginated. Paginated requests will include two extra response headers; X-Total-Count (the total number of results), and Link (containing one or more hypermedia link relations).

The possible values for the link relations are; next (the link relation for the immediate next page of results), last (the link relation for the last page of results), first (the link relation for the first page of results), and prev (the link relation for the immediate previous page of results).

You can optionally specify a limit URL parameter to change how many results are served per page (hard limits will apply), and you can navigate through paginated results using the offset URL parameter which lets you specify which result should be returned first, e.g. ?limit=10&offset=30 (this would return 10 results starting with record 30).

Rate Limiting

Calls to our API are limited on a per API key basis. The specific limit may vary. If you make too many calls in a given period the API will return a 429 response code.

Webhooks

A number of webhooks are available to configure for events that occur inside RotaCloud. Webhooks must be sent to a secure URL, and you can only have 1 webhook per event.

You can verify that the webhook has come from us by checking its signature which you will find in the RotaCloud-Signature request header. We generate signatures using a hash-based message authentication code (HMAC) with SHA-256. The process for verifying a request is as follows...

Step 1: Extract the timestamp and signatures from the header

Split the header, using the , character as the separator, to get a list of elements. Then split each element, using the = character as the separator, to get a prefix and value pair. The value for the prefix ts corresponds to the timestamp, and v1 corresponds to the signature. You can discard all other elements.

Step 2: Prepare the payload for signing

The payload to sign is created by concatenating the timestamp (as a string), the character ., and the JSON request body. E.g. 123456789.[{"example":"event"}].

Step 3: Determine the expected signature

Compute an HMAC with the SHA256 hash function. Use the RotaCloud secret (found in your account) as the key, and use the payload you generated above as the message.

Step 4: Compare the signatures

Compare the signature in the header to the expected signature. For an equality match, compute the difference between the current timestamp and the received timestamp, then decide if the difference is within your tolerance.

Accounts

List accounts

Responses

Attendance

List all attendance records

query Parameters
start
required
number
Example: start=1455875832

Start timestamp of the date range to get attendance records for

end
required
number
Example: end=1464685882

End timestamp of the date range to get attendance records for

users
Array of any

User IDs to get attendance records for

locations
Array of any

Location IDs to get attendance records for

roles
Array of any

Role IDs to get attendance records for

approved
boolean
Example: approved=true

Return approved or unapproved records

include_deleted
boolean
Example: include_deleted=false

Include deleted attendance records

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an attendance record

Request Body schema: application/json
user
number
in_time
number
out_time
number
minutes_break
number
in_photo
string
out_photo
string
in_time_clocked
number
out_time_clocked
number
Array of objects

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "approved": true,
  • "in_time": 1401789600,
  • "out_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "minutes_late": 0,
  • "hours": 7,
  • "hours_auto": 8,
  • "hours_is_auto": false,
  • "notes": null,
  • "shift": null,
  • "in_time_clocked": 1401789600,
  • "out_time_clocked": 1401816600,
  • "breaks_clocked": []
}

Retrieve an attendance record

path Parameters
id
required
number
Example: 1

ID of the attendance record

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "approved": true,
  • "in_time": 1401789600,
  • "out_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "minutes_late": 0,
  • "hours": 7,
  • "hours_auto": 8,
  • "hours_is_auto": false,
  • "notes": "Arrived slightly late due to reasons out of their control",
  • "shift": 1,
  • "in_method": "mobile",
  • "out_method": "mobile",
  • "in_location": {
    },
  • "out_location": {
    },
  • "in_device": 1,
  • "out_device": 1,
  • "in_terminal": null,
  • "out_terminal": null,
  • "in_time_clocked": 1401789600,
  • "out_time_clocked": 1401816600,
  • "breaks_clocked": []
}

Update an attendance record

path Parameters
id
required
number
Example: 1

ID of the attendance record

Request Body schema: application/json
hours
number
hours_is_auto
boolean

Responses

Request samples

Content type
application/json
{
  • "hours": 7,
  • "hours_is_auto": false
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "approved": true,
  • "in_time": 1401789600,
  • "out_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "minutes_late": 0,
  • "hours": 7,
  • "hours_auto": 8,
  • "hours_is_auto": false,
  • "notes": null,
  • "shift": null,
  • "in_time_clocked": 1401789600,
  • "out_time_clocked": 1401816600,
  • "breaks_clocked": []
}

Delete an attendance record

path Parameters
id
required
number
Example: 1

ID of the attendance record

Responses

Attendance_approved

Approve attendance records

Request Body schema: application/json
attendance
required
Array of any

IDs of the attendance records to approve

Responses

Request samples

Content type
application/json
{
  • "attendance": [
    ]
}

Unapprove attendance records

Request Body schema: application/json
attendance
required
Array of any

IDs of the attendance records to unapprove

Responses

Request samples

Content type
application/json
{
  • "attendance": [
    ]
}

Availability

Get availability

query Parameters
start
required
string
Example: start=2016-01-01

Start of the date range to get availability for

end
required
string
Example: end=2016-01-31

End of the date range to get availability for

users
Array of any

User IDs to get availability for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an availability

Request Body schema: application/json
user
number
Array of objects

Responses

Request samples

Content type
application/json
{
  • "user": 1,
  • "dates": [
    ]
}

Response samples

Content type
application/json
true

Day_notes

List day notes

query Parameters
start
string
Example: start=2016-01-01

Start of the date range to get day notes for

end
string
Example: end=2016-01-31

End of the date range to get day notes for

location
number

Location ID to get day notes for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a day note

Request Body schema: application/json
start_date
string
end_date
string
locations
Array of numbers
title
string
message
string
visible_employees
boolean

Responses

Request samples

Content type
application/json
{
  • "start_date": "2016-04-27",
  • "end_date": "2016-04-29",
  • "locations": [
    ],
  • "title": "Important Information",
  • "message": "Local charity event this weekend.",
  • "visible_employees": false
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-04-27",
  • "end_date": "2016-04-29",
  • "locations": [
    ],
  • "title": "Important Information",
  • "message": "Local charity event this weekend.",
  • "visible_employees": false
}

Retrieve a day note

path Parameters
id
required
number
Example: 1

ID of the day note

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-04-27",
  • "end_date": "2016-04-29",
  • "locations": [
    ],
  • "title": "Important Information",
  • "message": "Local charity event this weekend.",
  • "visible_employees": false
}

Update a day note

path Parameters
id
required
number
Example: 1

ID of the day note

Request Body schema: application/json
start_date
string
end_date
string
locations
Array of numbers
title
string
message
string
visible_employees
boolean

Responses

Request samples

Content type
application/json
{
  • "start_date": "2016-04-27",
  • "end_date": "2016-04-29",
  • "locations": [
    ],
  • "title": "Important Information",
  • "message": "Local charity event this weekend.",
  • "visible_employees": true
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-04-27",
  • "end_date": "2016-04-29",
  • "locations": [
    ],
  • "title": "Important Information",
  • "message": "Local charity event this weekend.",
  • "visible_employees": true
}

Delete a day note

path Parameters
id
required
number
Example: 1

ID of the day note

Responses

Days_off

Get days off

query Parameters
start
required
string
Example: start=2016-01-01

Start of the date range to get days off for

end
required
string
Example: end=2016-01-31

End of the date range to get days off for

users
Array of any

User IDs to get days off for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Add days off

Request Body schema: application/json
dates
required
Array of any

The dates to set as days off

users
required
Array of any

User IDs who the change applies to

Responses

Request samples

Content type
application/json
{
  • "dates": [
    ],
  • "users": [
    ]
}

Delete days off

Request Body schema: application/json
dates
required
Array of any

The dates to set as workdays

users
required
Array of any

User IDs who the change applies to

Responses

Request samples

Content type
application/json
{
  • "dates": [
    ],
  • "users": [
    ]
}

Days_off_patterns

List days off patterns

query Parameters
start
string
Example: start=2016-01-01

Start of the date range to get days off patterns for

end
string
Example: end=2016-01-31

End of the date range to get days off patterns for

users
Array of any

User IDs to get days off patterns for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a days off pattern

Request Body schema: application/json
user
number
start_date
string
mon_day_off
boolean
tue_day_off
boolean
wed_day_off
boolean
thu_day_off
boolean
fri_day_off
boolean
sat_day_off
boolean
sun_day_off
boolean

Responses

Request samples

Content type
application/json
{
  • "user": 1,
  • "start_date": "2016-02-01",
  • "mon_day_off": false,
  • "tue_day_off": false,
  • "wed_day_off": false,
  • "thu_day_off": false,
  • "fri_day_off": false,
  • "sat_day_off": true,
  • "sun_day_off": true
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "user": 1,
  • "start_date": "2016-02-01",
  • "end_date": null,
  • "mon_day_off": false,
  • "tue_day_off": false,
  • "wed_day_off": false,
  • "thu_day_off": false,
  • "fri_day_off": false,
  • "sat_day_off": true,
  • "sun_day_off": true
}

Retrieve a days off pattern

path Parameters
id
required
number
Example: 1

ID of the days off pattern

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "user": 1,
  • "start_date": "2016-02-01",
  • "end_date": null,
  • "mon_day_off": false,
  • "tue_day_off": false,
  • "wed_day_off": false,
  • "thu_day_off": false,
  • "fri_day_off": false,
  • "sat_day_off": true,
  • "sun_day_off": true
}

Update a days off pattern

path Parameters
id
required
number
Example: 1

ID of the days off pattern

Request Body schema: application/json
mon_day_off
boolean
tue_day_off
boolean
wed_day_off
boolean
thu_day_off
boolean
fri_day_off
boolean
sat_day_off
boolean
sun_day_off
boolean

Responses

Request samples

Content type
application/json
{
  • "mon_day_off": false,
  • "tue_day_off": false,
  • "wed_day_off": false,
  • "thu_day_off": false,
  • "fri_day_off": false,
  • "sat_day_off": true,
  • "sun_day_off": true
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "user": 1,
  • "start_date": "2016-02-01",
  • "end_date": null,
  • "mon_day_off": false,
  • "tue_day_off": false,
  • "wed_day_off": false,
  • "thu_day_off": false,
  • "fri_day_off": false,
  • "sat_day_off": true,
  • "sun_day_off": true
}

Delete a days off pattern

path Parameters
id
required
number
Example: 1

ID of the days off pattern

Responses

Documents

List documents

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create document

Request Body schema: application/json
bucket
string
name
string
key
string
users
Array of numbers
public
boolean
requires_acknowledgement
boolean

Responses

Request samples

Content type
application/json
{
  • "bucket": "an-s3-bucket",
  • "name": "test.jpg",
  • "key": "files/1000/10000/a-random-string-of-characters",
  • "users": [
    ],
  • "public": false,
  • "requires_acknowledgement": true
}

Update documents

path Parameters
id
required
number
Request Body schema: application/json
name
string
public
boolean
user
number
users
Array of any
requires_acknowledgement
boolean
requires_signing
boolean
shared
boolean

Responses

Request samples

Content type
application/json
{
  • "users": [ ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "user": null,
  • "folder_id": null,
  • "expires": null,
  • "public": false,
  • "created_by": null,
  • "created_at": 0,
  • "deleted": false,
  • "deleted_by": null,
  • "sizeKb": null,
  • "name": null,
  • "extension": null,
  • "type": null,
  • "requires_acknowledgement": false,
  • "requires_signing": false,
  • "users": [ ],
  • "acknowledgements": [
    ],
  • "signature": null
}

Delete a document

path Parameters
id
required
number

Responses

Acknowledge a document

path Parameters
id
required
number

Responses

Sign a document

path Parameters
id
required
number

Responses

Groups

List groups

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a group

Request Body schema: application/json
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "Management"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Management",
  • "users": [ ]
}

Retrieve a group

path Parameters
id
required
number
Example: 1

ID of the group

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Management",
  • "users": [
    ]
}

Update a group

path Parameters
id
required
number
Example: 1

ID of the group

Request Body schema: application/json
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "Management"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Management",
  • "users": [
    ]
}

Delete a group

path Parameters
id
required
number
Example: 1

ID of the group

Responses

Holiday_allowances

Retrieve holiday allowances for a year

path Parameters
year
required
number
Example: 2016

The year to get the allowance for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Retrieve a holiday allowance for a year and user

path Parameters
year
required
number
Example: 2016

The year to get the allowance for

id
required
number
Example: 1

ID of the user

Responses

Response samples

Content type
application/json
{
  • "user": 1,
  • "default_holiday_allowance": 30,
  • "default_holiday_allowance_unit": "days",
  • "custom_holiday_allowance": null,
  • "custom_holiday_allowance_unit": null,
  • "adjusted_start_date": false,
  • "adjusted_final_working_date": false,
  • "holiday_allowance": 30,
  • "holiday_allowance_unit": "days"
}

Holiday_allowances_custom

Create a custom holiday allowance

path Parameters
year
required
number
Example: 2016

The year to add the allowance to

Request Body schema: application/json
user
number
holiday_allowance
number
holiday_allowance_unit
string

Responses

Request samples

Content type
application/json
{
  • "user": 1,
  • "holiday_allowance": 30,
  • "holiday_allowance_unit": "days"
}

Response samples

Content type
application/json
{
  • "user": 1,
  • "holiday_allowance": 30,
  • "holiday_allowance_unit": "days"
}

Update a custom holiday allowance

path Parameters
year
required
number
Example: 2016

The year to add the allowance to

id
required
number
Example: 1

ID of the user

Request Body schema: application/json
holiday_allowance
number
holiday_allowance_unit
string

Responses

Request samples

Content type
application/json
{
  • "holiday_allowance": 30,
  • "holiday_allowance_unit": "days"
}

Response samples

Content type
application/json
{
  • "user": 1,
  • "holiday_allowance": 30,
  • "holiday_allowance_unit": "days"
}

Delete a custom holiday allowance

path Parameters
year
required
number
Example: 2016

The year to get the allowance for

id
required
number
Example: 1

ID of the user

Responses

Leave

List leave

query Parameters
start
string
Example: start=2016-01-01

Start of the date range to get leave for

end
string
Example: end=2016-01-31

End of the date range to get leave for

year
number
Example: year=2016

Leave year to get leave for

users
Array of any

User IDs to get leave for

types
Array of any

Type IDs to get leave for

include_deleted
boolean
Example: include_deleted=true

Include deleted leave

include_denied
boolean
Example: include_denied=true

Include denied leave requests

Request Body schema: application/json

Include pending leave requests

boolean

Responses

Request samples

Content type
application/json
true

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create leave records

Request Body schema: application/json
users
Array of numbers
type
number
start_date
string
start_am_pm
string
end_date
string
end_am_pm
string
object
admin_message
string

Responses

Request samples

Content type
application/json
{
  • "users": [
    ],
  • "type": 1,
  • "start_date": "2016-12-29",
  • "start_am_pm": "pm",
  • "end_date": "2017-01-03",
  • "end_am_pm": "pm",
  • "hours": {
    },
  • "admin_message": "Jacob, I have added your February leave to the calendar."
}

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve a leave record

path Parameters
id
required
number
Example: 1

ID of the leave record

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "type": 1,
  • "user": 1,
  • "admin": 2,
  • "status": "approved",
  • "requested": true,
  • "user_message": "It's my birthday, could I book these days holiday?",
  • "admin_message": "Yes, no problem at all. Happy birthday!",
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "hours": {
    },
  • "hours_method": "yearly",
  • "hours_set": false,
  • "dates": [
    ]
}

Update a leave record

path Parameters
id
required
number
Example: 1

ID of the leave record

Request Body schema: application/json
start_date
string
start_am_pm
string
end_date
string
end_am_pm
string

Responses

Request samples

Content type
application/json
{
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "type": 1,
  • "user": 1,
  • "admin": 2,
  • "status": "approved",
  • "requested": true,
  • "user_message": "It's my birthday, could I book these days holiday?",
  • "admin_message": "Yes, no problem at all. Happy birthday!",
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "hours": {
    },
  • "hours_method": "yearly",
  • "hours_set": false,
  • "dates": [
    ]
}

Delete a leave record

path Parameters
id
required
number
Example: 1

ID of the leave record

Responses

Leave_embargoes

List leave embargoes

query Parameters
start
required
string
Example: start=2016-01-01

Start of the date range to get leave embargoes for

end
required
string
Example: end=2016-01-31

End of the date range to get leave embargoes for

users
Array of any

User IDs to get leave embargoes for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a leave embargo

Request Body schema: application/json
start_date
string
start_am_pm
string
end_date
string
end_am_pm
string
everyone
boolean
message
string

Responses

Request samples

Content type
application/json
{
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "everyone": true,
  • "message": "Busy period, no leave requests."
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "everyone": true,
  • "users": [ ],
  • "message": "Busy period, no leave requests."
}

Retrieve a leave embargo

path Parameters
id
required
number
Example: 1

ID of the leave embargo

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "everyone": true,
  • "users": [ ],
  • "message": "Busy period, no leave requests."
}

Update a leave embargo

path Parameters
id
required
number
Example: 1

ID of the leave embargo

Request Body schema: application/json
start_date
string
start_am_pm
string
end_date
string
end_am_pm
string
everyone
boolean
message
string

Responses

Request samples

Content type
application/json
{
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "everyone": true,
  • "message": "Busy period, no leave requests."
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "everyone": true,
  • "users": [ ],
  • "message": "Busy period, no leave requests."
}

Delete a leave embargo

path Parameters
id
required
number
Example: 1

ID of the leave embargo

Responses

Leave_requests

List leave requests

query Parameters
include_deleted
boolean
Example: include_deleted=true

Include deleted leave

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Request leave

Request Body schema: application/json
type
number
start_date
string
start_am_pm
string
end_date
string
end_am_pm
string
user_message
string

Responses

Request samples

Content type
application/json
{
  • "type": 1,
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "user_message": "It's my birthday, could I book these days holiday?"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "user": 1,
  • "type": 1,
  • "requested_at": 1403280946,
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "years": [
    ],
  • "days": {
    },
  • "user_message": "It's my birthday, could I book these days holiday?"
}

Retrieve a leave request

path Parameters
id
required
number
Example: 1

ID of the leave request

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "type": 1,
  • "user": 1,
  • "user_message": "It's my birthday, could I book these days holiday?",
  • "start_date": "2016-04-27",
  • "start_am_pm": "am",
  • "end_date": "2016-04-29",
  • "end_am_pm": "pm",
  • "dates": [
    ]
}

Delete a leave request

path Parameters
id
required
number
Example: 1

ID of the leave request

Responses

Approve a leave request

path Parameters
id
required
number
Example: 1

ID of the leave request

Request Body schema: application/json
admin_message
string

Responses

Request samples

Content type
application/json
{
  • "admin_message": "Yep, no problem, enjoy your holiday!"
}

Deny a leave request

path Parameters
id
required
number
Example: 1

ID of the leave request

Request Body schema: application/json
admin_message
string

Responses

Request samples

Content type
application/json
{
  • "admin_message": "Sorry, you're unable to take these dates off"
}

Leave_types

List leave types

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Locations

List locations

query Parameters
ids
Array of any

IDs of locations to retrieve

include_deleted
boolean
Example: include_deleted=true

Include deleted locations

only_visible
boolean
Example: only_visible=true

Only return locations the currently authenticated user can see the rota for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a location

Request Body schema: application/json
name
string
address
string
object
timezone
number

Responses

Request samples

Content type
application/json
{
  • "name": "Bar",
  • "address": "4 Blake Avenue, York",
  • "location": {
    },
  • "timezone": 335
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Bar",
  • "address": "4 Blake Avenue, York",
  • "location": {
    },
  • "timezone": 335,
  • "users": [ ]
}

Retrieve a location

path Parameters
id
required
number
Example: 1

ID of the location

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Bar",
  • "address": "4 Blake Avenue, York",
  • "location": {
    },
  • "timezone": 335,
  • "users": [
    ]
}

Update a location

path Parameters
id
required
number
Example: 1

ID of the location

Request Body schema: application/json
name
string
address
string
object
timezone
number

Responses

Request samples

Content type
application/json
{
  • "name": "Bar",
  • "address": "4 Blake Avenue, York",
  • "location": {
    },
  • "timezone": 335
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Bar",
  • "address": "4 Blake Avenue, York",
  • "location": {
    },
  • "timezone": 335,
  • "users": [
    ]
}

Delete a location

path Parameters
id
required
number
Example: 1

ID of the location

Responses

Logbook_categories

List logbook categories

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a logbook category

Request Body schema: application/json
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "Review Meeting"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Review Meeting"
}

Retrieve a logbook category

path Parameters
id
required
number
Example: 1

ID of the logbook category

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Review Meeting"
}

Update a logbook category

path Parameters
id
required
number
Example: 1

ID of the logbook category

Request Body schema: application/json
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "Review Meeting"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Review Meeting"
}

Delete a logbook category

path Parameters
id
required
number
Example: 1

ID of the logbook category

Responses

Logbook_events

List logbook events

query Parameters
user
number
Example: user=1

ID of the user to list events for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a logbook event

Request Body schema: application/json
user
number
category
number
date
string
time
string
name
string
description
any or null

Responses

Request samples

Content type
application/json
{
  • "user": 1,
  • "category": 1,
  • "date": "2020-04-27",
  • "time": "09:00",
  • "name": "Completed advanced training",
  • "description": null
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "created_at": 1589627200,
  • "created_by": 1,
  • "updated_at": null,
  • "updated_by": null,
  • "deleted": false,
  • "deleted_at": null,
  • "deleted_by": null,
  • "user": 1,
  • "category": 1,
  • "date": "2020-04-27",
  • "time": "09:00",
  • "name": "Completed advanced training",
  • "description": null
}

Retrieve a logbook event

path Parameters
id
required
number
Example: 1

ID of the logbook category

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "created_at": 1589627200,
  • "created_by": 1,
  • "updated_at": null,
  • "updated_by": null,
  • "deleted": false,
  • "deleted_at": null,
  • "deleted_by": null,
  • "user": 1,
  • "category": 1,
  • "date": "2020-04-27",
  • "time": "09:00",
  • "name": "Completed advanced training",
  • "description": null
}

Update a logbook event

path Parameters
id
required
number
Example: 1

ID of the logbook category

Request Body schema: application/json
category
number
date
string
time
string
name
string
description
any or null

Responses

Request samples

Content type
application/json
{
  • "category": 2,
  • "date": "2020-04-01",
  • "time": "15:30",
  • "name": "Completed advanced training",
  • "description": null
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "created_at": 1589627200,
  • "created_by": 1,
  • "updated_at": 1589710029,
  • "updated_by": 1,
  • "deleted": false,
  • "deleted_at": null,
  • "deleted_by": null,
  • "user": 1,
  • "category": 2,
  • "date": "2020-04-01",
  • "time": "15:30",
  • "name": "Completed advanced training",
  • "description": null
}

Delete a logbook event

path Parameters
id
required
number
Example: 1

ID of the logbook category

Responses

Me

Retrieve the currently authenticated user

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "level": "admin",
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "group": 1,
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "leave_rates_unit": "days",
  • "leave_rates_type": "deduction",
  • "notes": "Qualified first aider",
  • "preferences": {
    }
}

Retrieve the currently authenticated user's current IP address

Responses

Response samples

Content type
application/json
{
  • "ip": "267.43.300.126"
}

Messages

Retrieve my messages

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Send a message

Sends a message to users, possibly including an attachment. To include an attachment, it must first be uploaded to the temporary area of the bucket, with the key in the format temp/<accountId>/<userId>/<key>

Request Body schema: application/json
subject
required
string

The subject of the message

message
required
string

The message text

users
required
Array of any

An array of user IDs to deliver the message to

attachments
Array of any

Maximum of 10 attachments to include with the message

Responses

Request samples

Content type
application/json
{
  • "subject": "Hello world!",
  • "message": "Hello from RotaCloud",
  • "users": [
    ],
  • "attachments": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "sent_by": 0,
  • "subject": "",
  • "message": "",
  • "sent_at": null,
  • "users": [
    ]
}

Pay_periods

List pay periods

query Parameters
start
required
string
Example: start=2016-01-01

Start of the date range to get pay periods for

end
required
string
Example: end=2016-01-31

End of the date range to get pay periods for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Retrieve a pay period

path Parameters
id
required
number
Example: 1

ID of the pay period

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "start_date": "2016-01-01",
  • "end_date": "2016-01-31",
  • "name": "January 2016",
  • "locked": true,
  • "locked_at": 1464259648,
  • "locked_by": 1,
  • "unlocked_at": null,
  • "unlocked_by": null,
  • "finalised": true,
  • "finalised_at": 1464610617,
  • "finalised_by": 1,
  • "unfinalised_at": null,
  • "unfinalised_by": null
}

Retrieve payroll information for a pay period

path Parameters
id
required
number
Example: 1

ID of the pay period

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Pins

Retrieve a user by their pin

path Parameters
pin
required
string
Example: 1234

The pin to lookup

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "level": "admin",
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "group": 1,
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "leave_rates_unit": "days",
  • "leave_rates_type": "deduction",
  • "notes": "Qualified first aider"
}

Roles

List roles

query Parameters
ids
Array of any

IDs of roles to retrieve

include_deleted
boolean
Example: include_deleted=true

Include deleted roles

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a role

Request Body schema: application/json
name
string
colour
string
default_break
number

Responses

Request samples

Content type
application/json
{
  • "name": "Supervisor",
  • "colour": "f79986",
  • "default_break": 30
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Supervisor",
  • "colour": "f79986",
  • "default_break": 30,
  • "users": [ ]
}

Retrieve a role

path Parameters
id
required
number
Example: 1

ID of the role

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Supervisor",
  • "colour": "f79986",
  • "default_break": 30,
  • "users": [
    ]
}

Update a role

path Parameters
id
required
number
Example: 1

ID of the role

Request Body schema: application/json
name
string
colour
string
default_break
number

Responses

Request samples

Content type
application/json
{
  • "name": "Supervisor",
  • "colour": "f79986",
  • "default_break": 30
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Supervisor",
  • "colour": "f79986",
  • "default_break": 30,
  • "users": [
    ]
}

Delete a role

path Parameters
id
required
number
Example: 1

ID of the role

Responses

Settings

List all account settings

Responses

Response samples

Content type
application/json
{
  • "attendance_record_breaks": {
    },
  • "clockin_without_shift_allowed": {
    },
  • "early_clockin_minutes": {
    },
  • "mobile_clocking_enabled": {
    }
}

Shifts

List all shifts

query Parameters
start
required
number
Example: start=1455875832

Start timestamp of the date range to get shifts for

end
required
number
Example: end=1464685882

End timestamp of the date range to get shifts for

users
Array of any

User IDs to get shifts for

locations
Array of any

Location IDs to get shifts for

roles
Array of any

Role IDs to get shifts for

open
boolean
Example: open=true

Return open or assigned shifts. To include open or assigned shifts when the users parameter is specified, omit this parameter and instead include user ID 0 in the users parameter

published
boolean
Example: published=true

Return published or unpublished shifts

include_deleted
boolean
Example: include_deleted=false

Include deleted shifts

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a shift

Request Body schema: application/json
published
boolean
start_time
number
end_time
number
minutes_break
number
user
number
location
number
role
number
notes
string

Responses

Request samples

Content type
application/json
{
  • "published": true,
  • "start_time": 1401789600,
  • "end_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "notes": "Early start due to bank holiday"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "published": true,
  • "open": false,
  • "start_time": 1401789600,
  • "end_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "notes": "Early start due to bank holiday",
  • "created_by": 1,
  • "created_at": 1463650395,
  • "updated_at": null,
  • "claimed": false,
  • "claimed_at": null,
  • "acknowledged": true,
  • "acknowledged_at": 1463650401
}

Retrieve a shift

path Parameters
id
required
number
Example: 1

ID of the shift

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "published": true,
  • "open": false,
  • "start_time": 1401789600,
  • "end_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "notes": "Early start due to bank holiday",
  • "created_by": 1,
  • "created_at": 1463650395,
  • "updated_at": null,
  • "claimed": false,
  • "claimed_at": null,
  • "acknowledged": true,
  • "acknowledged_at": 1463650401
}

Update a shift

path Parameters
id
required
number
Example: 1

ID of the shift

Request Body schema: application/json
published
boolean
start_time
number
end_time
number
minutes_break
number
user
number
location
number
role
number
notes
string

Responses

Request samples

Content type
application/json
{
  • "published": true,
  • "start_time": 1401789600,
  • "end_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "notes": "Early start due to bank holiday"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "published": true,
  • "open": false,
  • "start_time": 1401789600,
  • "end_time": 1401816600,
  • "minutes_break": 30,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "notes": "Early start due to bank holiday",
  • "created_by": 1,
  • "created_at": 1463650395,
  • "updated_at": null,
  • "claimed": false,
  • "claimed_at": null,
  • "acknowledged": true,
  • "acknowledged_at": 1463650401
}

Delete a shift

path Parameters
id
required
number
Example: 1

ID of the shift

Responses

Shifts_acknowledged

Acknowledge shifts

Request Body schema: application/json
shifts
required
Array of any

IDs of the shifts to acknowledge

Responses

Request samples

Content type
application/json
{
  • "shifts": [
    ]
}

Shifts_published

Publish shifts

Request Body schema: application/json
shifts
required
Array of any

IDs of the shifts to publish

Responses

Request samples

Content type
application/json
{
  • "shifts": [
    ]
}

Unpublish shifts

Request Body schema: application/json
shifts
required
Array of any

IDs of the shifts to unpublish

Responses

Request samples

Content type
application/json
{
  • "shifts": [
    ]
}

Swap_requests

List swap requests

query Parameters
include_deleted
boolean
Example: include_deleted=true

Include deleted swap requests

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Request a shift swap

Request Body schema: application/json
shift
number
new_user
number
swapped_shift
any or null

Responses

Request samples

Content type
application/json
{
  • "shift": 1,
  • "new_user": 2,
  • "swapped_shift": null
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "requested",
  • "requested_at": 1472055000,
  • "old_user": 1,
  • "new_user": 2,
  • "user_approved": null,
  • "user_replied_at": null,
  • "admin_approved": null,
  • "admin_replied_at": null,
  • "shift": 1,
  • "swapped_shift": null
}

Retrieve a swap request

path Parameters
id
required
number
Example: 1

ID of the swap request

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "requested",
  • "requested_at": 1472055000,
  • "old_user": 1,
  • "new_user": 2,
  • "user_approved": true,
  • "user_replied_at": 1473080000,
  • "admin_approved": null,
  • "admin_replied_at": null,
  • "shift": 1,
  • "swapped_shift": null
}

Deny a shift swap as an admin

path Parameters
id
required
number
Example: 1

ID of the swap request

Request Body schema: application/json
admin_approved
boolean

Responses

Request samples

Content type
application/json
{
  • "admin_approved": false
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "requested",
  • "requested_at": 1472055000,
  • "old_user": 1,
  • "new_user": 2,
  • "user_approved": true,
  • "user_replied_at": 1476025000,
  • "admin_approved": null,
  • "admin_replied_at": 1476057000,
  • "shift": 1,
  • "swapped_shift": null
}

Delete a swap request

path Parameters
id
required
number
Example: 1

ID of the swap request

Responses

Terminals

List terminals

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create a terminal

Request Body schema: application/json
name
string
timezone
number
default_location
number

Responses

Request samples

Content type
application/json
{
  • "name": "Front Desk",
  • "timezone": 335,
  • "default_location": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Front Desk",
  • "active": false,
  • "platform": null,
  • "device": null,
  • "version": null,
  • "ip": null,
  • "location": null,
  • "timezone": 335,
  • "require_photo": false,
  • "require_photo_breaks": false,
  • "default_location": 1
}

Retrieve a terminal

path Parameters
id
required
number
Example: 1

ID of the terminal

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Front Desk",
  • "active": true,
  • "platform": "ios",
  • "device": "David's iPad",
  • "version": "2.0.6",
  • "ip": "192.168.0.1",
  • "location": {
    },
  • "timezone": 335,
  • "require_photo": false,
  • "require_photo_breaks": false,
  • "default_location": 1
}

Update a terminal

path Parameters
id
required
number
Example: 1

ID of the terminal

Request Body schema: application/json
name
string
timezone
number
default_location
number

Responses

Request samples

Content type
application/json
{
  • "name": "Front Desk",
  • "timezone": 335,
  • "default_location": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Front Desk",
  • "active": false,
  • "platform": null,
  • "device": null,
  • "version": null,
  • "ip": null,
  • "location": null,
  • "timezone": 335,
  • "require_photo": false,
  • "require_photo_breaks": false,
  • "default_location": 1
}

Close a terminal

path Parameters
id
required
number
Example: 1

ID of the terminal

Responses

Terminals_active

List active terminals

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Launch a terminal

Request Body schema: application/json
terminal
number
device
string
object

Responses

Request samples

Content type
application/json
{
  • "terminal": 1,
  • "device": "abcdefghijklmnopqrstuvwxyz",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "name": "Front Desk",
  • "active": true,
  • "platform": "ios",
  • "device": "David's iPad",
  • "version": "2.0.6",
  • "ip": "192.168.0.1",
  • "location": {
    },
  • "timezone": 335,
  • "require_photo": false,
  • "require_photo_breaks": false,
  • "default_location": 1
}

Ping an active terminal

path Parameters
id
required
number
Example: 1

ID of the terminal

Request Body schema: application/json
action
string
device
string

Responses

Request samples

Content type
application/json
{
  • "action": "ping",
  • "device": "abcdefghijklmnopqrstuvwxyz"
}

Timezones

List timezones

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Retrieve a timezone

path Parameters
id
required
number
Example: 1

ID of timezone

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Africa/Abidjan",
  • "continent": "Africa",
  • "city": "Abidjan",
  • "sub": null
}

Toil_accruals

List toil accruals

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create a toil accrual record

Request Body schema: application/json
duration_hours
number
date
string
leave_year
number
location_id
number
comments
string
user_id
number

Responses

Request samples

Content type
application/json
{
  • "duration_hours": 8,
  • "date": "2017-01-01",
  • "leave_year": 2017,
  • "location_id": 1,
  • "comments": "Accrued for working bank holiday",
  • "user_id": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "created_at": 1472055000,
  • "created_by": 1,
  • "deleted": false,
  • "deleted_at": null,
  • "deleted_by": null,
  • "leave_year": 2017,
  • "comments": "Accrued for working bank holiday",
  • "location_id": 1,
  • "duration_hours": 8,
  • "date": "2017-01-01",
  • "user_id": 1
}

Retrieve a toil accrual record

path Parameters
id
required
number
Example: 1

ID of the toil accrual record

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "created_at": 1472055000,
  • "created_by": 1,
  • "deleted": false,
  • "leave_year": 2017,
  • "comments": "Accrued for working bank holiday",
  • "location_id": 1,
  • "duration_hours": 8,
  • "date": "2017-01-01",
  • "user_id": 1
}

Delete a toil accrual record

path Parameters
id
required
number
Example: 1

ID of the toil accrual record

Responses

Toil_allowance

List toil allowance

query Parameters
year
required
number
Example: year=2017

Year to get allowance for

users
Array of any

User IDs to get allowance for

Responses

Unavailability_requests

List unavailability requests

query Parameters
include_deleted
boolean
Example: include_deleted=true

Include deleted unavailability requests

start
required
number
Example: start=1455875832

Start timestamp of the date range of when the request was made

end
required
number
Example: end=1464685882

End timestamp of the date range of when the request was made

shift_start
required
number
Example: shift_start=1455875832

Start timestamp of the date range of the shift

shift_end
required
number
Example: shift_end=1464685882

End timestamp of the date range of the shift

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Request unavailability

Request Body schema: application/json
shift
number
message
string

Responses

Request samples

Content type
application/json
{
  • "shift": 1,
  • "message": "I have a doctors appointment, could I get this shift off?"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "requested",
  • "requested_at": 1472055000,
  • "shift": 1,
  • "user": 1,
  • "user_message": "I have a doctors appointment, could I get this shift off?"
}

Retrieve an unavailability request

path Parameters
id
required
number
Example: 1

ID of the unavailability request

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "requested",
  • "requested_at": 1472055000,
  • "shift": 1,
  • "user": 1,
  • "user_message": "I have a doctors appointment, could I get this shift off?"
}

Delete an unavailability request

path Parameters
id
required
number
Example: 1

ID of the leave request

Responses

Approve an unavailability request

path Parameters
id
required
number
Example: 1

ID of the unavailability request

Request Body schema: application/json
message
string

Responses

Request samples

Content type
application/json
{
  • "message": "That's no problem, we have cover arranged"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "approved",
  • "requested_at": 1472055000,
  • "shift": 1,
  • "user": 1,
  • "admin": 3,
  • "user_message": "I have a doctors appointment, could I get this shift off?",
  • "admin_message": "That's no problem, we have cover arranged"
}

Deny an unavailability request

path Parameters
id
required
number
Example: 1

ID of the unavailability request

Request Body schema: application/json
message
string

Responses

Request samples

Content type
application/json
{
  • "message": "Sorry, there's nobody who can cover"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "status": "denied",
  • "requested_at": 1472055000,
  • "shift": 1,
  • "user": 1,
  • "admin": 3,
  • "user_message": "I have a doctors appointment, could I get this shift off?",
  • "admin_message": "Sorry, there's nobody who can cover"
}

Users

List users

query Parameters
ids
Array of any

IDs of users to retrieve

include_deleted
boolean
Example: include_deleted=true

Include deleted roles

only_managed
boolean
Example: only_managed=false

Include only people the currently authenticated user can manage

include_self
boolean
Example: include_self=false

Include the current authenticated user

Request Body schema: application/json

Location IDs to get users from

Array
any

Responses

Request samples

Content type
application/json
[
  • null
]

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Create a user

Request Body schema: application/json
level
string
send_invite
boolean
first_name
string
last_name
string
email
string
locations
Array of numbers
roles
Array of numbers
default_role
number
dob
string
start_date
string
final_working_date
any or null
weekly_hours
number
holiday_allowance
number
holiday_allowance_unit
string
payroll_id
string
salary
number
salary_type
string
overtime_rate
number
object
object
notes
string

Responses

Request samples

Content type
application/json
{
  • "level": "admin",
  • "send_invite": true,
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "notes": "Qualified first aider"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "level": "admin",
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "group": 1,
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "leave_rates_unit": "days",
  • "leave_rates_type": "deduction",
  • "notes": "Qualified first aider"
}

Retrieve a user

path Parameters
id
required
number
Example: 1

ID of the user

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "deleted": false,
  • "level": "admin",
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "group": 1,
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "leave_rates_unit": "days",
  • "leave_rates_type": "deduction",
  • "notes": "Qualified first aider"
}

Update a user

path Parameters
id
required
number
Example: 1

ID of the user

Request Body schema: application/json
deleted
boolean
level
string
first_name
string
last_name
string
email
string
group
number
locations
Array of numbers
roles
Array of numbers
default_role
number
dob
string
start_date
string
final_working_date
any or null
weekly_hours
number
holiday_allowance
number
holiday_allowance_unit
string
payroll_id
string
salary
number
salary_type
string
overtime_rate
number
object
object
notes
string

Responses

Request samples

Content type
application/json
{
  • "deleted": false,
  • "level": "admin",
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "group": 1,
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "notes": "Qualified first aider"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "level": "admin",
  • "first_name": "Joe",
  • "last_name": "Bloggs",
  • "email": "joe.bloggs@example.com",
  • "group": 1,
  • "locations": [
    ],
  • "roles": [
    ],
  • "default_role": 1,
  • "dob": "1989-04-27",
  • "start_date": "2016-01-01",
  • "final_working_date": null,
  • "weekly_hours": 40,
  • "holiday_allowance": 28,
  • "holiday_allowance_unit": "days",
  • "payroll_id": "JB0001",
  • "salary": 15,
  • "salary_type": "hourly",
  • "overtime_rate": 15,
  • "role_rates": {
    },
  • "leave_rates": {
    },
  • "leave_rates_unit": "days",
  • "leave_rates_type": "deduction",
  • "notes": "Qualified first aider"
}

Delete a user

path Parameters
id
required
number
Example: 1

ID of the user

Responses

Users_clocked_in

List clocked in users

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Clock a user in

Request Body schema: application/json
method
required
string

The method being used for clocking

shift
number

ID of the shift that is being clocked into

terminal
number

The ID of the terminal being used (if method is 'terminal')

user
number

The ID of the user clocking in (if method is 'terminal')

photo
string

Base64 encoded JPEG image of the user (if method is 'terminal')

object

Location object representing where the user is (if method is 'mobile')

Responses

Request samples

Content type
application/json
{
  • "method": "terminal",
  • "shift": 1,
  • "terminal": 1,
  • "user": 1,
  • "photo": "string",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "in_time": 1401789600,
  • "minutes_late": 0,
  • "shift": {
    },
  • "in_method": "mobile",
  • "in_location": {
    },
  • "in_device": null,
  • "in_terminal": null
}

Retrieve a clocked in user

path Parameters
id
required
number
Example: 1

ID of the user

Responses

Response samples

Content type
application/json
{
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "in_time": 1401789600,
  • "minutes_late": 0,
  • "shift": {
    },
  • "in_method": "mobile",
  • "in_location": {
    },
  • "in_device": null,
  • "in_terminal": null
}

End a users break

path Parameters
id
required
number
Example: 1

ID of the user

Request Body schema: application/json
method
required
string

The method being used for clocking

action
required
string

The action being taken

terminal
number

The ID of the terminal being used (if method is 'terminal')

photo
string

Base64 encoded JPEG image of the user (if method is 'terminal')

object

Location object representing where the user is (if method is 'mobile')

Responses

Request samples

Content type
application/json
{
  • "method": "terminal",
  • "action": "end_break",
  • "terminal": 1,
  • "photo": "string",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "start_time": 1470779220,
  • "start_location": {
    },
  • "end_time": 1470779400,
  • "end_location": {
    }
}

Clock a user out

path Parameters
id
required
number
Example: 1

ID of the user

Request Body schema: application/json
method
required
string

The method being used for clocking

terminal
number

The ID of the terminal being used (if method is 'terminal')

photo
string

Base64 encoded JPEG image of the user (if method is 'terminal')

object

Location object representing where the user is (if method is 'mobile')

Responses

Request samples

Content type
application/json
{
  • "method": "terminal",
  • "terminal": 1,
  • "photo": "string",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "id": 23404,
  • "deleted": false,
  • "approved": true,
  • "user": 1,
  • "location": 1,
  • "role": 1,
  • "in_time": 1401789600,
  • "out_time": 1468407950,
  • "minutes_break": 60,
  • "minutes_late": 0,
  • "hours": 6,
  • "hours_auto": 6,
  • "hours_is_auto": true,
  • "notes": null,
  • "shift": {
    },
  • "in_method": "mobile",
  • "in_location": {
    },
  • "in_device": null,
  • "in_terminal": null,
  • "out_method": "mobile",
  • "out_location": {
    },
  • "out_device": null,
  • "out_terminal": null
}