HubstaffDeveloper Portal

Attendance schedules

Define work schedules and expected attendance for team members

Update attendance schedule

PUT/v2/attendance_schedules/{attendance_schedule_id}

Updates an attendance schedule.

Returns the updated attendance schedule.

Only pass in the fields you want to change. Use add_excluded_dates/remove_excluded_dates to modify exclusions incrementally, or excluded_dates to replace them entirely.

Parameters

NameInTypeDescription
attendance_schedule_idrequired
pathinteger (int32)
Attendance schedule ID

Request body

object

Update attendance schedule

  • start_datestring

    Attendance Schedule Start Date

  • start_timestring

    Attendance Schedule Start Time, 24 hour time in 30 minutes intervals (h:mm)

  • use_time_zonestring

    What time zone to use

  • durationinteger

    Shift duration in seconds

  • minimum_timeinteger

    Minimum shift time in seconds

  • repeat_schedulestring

    Shift repetition schedule

  • repeat_untilstring

    Shift end date

  • weekdaysarray

    Shift repetition week days

    array<string>

    Shift repetition week days

    items
    string
  • excluded_datesarray

    Excluded dates from the repetition schedule

    array<string>

    Excluded dates from the repetition schedule

    items
    string(date)
  • add_excluded_datesarray

    Excluded dates to add

    array<string>

    Excluded dates to add

    items
    string(date)
  • remove_excluded_datesarray

    Excluded dates to remove

    array<string>

    Excluded dates to remove

    items
    string(date)

Responses

200An attendance schedule
object
  • attendance_scheduleobject
    object

    AttendanceSchedule model

    • idinteger required

      Attendance schedule ID

    • user_idinteger required

      User ID

    • organization_idinteger required

      Organization ID

    • created_atstring required

      When the record was created

    • updated_atstring required

      When the record was last updated

    • start_datestring required

      Shift start date

    • use_time_zonestring required

      What time zone to use

    • start_timestring required

      Shift start time (only hh:mm:ss

    • durationinteger required

      Shift duration

    • minimum_timeinteger required

      Minimum shift time

    • repeat_schedulestring required

      Shift repetition schedule

    • repeat_untilstring

      Shift end date

    • weekdaysarray

      Shift repetition week days

      array<string>

      Shift repetition week days

      items
      string
    • excluded_datesarray

      Excluded dates from the repetition schedule

      array<string>

      Excluded dates from the repetition schedule

      items
      string(date)
Example response
json
{
  "attendance_schedule": {
    "id": 0,
    "user_id": 0,
    "organization_id": 0,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z",
    "start_date": "2024-01-15",
    "use_time_zone": "string",
    "start_time": "2024-01-15T10:30:00Z",
    "duration": 0,
    "minimum_time": 0,
    "repeat_schedule": "string",
    "repeat_until": "2024-01-15",
    "weekdays": [
      "string"
    ],
    "excluded_dates": [
      "2024-01-15"
    ]
  }
}
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"
  ]
}

List organization attendance schedules

GET/v2/organizations/{organization_id}/attendance_schedules

Returns a collection of attendance schedules (expected work shifts) for the given organization.

Use date[start] and date[stop] to filter schedules that cover the specified date range. Repeating schedules are included if any occurrence falls within the range.

Parameters

NameInTypeDescription
organization_idrequired
pathinteger (int32)
page_start_id
queryinteger (int32)
The page start ID.
page_limit
queryinteger (int32)
The default page size
date[start]required
querystring (date)
Start date (ISO 8601)
date[stop]required
querystring (date)
Stop date (ISO 8601, Inclusive)
include
queryarray string[]
Specify related data to side load.
Possible valuesusers

Responses

