Codebase API Documentation

Time Tracking

Tracking time in Codebase allows you to keep track of how long you spend working on a specific project. This can be viewed on a daily, weekly, monthly or custom-range basis through the interface. Each project can contain an unlimited number of "time sessions". A time session itself is made up from some text describing what you did in the session and a number of minutes spent.

We support filtering with the following optional params:

  • user the ID of the user
  • to - for time sessions that occurred to this date
  • from for time sessions that occurred from date

API URLs

Data Method URL
All time session for a project GET /project/time_sessions
Time sessions added today GET /project/time_sessions/day
Time sessions added this week GET /project/time_sessions/week
Time sessions added this month GET /project/time_sessions/month
Creating a new session POST /project/time_sessions
Show an existing session GET /project/time_sessions/session_id
Update an existing session PUT /project/time_sessions/session_id
Delete a session DELETE /project/time_sessions/session_id

Object Properties

The XML output below shows the properties which are returned by default when accessing ticket details.

GET /project/time_sessions

<time-session>
  <id type="integer">1234</id>
  <summary>Worked on the awesome time tracking in Codebase</summary>
  <minutes type="integer">180</minutes>
  <session-date type="date">2009-09-05</session-date>
  <user-id type="integer">1234</user-id>
  <created-at type="datetime">2013-09-10T18:45:44Z</created-at>
  <updated-at type="datetime">2013-09-10T18:45:44Z</updated-at>
</time-session>
  • id the unique ID for this session
  • summary Required details entered about this time session. Sessions entered through tickets or in commit messages will contain information on this space.
  • minutes Required the number of whole minutes which should be recorded.
  • user-id the ID of the user
  • session-date the date of the session took place. Should be entered in the format: yyyy-mm-dd.
  • to - for time sessions that occurred to this date (optional)
  • from for time sessions that occurred from date (optional)

Creating a new time session

When adding a new time session, you should simply send the summary and minutes fields. The user ID will be set by default to you based on your API key, otherwise you can specify another user by passing a user_id param. The session-date will be set to today unless one is provided.