Intervals API Resource:
time
The base URL for this resource is located at
https://api.myintervals.com/time/
Collection
| Allowed HTTP Methods | |
|---|---|
| Method | Group Access |
| GET | Administrator, Manager, Resource, Executive |
| Allowed Filters | ||||
|---|---|---|---|---|
| Filter Name | Required? | Expects | Default | Description |
| activeonly | no | boolean | If set to true, limits the list to time entries for active projects and people only. | |
| moduleid | no | integer1 | Limits the list to time entries belonging to the module whose ID was passed. | |
| taskid | no | integer1 | Limits the list to time entries belonging to the task whose ID was passed. | |
| worktypeid | no | integer1 | Limits the list to time entries belonging to the worktype whose ID was passed. | |
| personid | no | integer1 | Limits the list to time entries belonging to the person whose ID was passed. | |
| clientid | no | integer1 | Limits the list to time entries belonging to the client whose ID was passed. Passing a value of -1 returns time entries belonging to projects that do not have a client. | |
| projectid | no | integer1 | Limits the list to time entries belonging to the project whose ID was passed. | |
| milestoneid | no | integer1 | Limits the list to time entries belonging to the milestone whose ID was passed. Passing a value of -1 returns time entries that are not associated with any milestone. | |
| date | no | date | Limits the list to time entries occurring on the date passed. | |
| datebegin | no | date | Limits the list to time entries occurring after the date passed. | |
| dateend | no | date | Limits the list to time entries occurring before the date passed. | |
| datemodifiedbegin | no | datetime | Limits the list to time modified after the date passed. | |
| datemodifiedend | no | datetime | Limits the list to time modified before the date passed. | |
| billable | no | boolean | Limits the list to time entries marked as either billable or unbillable. | |
| approved | no | boolean | Limits the list to time entries on timesheets that have been approved (for 't') or timesheets that have not been approved (for 'f'). | |
| sortfield | no | string | Sort the list by any of the following fields: id, t.date, datemodified | |
| sortdir | no | string | Sets the sort direction of the returned list. Must be either "ASC" or "DESC". | |
| offset | no | integer | Return time starting from the nth time entry. | |
| limit | no | integer | 10 | Sets a limit to the amount of time entries returned in the response. |
1 Indicates that multiple values are allowed, in CSV format (e.g. "3,5,11,19").
2 This field accepts HTML, but certain HTML elements may be stripped out.
Examples
To retrieve the entire list of this resource:
GET /time/
To filter the list based on certain parameters:
GET /time/?milestoneid={value}
Note: You can string together multiple filters.
Member
| Allowed HTTP Methods | |
|---|---|
| Method | Group Access |
| GET | Administrator, Manager, Resource, Executive |
| DELETE | Administrator, Manager, Resource |
| POST | Administrator, Manager, Resource |
| PUT | Administrator, Manager, Resource |
| Settable Fields for PUT and POST Requests | ||||
|---|---|---|---|---|
| Field Name | Required? | Expects | Default | Description |
| projectid | no | integer | For adding general time, projectid is required, as is moduleid; the taskid field must be left blank (otherwise the entry will be interpreted as task time). For adding time associated with a task, this field, along with the moduleid field, may be left blank, as its values will be ignored. | |
| moduleid | no | integer | For adding general time, moduleid is required, as is projectid; the taskid field must be left blank (otherwise the entry will be interpreted as task time). For adding time associated with a task, this field, along with the projectid field, may be left blank, as its values will be ignored. | |
| taskid | no | integer | For adding time associated with a task, taskid is required. Since the task contains project and module information, moduleid and projectid may be left blank. By passing taskid, any values you pass for projectid and/or moduleid will be ignored. | |
| worktypeid | yes | integer | The worktypeid you pass should be associated with the project you pass, or in the case of task time, the project of the task you pass. | |
| personid | yes | integer | The personid you pass should be associated with the project you pass, or in the case of task time, the project of the task you pass. | |
| date | yes | date | ||
| time | yes | double | The time in decimal format. | |
| description | no | string | ||
| billable | yes | boolean | ||
| datemodified | no | datetime | The date this time entry was modified. | |
string (xxx) indicates a string with a maximum length of xxx characters.
Response Fields
The fields below are returned in GET responses. Boolean values are "t" / "f" strings. Numeric IDs and floats are returned as strings. Nullable fields may be JSON null.
| Response Fields | ||
|---|---|---|
| Field Name | Nullable | Description |
| id | no | Unique identifier for the time entry |
| projectid | yes | ID of the project the time is logged against |
| moduleid | no | ID of the project module |
| taskid | yes | ID of the task (JSON `null` for general / non-task time when applicable) |
| worktypeid | no | ID of the work type |
| personid | no | ID of the person who logged the time (Not shown to Executive users) |
| date | no | Calendar date of the entry (YYYY-MM-DD) |
| time | no | Hours logged as a decimal string (e.g. `"0.25"`, `"1"`, `"1.25"`) |
| description | yes | Optional description (empty string when none) (Not shown to Executive users) |
| billable | no | Whether the entry is billable: `"t"` or `"f"` in JSON |
| datemodified | no | When this entry was last modified (UTC, YYYY-MM-DD HH:MM:SS) |
| dateiso | no | Same calendar date as `date` (YYYY-MM-DD) |
| module | no | Module display name |
| project | no | Project name |
| worktype | no | Work type name |
| tasklocalid | no | Task local ID within the project |
| task | no | Task title (HTML entities may be escaped in JSON) |
| firstname | no | Logger’s first name (Not shown to Executive users) |
| lastname | no | Logger’s last name (Not shown to Executive users) |
| active | no | Whether the logger’s person record is active (`"t"` / `"f"` in JSON) |
| person | no | Logger’s full name (Not shown to Executive users) |
| clientid | yes | Client ID (`null` when the project has no client) |
| client | no | Client name, or a placeholder such as `No client` when none |
| clientactive | no | Whether the client is active (`"t"` / `"f"` in JSON) |
| statusid | yes | ID of the related task’s status when a task is linked |
| hourlyrate | no | Effective hourly rate for this entry as a string (visibility may vary by role) (Admin / Manager context) |
When retrieving a collection (GET /time/), the response envelope includes: personid (authenticated user's ID), status ("OK"), code (200), listcount (total matching records before limit/offset), and time (array of result objects). Defaults, no cap on limit, and how to paginate using listcount are described in the API Introduction (Pagination).
Examples
To retrieve one member resource:
GET /time/{id}/
Assuming no errors, the server will respond with 200 OK and the object requested.
To delete a particular member resource:
DELETE /time/{id}/
Assuming no errors, the server will respond with 200 OK.
To create a new member resource:
POST /time/
{ "worktypeid": value, "personid": value, "date": value, "time": value, "billable": value }
Assuming no errors, the server will respond with 201 Created and the newly-created element. This will allow you to get the id of the item you just created and verify the field values. Note: Only required fields were listed here. The entire list of possible fields is above.
To update a member resource:
PUT /time/{id}/
{ "time": value, "billable": value }
Assuming no errors, the server will respond with 202 Accepted and the entire element. This will allow you to verify the field values.
Documentation
Resources
- client
- contactdescriptor
- contacttype
- document
- expense
- group
- invoice
- invoiceitem
- invoicenote
- invoiceterm
- me
- milestone
- milestonenote
- module
- payment
- paymenttype
- person
- personcontact
- project
- projectlabel
- projectmodule
- projectnote
- projectteam
- projectworktype
- quota
- request
- task
- tasklistfilter
- tasknote
- taskpriority
- taskstatus
- time
- timer
- worktype
API Support
Looking for help?
Contact our support team.
OpenAPI
OpenAPI JSON spec (public)
Start tracking time today
Join 5,000+ companies spending their time wisely with Intervals.
Try Intervals free