Skip to main content

Approvals

GET Get timesheet setups

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups

Get timesheet setups for a given workspace.

curl  https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups \
-H "Content-Type: application/json" \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace

Query

nametyperequireddescription
member_idsintegerfalseNumeric ID of the members, comma-separated
approver_idsintegerfalseNumeric ID of the approvers, comma-separated
sort_fieldstringfalseField used for sorting, default start_date.
sort_orderstringfalseSort order.

Response

200

NameTypeDescription
dataArray of object-
data
NameTypeDescription
approver_idinteger-
approver_namestring-
approversArray of object-
end_datestring-
errorsArray of object-
idinteger-
member_idinteger-
member_namestring-
periodicitystring-
permissionsstring-
reminder_daystring-
reminder_timestring-
start_datestring-
workspace_idinteger-
approvers
NameTypeDescription
namestring-
user_idinteger-
errors
NameTypeDescription
codestring-
messagestring-

400

Possible error messages:

  • Workspace not found
  • Invalid user ID
  • User not in workspace

402

Approvals are a premium feature

403

User does not have access to this resource

500

Internal Server Error

POST Create a timesheet setup

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups

Create timesheet setups.

curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups \
-H "Content-Type: application/json" \
-d '\{"approver_id":"integer","approver_ids":[\{\}],"member_ids":[\{\}],"periodicity":"string","reminder_day":"string","reminder_time":"string","start_date":"string"\}' \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace

Body

NameTypeDescription
approver_idinteger-
approver_idsArray of integer-
member_idsArray of integer-
periodicitystring-
reminder_daystring-
reminder_timestring-
start_datestring-

Response

200

NameTypeDescription
itemsArray of object-
items
NameTypeDescription
approver_idinteger-
approver_namestring-
approversArray of object-
end_datestring-
errorsArray of object-
idinteger-
member_idinteger-
member_namestring-
periodicitystring-
permissionsstring-
reminder_daystring-
reminder_timestring-
start_datestring-
workspace_idinteger-
approvers
NameTypeDescription
namestring-
user_idinteger-
errors
NameTypeDescription
codestring-
messagestring-

400

Possible error messages:

  • Workspace not found
  • Invalid user ID
  • Too many user IDs
  • Invalid date
  • Invalid periodicity
  • User not in workspace
  • User is not an admin in the workspace
  • Approver cannot be member
  • Member already has a timesheet setup

402

Approvals are a premium feature

403

User does not have access to this resource

500

Internal Server Error

POST Update a timesheet setup

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups/{setup_id}

Updates a timesheet setups.

curl -X POST https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups/{setup_id} \
-H "Content-Type: application/json" \
-d '\{"approver_id":"integer","approver_ids":[\{\}],"end_date":"string","reminder_day":"string","reminder_time":"string"\}' \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
setup_idintegertrueNumeric ID of the timesheet setup

Body

NameTypeDescription
approver_idinteger-
approver_idsArray of integer-
end_datestring-
reminder_daystring-
reminder_timestring-

Response

200

NameTypeDescription
approver_idinteger-
approver_namestring-
approversArray of object-
end_datestring-
errorsArray of object-
idinteger-
member_idinteger-
member_namestring-
periodicitystring-
permissionsstring-
reminder_daystring-
reminder_timestring-
start_datestring-
workspace_idinteger-
approvers
NameTypeDescription
namestring-
user_idinteger-
errors
NameTypeDescription
codestring-
messagestring-

400

Possible error messages:

  • Workspace not found
  • Invalid user ID
  • Invalid date
  • User is not an admin in the workspace
  • End date must respect periodicity
  • Member already has a timesheet setup

402

Approvals are a premium feature

403

User does not have access to this resource

404

Timesheet setup was not found

500

Internal Server Error

DELETE Delete a timesheet setup

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups/{setup_id}

Delete a timesheet setup for a given workspace.

