Team

List teams

GET /teams/

Parameters

name
Optional string
Only teams containing this string in their name will be returned.
Example: name=Sprockets
user_ids
Optional string
A comma-separated list of user IDs to filter by.
Example: user_ids=1,2,3

Response

Status: 200 OK
Link: <https://api.letsfreckle.com/v2/teams?page=2>; rel="next",
 <https://api.letsfreckle.com/v2/teams?page=5>; rel="last"
[
  {
    "id": 9283,
    "name": "R&D",
    "users": [
      {
        "id": 5538,
        "email": "[email protected]",
        "first_name": "John",
        "last_name": "Test",
        "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
        "url": "https://api.letsfreckle.com/v2/users/5538"
      }
    ],
    "url": "https://api.letsfreckle.com/v2/teams/9283",
    "entries_url": "https://api.letsfreckle.com/v2/teams/9283/entries/",
    "users_url": "https://api.letsfreckle.com/v2/teams/9283/users/",
    "created_at": "2012-01-09T08:33:29Z",
    "updated_at": "2012-01-09T08:33:29Z",
    "add_users_url": "https://api.letsfreckle.com/v2/teams/9283/add_users",
    "remove_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_users",
    "remove_all_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_all_users"
  }
]

Create a team

POST /teams/

Inputs

name
Required string
The name of the team.
user_ids
Required array of integers
The IDs of the users to include in this team.
Users can be assigned to multiple teams at once.
{
  "name": "R&D",
  "users": [
    1,
    2,
    3
  ]
}

Response

Status: 201 Created
Location: https://api.letsfreckle.com/v2/teams/1
{
  "id": 9283,
  "name": "R&D",
  "users": [
    {
      "id": 5538,
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Test",
      "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
      "url": "https://api.letsfreckle.com/v2/users/5538"
    }
  ],
  "url": "https://api.letsfreckle.com/v2/teams/9283",
  "entries_url": "https://api.letsfreckle.com/v2/teams/9283/entries/",
  "users_url": "https://api.letsfreckle.com/v2/teams/9283/users/",
  "created_at": "2012-01-09T08:33:29Z",
  "updated_at": "2012-01-09T08:33:29Z",
  "add_users_url": "https://api.letsfreckle.com/v2/teams/9283/add_users",
  "remove_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_users",
  "remove_all_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_all_users"
}

Get a team

GET /teams/:id

Response

Status: 200 OK
{
  "id": 9283,
  "name": "R&D",
  "users": [
    {
      "id": 5538,
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Test",
      "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
      "url": "https://api.letsfreckle.com/v2/users/5538"
    }
  ],
  "url": "https://api.letsfreckle.com/v2/teams/9283",
  "entries_url": "https://api.letsfreckle.com/v2/teams/9283/entries/",
  "users_url": "https://api.letsfreckle.com/v2/teams/9283/users/",
  "created_at": "2012-01-09T08:33:29Z",
  "updated_at": "2012-01-09T08:33:29Z",
  "add_users_url": "https://api.letsfreckle.com/v2/teams/9283/add_users",
  "remove_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_users",
  "remove_all_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_all_users"
}

Edit a team

PUT /teams/:id/

Inputs

name
Optional string
The name of the team
{
  "name": "R&D"
}

Response

Status: 200 OK
{
  "id": 9283,
  "name": "R&D",
  "users": [
    {
      "id": 5538,
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Test",
      "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
      "url": "https://api.letsfreckle.com/v2/users/5538"
    }
  ],
  "url": "https://api.letsfreckle.com/v2/teams/9283",
  "entries_url": "https://api.letsfreckle.com/v2/teams/9283/entries/",
  "users_url": "https://api.letsfreckle.com/v2/teams/9283/users/",
  "created_at": "2012-01-09T08:33:29Z",
  "updated_at": "2012-01-09T08:33:29Z",
  "add_users_url": "https://api.letsfreckle.com/v2/teams/9283/add_users",
  "remove_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_users",
  "remove_all_users_url": "https://api.letsfreckle.com/v2/teams/9283/remove_all_users"
}

Get the entries for users in a team

GET /teams/:id/entries

Parameters

You can use the parameters specified in the Entry API’s List Action to further limit the results

Response

Status: 200 OK
Link: <https://api.letsfreckle.com/v2/teams/:id/entries?page=2>; rel="next",
 <https://api.letsfreckle.com/v2/teams/:id/entries?page=5>; rel="last"