200A list of attendance schedules
object
  • attendance_schedulesarray
    array<object>
    items
    object

    AttendanceSchedule model

    • idinteger required

      Attendance schedule ID

    • user_idinteger required

      User ID

    • organization_idinteger required

      Organization ID

    • created_atstring required

      When the record was created

    • updated_atstring required

      When the record was last updated

    • start_datestring required

      Shift start date

    • use_time_zonestring required

      What time zone to use

    • start_timestring required

      Shift start time (only hh:mm:ss

    • durationinteger required

      Shift duration

    • minimum_timeinteger required

      Minimum shift time

    • repeat_schedulestring required

      Shift repetition schedule

    • repeat_untilstring

      Shift end date

    • weekdaysarray

      Shift repetition week days

      array<string>

      Shift repetition week days

      items
      string
    • excluded_datesarray

      Excluded dates from the repetition schedule

      array<string>

      Excluded dates from the repetition schedule

      items
      string(date)
Example response
json
{
  "attendance_schedules": [
    {
      "id": 0,
      "user_id": 0,
      "organization_id": 0,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z",
      "start_date": "2024-01-15",
      "use_time_zone": "string",
      "start_time": "2024-01-15T10:30:00Z",
      "duration": 0,
      "minimum_time": 0,
      "repeat_schedule": "string",
      "repeat_until": "2024-01-15",
      "weekdays": [
        "string"
      ],
      "excluded_dates": [
        "2024-01-15"
      ]
    }
  ]
}
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"
  ]
}

Create attendance schedule

POST/v2/organizations/{organization_id}/attendance_schedules

Creates an expected work shift for a user.

Returns the created attendance schedule.

For repeating schedules, specify repeat_schedule (weekly/bi_weekly) and weekdays. Use repeat_until to set an end date. Use excluded_dates to skip specific dates.

Parameters

NameInTypeDescription
organization_idrequired
pathinteger (int32)

Request body

object

Create attendance schedule

  • user_idinteger required

    User ID

  • start_datestring required

    Attendance Schedule Start Date

  • start_timestring required

    Attendance Schedule Start Time, 24 hour time in 30 minutes intervals (h:mm)

  • durationinteger required

    Shift duration in seconds

  • minimum_timeinteger required

    Minimum shift time in seconds

  • use_time_zonestring required

    What time zone to use

  • repeat_schedulestring required

    Shift repetition schedule

  • weekdaysarray

    Shift repetition week days

    array<string>

    Shift repetition week days

    items
    string
  • repeat_untilstring

    Shift end date

  • excluded_datesarray

    Excluded dates from the repetition schedule

    array<string>

    Excluded dates from the repetition schedule

    items
    string(date)

Responses

200attendance schedule created
object
  • attendance_scheduleobject
    object

    AttendanceSchedule model

    • idinteger required

      Attendance schedule ID

    • user_idinteger required

      User ID

    • organization_idinteger required

      Organization ID

    • created_atstring required

      When the record was created

    • updated_atstring required

      When the record was last updated

    • start_datestring required

      Shift start date

    • use_time_zonestring required

      What time zone to use

    • start_timestring required

      Shift start time (only hh:mm:ss

    • durationinteger required

      Shift duration

    • minimum_timeinteger required

      Minimum shift time

    • repeat_schedulestring required

      Shift repetition schedule

    • repeat_untilstring

      Shift end date

    • weekdaysarray

      Shift repetition week days

      array<string>

      Shift repetition week days

      items
      string
    • excluded_datesarray

      Excluded dates from the repetition schedule

      array<string>

      Excluded dates from the repetition schedule

      items
      string(date)
Example response
json
{
  "attendance_schedule": {
    "id": 0,
    "user_id": 0,
    "organization_id": 0,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z",
    "start_date": "2024-01-15",
    "use_time_zone": "string",
    "start_time": "2024-01-15T10:30:00Z",
    "duration": 0,
    "minimum_time": 0,
    "repeat_schedule": "string",
    "repeat_until": "2024-01-15",
    "weekdays": [
      "string"
    ],
    "excluded_dates": [
      "2024-01-15"
    ]
  }
}
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"
  ]
}