curl -X DELETE https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups/{setup_id} \
-H "Content-Type: application/json" \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
setup_idintegerfalseNumeric ID of the timesheet setup

Response

200

Successful operation.

400

Possible error messages:

  • Workspace not found
  • Invalid setup ID
  • Failed to delete timesheet setup, member has approved, rejected or submitted timesheets

402

Approvals are a premium feature

403

User does not have access to this resource

500

Internal Server Error

GET Get timesheets

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets

Get timesheets applying various filters.

curl  https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets \
-H "Content-Type: application/json" \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace

Query

nametyperequireddescription
member_idsintegerfalseNumeric ID of the members, comma-separated
approver_idsintegerfalseNumeric ID of the approvers, comma-separated
timesheet_setup_idsintegerfalseNumeric ID for timesheet setup, comma-separated.
statusesintegerfalseTimesheet status, comma-separated.
beforeintegerfalseTimesheets starting before this date (YYYY-MM-DD).
afterintegerfalseTimesheets starting after this date (YYYY-MM-DD).
pageintegerfalsePage number, default 1.
per_pageintegerfalseNumber of items per page, default 20. Also defaults to 20 if provided an greater than 1000.
sort_fieldstringfalseField used for sorting, default start_date.
sort_orderstringfalseSort order.

Response

200

NameTypeDescription
itemsArray of object-
items
NameTypeDescription
dataArray of object-
pageinteger-
per_pageinteger-
total_countinteger-
data
NameTypeDescription
approved_or_rejected_atstring-
approved_or_rejected_idinteger-
approved_or_rejected_namestring-
approver_idinteger-
approver_namestring-
approversArray of object-
end_datestring-
errorsArray of object-
member_idinteger-
member_namestring-
period_editableboolean-
period_endstring-
period_lockedboolean-
period_startstring-
periodicitystring-
permissionsstring-
rejection_commentstring-
reminder_daystring-
reminder_sent_atstring-
reminder_timestring-
start_datestring-
statusstring-
submitted_atstring-
timesheet_setup_idinteger-
working_hours_in_minutesinteger-
workspace_idinteger-
approvers
NameTypeDescription
namestring-
user_idinteger-
errors
NameTypeDescription
codestring-
messagestring-

400

Possible error messages:

  • Workspace not found
  • Invalid ID
  • Invalid date
  • Invalid status

402

Approvals are a premium feature

403

User does not have access to this resource

500

Internal Server Error

PUT Update timesheets

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets/{setup_id}/{start_date}

Updates a timesheet.

curl -X PUT https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets/{setup_id}/{start_date} \
-H "Content-Type: application/json" \
-d '\{"rejection_comment":"string","status":"string"\}' \
-u <email>:<password>

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
setup_idintegertrueNumeric ID of the timesheet setup.
start_datestringtrueStart date (YYYY-MM-DD) of the timesheet.

Body

NameTypeDescription
rejection_commentstring-
statusstring-

Response

200

NameTypeDescription
approved_or_rejected_atstring-
approved_or_rejected_idinteger-
approved_or_rejected_namestring-
approver_idinteger-
approver_namestring-
approversArray of object-
end_datestring-
errorsArray of object-
member_idinteger-
member_namestring-
period_editableboolean-
period_endstring-
period_lockedboolean-
period_startstring-
periodicitystring-
permissionsstring-
rejection_commentstring-
reminder_daystring-
reminder_sent_atstring-
reminder_timestring-
start_datestring-
statusstring-
submitted_atstring-
timesheet_setup_idinteger-
working_hours_in_minutesinteger-
workspace_idinteger-
approvers
NameTypeDescription
namestring-
user_idinteger-
errors
NameTypeDescription
codestring-
messagestring-

400

Possible error messages:

  • Workspace not found
  • Invalid ID
  • Invalid date
  • Invalid status
  • Invalid status for rejection comment
  • Invalid timesheet transition

402

Approvals are a premium feature

403

User does not have access to this resource

500

Internal Server Error

© 2024 Toggl. All rights reserved.