HubstaffDeveloper Portal

Time entries

Track time spent on tasks

List task time entries

GET/v1/tasks/{task_id}/time_entries

Returns a collection of time entries for the given task.

Parameters

NameInTypeDescription
page_start_id
queryinteger (int32)
The page start ID.
page_limit
queryinteger (int32)
The default page size
task_idrequired
pathinteger (int32)
A task ID

Responses

200A list of time entries
object
  • time_entriesarray
    array<object>
    items
    object

    time_entry model

    • idinteger
    • commentsstring
    • user_idinteger
    • task_idinteger
    • runningboolean
    • secondsinteger
    • stopped_atstring
    • started_atstring
    • created_atstring
    • updated_atstring
Example response
json
{
  "time_entries": [
    {
      "id": 0,
      "comments": "string",
      "user_id": 0,
      "task_id": 0,
      "running": false,
      "seconds": 0,
      "stopped_at": "2024-01-15T10:30:00Z",
      "started_at": "2024-01-15T10:30:00Z",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ]
}
400Invalid parameters
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
401Unauthorized
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
403API access is only for organizations on an active plan
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
404Could not find record
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
429Rate limit exceeded
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}

Create time entry

POST/v1/tasks/{task_id}/time_entries

Creates a new time entry for the given task.

Returns the created time entry.

Time must be specified as ISO 8601 timestamps (started_at and stopped_at).

Parameters

NameInTypeDescription
task_idrequired
pathinteger (int32)
A task ID

Request body

object
  • time_entry[started_at]string required
  • time_entry[stopped_at]string required
  • time_entry[comments]string

Responses

201A time entry
object
  • time_entryobject
    object

    time_entry model

    • idinteger
    • commentsstring
    • user_idinteger
    • task_idinteger
    • runningboolean
    • secondsinteger
    • stopped_atstring
    • started_atstring
    • created_atstring
    • updated_atstring
Example response
json
{
  "time_entry": {
    "id": 0,
    "comments": "string",
    "user_id": 0,
    "task_id": 0,
    "running": false,
    "seconds": 0,
    "stopped_at": "2024-01-15T10:30:00Z",
    "started_at": "2024-01-15T10:30:00Z",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}
400Invalid parameters
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
401Unauthorized
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
403API access is only for organizations on an active plan
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
404Could not find record
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}
429Rate limit exceeded
object

HubstaffTasks_Public_V1_Entities_Error model

  • codestring

    Error code

  • errorstring

    Descriptive error message

Example response
json
{
  "code": "string",
  "error": "string"
}