HubstaffDeveloper Portal

Time off balances

Manage time off balances

List organization time off balances

GET/v2/organizations/{organization_id}/time_off_balances

Returns time off balances for the given organization.

Each entry represents one user’s balance for one time off policy in the requested year.

Use year to query balances for a specific year (defaults to current year in the organization’s timezone).

Use include[] to sideload related users and time_off_policies.

Parameters

NameInTypeDescription
organization_idrequired
pathinteger (int32)
page_start_id
queryinteger (int32)
The page start ID.
page_limit
queryinteger (int32)
The default page size
search
querystring
User name search
user_ids
queryarray integer[]
Filter by user IDs
time_off_policy_ids
queryarray integer[]
Filter by time off policy IDs
year
queryinteger (int32)
Balance year (default: current year in organization timezone)
include
queryarray string[]
Specify related data to side load.
Possible valuesuserstime_off_policies

Responses

200A list of time off balances
object
  • time_off_balancesarray
    array<object>
    items
    object

    TimeOffBalance model

    • user_idinteger required

      User ID

    • time_off_policy_idinteger required

      Time off policy ID

    • policy_namestring required

      Time off policy name

    • amountinteger required

      Balance amount in seconds

Example response
json
{
  "time_off_balances": [
    {
      "user_id": 0,
      "time_off_policy_id": 0,
      "policy_name": "string",
      "amount": 0
    }
  ]
}
400Invalid parameters
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
401Unauthorized
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
403API access is only for organizations on an active plan
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
404Could not find record
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
429Rate limit exceeded
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}

Add organization time off balance adjustments

POST/v2/organizations/{organization_id}/time_off_balances

Applies manual balance adjustments for the given organization.

Each entry in balance_adjustments specifies a policy, a list of users, an amount (in seconds), and whether to add to or replace the current balance.

If a user is not yet assigned to the specified policy, they are auto-assigned before the adjustment.

Parameters

NameInTypeDescription
organization_idrequired
pathinteger (int32)

Request body

object

Add organization time off balance adjustments

  • reasonstring required

    Reason for adjustment

  • apply_accrualsboolean

    Apply annual accrual to newly assigned users

  • balance_adjustmentsarray required
    array<object>
    items
    object
    • time_off_policy_idinteger required

      Time off policy ID

    • user_idsarray required

      User IDs to adjust

      array<integer>

      User IDs to adjust

      items
      integer(int32)
    • amountinteger required

      Amount in seconds

    • modify_balancestring required

      Whether to add to or replace the current balance

Responses

201Success
object
  • time_off_balanceobject
    object

    TimeOffBalance model

    • user_idinteger required

      User ID

    • time_off_policy_idinteger required

      Time off policy ID

    • policy_namestring required

      Time off policy name

    • amountinteger required

      Balance amount in seconds

Example response
json
{
  "time_off_balance": {
    "user_id": 0,
    "time_off_policy_id": 0,
    "policy_name": "string",
    "amount": 0
  }
}
400Invalid parameters
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
401Unauthorized
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
403API access is only for organizations on an active plan
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
404Could not find record
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}
429Rate limit exceeded
object

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.

    items
    string
Example response
json
{
  "code": "string",
  "error_code": 0,
  "error": "string",
  "details": [
    "string"
  ]
}