List organization time off requests
/v2/organizations/{organization_id}/time_off_requestsReturns a collection of time off requests for the given organization.
Results can be filtered by created[start]/[stop], starts_at[start]/[stop], approved_at[start]/[stop], and user_ids[].
Use include[] to sideload related users and time_off_policies.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
organization_idrequired | path | integer (int32) | |
page_start_id | query | integer (int32) | The page start ID. |
page_limit | query | integer (int32) | The default page size |
created[start] | query | string (date-time) | Start time (ISO 8601) |
created[stop] | query | string (date-time) | Stop time (ISO 8601, Exclusive) |
starts_at[start] | query | string (date-time) | Start time (ISO 8601) |
starts_at[stop] | query | string (date-time) | Stop time (ISO 8601, Exclusive) |
approved_at[start] | query | string (date-time) | Approved start time (ISO 8601) |
approved_at[stop] | query | string (date-time) | Approved stop time (ISO 8601, Exclusive) |
user_ids | query | array integer[] | List of user IDs |
include | query | array string[] | Specify related data to side load. Possible values userstime_off_policies |
Responses
200A list of time off requests
- time_off_requestsarrayarray<object>itemsobject
TimeOffRequest model
- idinteger required
Time edit log ID
- user_idinteger required
User ID
- time_off_policy_idinteger required
Time off request ID
- statusstring required
Status
- all_dayboolean required
Time off request for all day (User's time zone)
- starts_atstring required
Time off request start time
- stops_atstring required
Time off request stop time
- submitted_atstring
Time off request submission time
- approved_atstring
Time off request approving time
- denied_atstring
Time off request denial time
- paidboolean required
If the time off request has been paid
- amount_usedinteger required
Time off request amount used
- messagestring
message
- responsestring
response
- created_by_idinteger required
User ID from creator
- approved_by_idinteger
Approving User ID
- denied_by_idinteger
Denying User ID
- team_payment_detail_idinteger
Team payment detail ID
- team_payment_idinteger
Team payment ID
- time_off_request_daysobject required
Individual work days covered by this time off request
object- datestring required
Date of the time off day
- amount_usedinteger required
Amount of time used in seconds for this day
- starts_atstring required
Start time for this specific day
- stops_atstring required
Stop time for this specific day
- holidayboolean required
Whether this day is a holiday
- paidboolean required
Whether this day has been paid
- created_atstring required
When the record was created
- updated_atstring required
When the record was last updated
{
"time_off_requests": [
{
"id": 0,
"user_id": 0,
"time_off_policy_id": 0,
"status": "string",
"all_day": false,
"starts_at": "2024-01-15T10:30:00Z",
"stops_at": "2024-01-15T10:30:00Z",
"submitted_at": "2024-01-15T10:30:00Z",
"approved_at": "2024-01-15T10:30:00Z",
"denied_at": "2024-01-15T10:30:00Z",
"paid": false,
"amount_used": 0,
"message": "string",
"response": "string",
"created_by_id": 0,
"approved_by_id": 0,
"denied_by_id": 0,
"team_payment_detail_id": 0,
"team_payment_id": 0,
"time_off_request_days": {
"date": "2024-01-15",
"amount_used": 0,
"starts_at": "2024-01-15T10:30:00Z",
"stops_at": "2024-01-15T10:30:00Z",
"holiday": false,
"paid": false
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
]
}400Invalid parameters
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}401Unauthorized
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}403API access is only for organizations on an active plan
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}404Could not find record
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}429Rate limit exceeded
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}