Admin privileges required for these API methods.
Team is a resource that belongs to an Account and allows you to group users and permissions to repositories into a single entity.
id | integer | Unique ID of the team. |
---|---|---|
color_label | string | Name of the specified color label. See a list of available labels below. |
updated_at | datetime | Time when the integration was last updated. |
created_at | datetime | Time when the integration was first added to the system. |
name | string | Name of your team. |
---|---|---|
color_label | string | Color label used for your team. |
users | array | An array of user ID’s. |
permissions | hash | Hash of repositories ID’s mapped to permissions. Format is specified below. |
GET /api/teams.json
Click to expand…
json http-response[
{
"team": {
"id": 1,
"name": "Beanstalk",
"color_label": "green",
"created_at": "2013/10/28 09:55:56 -0500",
"updated_at": "2014/02/01 11:30:07 -0500"
}
},
{
"team": {
"id": 2,
"name": "Postmark",
"color_label": "yellow",
"created_at": "2013/10/28 06:54:32 -0500",
"updated_at": "2014/01/31 01:01:23 -0500"
}
},
{
"team": {
"id": 3,
"name": "dploy.io",
"color_label": "purple",
"created_at": "2013/12/12 03:45:43 -0500",
"updated_at": "2014/01/31 01:01:02 -0500"
}
}
]
GET /api/teams/{TEAM_ID}.json
Click to expand…
json http-response{
"team": {
"id": 1,
"name": "Beanstalk",
"color_label": "green",
"created_at": "2013/10/28 09:55:56 -0500",
"updated_at": "2014/02/01 11:30:07 -0500"
}
}
Create a new team. Specify users and permissions to repositories in a single call.
true
for write and read access, false
for read-onlytrue
when user can deploy, false
means user can’t deploytrue
when user configure deployment environments, false
when users can’t configure deployment environments.POST /api/teams.json
{
"name": "Designers",
"color_label": "red",
"users": [3],
"permissions":{
"1": {
"write": true,
"deploy": true,
"configure_deployments": false
},
"2": {
"write": true,
"deploy": true,
"configure_deployments": false
}
}
}
Click to expand…
json http-response{
"team": {
"id": 1,
"name": "Designers",
"color_label": "red",
"created_at": "2014/02/12 12:30:21 -0500",
"updated_at": "2014/02/12 12:30:21 -0500",
"users": [
{
"id": 3,
"name": "Eugene Fedorenko",
"first_name": "Eugene",
"last_name": "Fedorenko",
"username": "eugene",
"email": "eugene@wildbit.com",
"account_id": 1,
"admin": true,
"owner": false,
"timezone": "Pacific Time (US & Canada)",
"created_at": "2010/03/01 10:13:17 -0700",
"updated_at": "2014/02/19 01:23:45 -0700"
}
],
"permissions" : [
{
"repository_id": 1,
"repository_title": "Beanstalk",
"write": true,
"deploy": true,
"configure_deployments": false
},
{
"repository_id": 2,
"repository_title": "Postmark",
"write": true,
"deploy": true,
"configure_deployments": false
}
]
}
}
This operation is considered a bulk update. All previous permissions and users for the team will be replaced with the new permissions and users provided in this call.
true
for write and read access, false
for read-onlytrue
when user can deploy, false
means user can’t deploytrue
when user configure deployment environments, false
when users can’t configure deployment environments.PUT /api/teams/{TEAM_ID}.json
{
"color_label": "green",
"users": [3, 4],
"permissions":{
"1": {
"write": true,
"deploy": true,
"configure_deployments": false
},
"2": {
"write": true,
"deploy": true,
"configure_deployments": false
},
"3": {
"write": true,
"deploy": true,
"configure_deployments": false
}
}
}
Click to expand…
json http-response{
"team": {
"id": 1,
"name": "Designers",
"color_label": "green",
"created_at": "2014/02/12 12:30:21 -0500",
"updated_at": "2014/02/12 12:30:21 -0500",
"users": [
{
"id": 3,
"name": "Eugene Fedorenko",
"first_name": "Eugene",
"last_name": "Fedorenko",
"username": "eugene",
"email": "eugene@wildbit.com",
"account_id": 1,
"admin": true,
"owner": false,
"timezone": "Pacific Time (US & Canada)",
"created_at": "2010/03/01 10:13:17 -0700",
"updated_at": "2014/02/19 01:23:45 -0700"
},
{
"id": 4,
"name": "Eugene Fedorenko Jr.",
"first_name": "Eugene",
"last_name": "Fedorenko Jr.",
"username": "eugenejr",
"email": "eugene.jr@wildbit.com",
"account_id": 1,
"admin": false,
"owner": false,
"timezone": "Pacific Time (US & Canada)",
"created_at": "2011/03/01 10:13:17 -0700",
"updated_at": "2014/02/19 01:23:45 -0700"
}
],
"permissions" : [
{
"repository_id": 1,
"repository_title": "Beanstalk",
"write": true,
"deploy": true,
"configure_deployments": false
},
{
"repository_id": 2,
"repository_title": "Postmark",
"write": true,
"deploy": true,
"configure_deployments": false
},
{
"repository_id": 3,
"repository_title": "dploy.io",
"write": true,
"deploy": true,
"configure_deployments": false
}
]
}
}
This action permanently deletes the team and its assoicated permissions.
DELETE /api/teams/{ID}.json
Click to expand…
json http-responseHEAD 200 OK
Retrieve all users on the team.
GET /api/teams/{ID}/users.json
Click to expand…
json http-response[
{
"user": {
"id": 2,
"login": "chris",
"last_name": "Ledet",
"first_name": "Chris",
"name": "Chris Ledet",
"email": "chris.ledet@wildbit.com",
"owner": true,
"admin": false,
"account_id": 2,
"timezone": "Eastern",
"created_at": "2013/03/01 08:35:00 +[0800",
"updated_at": "2014/02/05 14:14:58 +0800"
}
}
]
Use this end-point when you only want to add a user to a team.
PUT /api/teams/{ID}/users.json
{
"user_id": 4
}
Click to expand…
json http-responseHEAD 200 OK
Use this end-point when you only want to remove a user from a team.
DELETE /api/teams/{ID}/users/{USER_ID}.json
Click to expand…
json http-responseHEAD 200 OK