Project Roles

List Roles on a Project

GET /projects/{id}/roles.json

This lets you query the list of roles set on a project. 

Response

{
  "roles": [
    {
      "users": [
        {
          "firstname": "MJ",
          "id": "431",
          "userimage": "http://somesite.teamwork.com/images/users/xxx.jpg",
          "title": "",
          "lastname": "Heffernan"
        }
      ],
      "name": "Some Role",
      "description": "",
      "id": "22"
    },
    {
      "users": [
        {
          "firstname": "Daniel",
          "id": "414",
          "userimage": "http://somesite.teamwork.com/images/users/yyyy.jpg",
          "title": "",
          "lastname": "Mackey"
        },
        {
          "firstname": "MJ",
          "id": "431",
          "userimage": "http://somesite.teamwork.com/images/users/xxx.jpg",
          "title": "",
          "lastname": "Heffernan"
        }
      ],
      "name": "Developers Edited",
      "description": "People actively developing this project",
      "id": "23"
    }
  ]
}


Add a role to a project

POST /projects/{id}/roles.json

Add a role to a specific project

Request

{
  "role": {
    "users": "414,431",
    "name": "Developers",
    "description": "People actively developing this project"
  }
}

Response

200 on success and ID of new role


Update a role on a project

PUT /roles/{id}.json

Update a specific role

Request

{
  "role": {
    "users": "414,431",
    "name": "Developers Edited",
    "description": "People actively developing this project"
  }
}

Response

200 on success


Delete a role

DELETE /roles/{id}.json

Returns 200 on success


Get an individual role

GET /roles/{role_id}.json

Returns 200 on success

Response

{
	"role": {
		"users": [
			{
				"firstname": "John",
				"id": "255302",
				"userimage": "",
				"title": "",
				"lastname": "Doe"
			}
		],
		"name": "developer",
		"description": "developer role",
		"id": "500",
		"projectId": "12345"
	}
}