[
  {
    "id": 1,
    "date": "2012-01-09",
    "user": {
      "id": 5538,
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Test",
      "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
      "url": "https://api.letsfreckle.com/v2/users/5538"
    },
    "billable": true,
    "minutes": 60,
    "description": "freckle",
    "project": {
      "id": 37396,
      "name": "Gear GmbH",
      "billing_increment": 10,
      "enabled": true,
      "billable": true,
      "color": "#ff9898",
      "url": "https://api.letsfreckle.com/v2/projects/37396"
    },
    "tags": [
      {
        "id": 249397,
        "name": "freckle",
        "billable": true,
        "formatted_name": "#freckle",
        "url": "https://api.letsfreckle.com/v2/tags/249397"
      }
    ],
    "source_url": "http://someapp.com/special/url/",
    "invoiced_at": "2012-01-10T08:33:29Z",
    "invoice": {
      "id": 12345678,
      "reference": "AA001",
      "invoice_date": "2013-07-09",
      "state": "unpaid",
      "total_amount": 189.33,
      "url": "https://api.letsfreckle.com/v2/invoices/12345678"
    },
    "import": {
      "id": 8910,
      "url": "https://api.letsfreckle.com/v2/imports/8910"
    },
    "approved_at": "2012-01-10T08:33:29Z",
    "approved_by": {
      "id": 5538,
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Test",
      "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
      "url": "https://api.letsfreckle.com/v2/users/5538"
    },
    "url": "https://api.letsfreckle.com/v2/entries/1711626",
    "invoiced_outside_of_freckle_url": "https://api.letsfreckle.com/v2/entries/1711626/invoiced_outside_of_freckle",
    "approved_url": "https://api.letsfreckle.com/v2/entries/1711626/approved",
    "unapproved_url": "https://api.letsfreckle.com/v2/entries/1711626/unapproved",
    "created_at": "2012-01-09T08:33:29Z",
    "updated_at": "2012-01-09T08:33:29Z"
  }
]

Get the users in a team

GET /teams/:id/users

Parameters

You can use the parameters specified in the User API’s List Action to further limit the results

Response

Status: 200 OK
Link: <https://api.letsfreckle.com/v2/teams/:id/users?page=2>; rel="next",
 <https://api.letsfreckle.com/v2/teams/:id/users?page=5>; rel="last"
[
  {
    "id": 5538,
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Test",
    "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
    "url": "https://api.letsfreckle.com/v2/users/5538",
    "state": "active",
    "role": "leader",
    "teams": [
      {
        "id": 9283,
        "name": "R&D",
        "url": "https://api.letsfreckle.com/v2/teams/9283"
      }
    ],
    "entries": 0,
    "entries_url": "https://api.letsfreckle.com/v2/users/5538/entries",
    "expenses": 0,
    "expenses_url": "https://api.letsfreckle.com/v2/users/5538/expenses",
    "give_access_to_project_url": "https://api.letsfreckle.com/v2/users/5538/give_access_to_projects",
    "revoke_access_to_project_url": "https://api.letsfreckle.com/v2/users/5538/revoke_access_to_projects",
    "revoke_access_to_all_projects_url": "https://api.letsfreckle.com/v2/users/5538/revoke_access_to_all_projects",
    "activate_url": "https://api.letsfreckle.com/v2/users/5538/activate",
    "deactivate_url": "https://api.letsfreckle.com/v2/users/5538/deactivate",
    "created_at": "2010-06-09T20:44:57Z",
    "updated_at": "2010-06-09T20:44:57Z"
  }
]

Add users to a team

POST /teams/:id/add_users

Input

user_ids
Required array of integers
The IDs of the users to add to the team. Users can be assigned to multiple teams at once. Any users that are already associated with the team will be ignored and will not affect the Response.

Response

Status: 200 OK
[
  {
    "id": 5538,
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Test",
    "profile_image_url": "https://api.letsfreckle.com/images/avatars/0000/0001/avatar.jpg",
    "url": "https://api.letsfreckle.com/v2/users/5538",
    "state": "active",
    "role": "leader",
    "teams": [
      {
        "id": 9283,
        "name": "R&D",
        "url": "https://api.letsfreckle.com/v2/teams/9283"
      }
    ],
    "entries": 0,
    "entries_url": "https://api.letsfreckle.com/v2/users/5538/entries",
    "expenses": 0,
    "expenses_url": "https://api.letsfreckle.com/v2/users/5538/expenses",
    "give_access_to_project_url": "https://api.letsfreckle.com/v2/users/5538/give_access_to_projects",
    "revoke_access_to_project_url": "https://api.letsfreckle.com/v2/users/5538/revoke_access_to_projects",
    "revoke_access_to_all_projects_url": "https://api.letsfreckle.com/v2/users/5538/revoke_access_to_all_projects",
    "activate_url": "https://api.letsfreckle.com/v2/users/5538/activate",
    "deactivate_url": "https://api.letsfreckle.com/v2/users/5538/deactivate",
    "created_at": "2010-06-09T20:44:57Z",
    "updated_at": "2010-06-09T20:44:57Z"
  }
]

Remove users from team

PUT /teams/:id/remove_users

Input

user_ids
Required array of integers
The IDs of the users to remove from the team. Any users that are not associated with the team will be ignored and will not affect the Response.

Response

Status: 204 No Content

Remove all users from a team

PUT /teams/:id/remove_all_users

Response

Status: 204 No Content

Delete a team

When a team is deleted, the users in the team are not deleted.

DELETE /teams/:id/

Response

Status: 204 No Content