Create team
Create a team. To learn more, read Creating a team.
Expanding the teams response
LaunchDarkly supports four fields for expanding the "Create team" response. By default, these fields are not included in the response.
To expand the response, append the expand query parameter and add a comma-separated list with any of the following fields:
membersincludes the total count of members that belong to the team.rolesincludes a paginated list of the custom roles that you have assigned to the team.projectsincludes a paginated list of the projects that the team has any write access to.maintainersincludes a paginated list of the maintainers that you have assigned to the team.
For example, expand=members,roles includes the members and roles fields in the response.
Authorization
ApiKey read, writeIn: header
Scope: read, write
Query Parameters
A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.
stringRequest Body
application/json
List of custom role keys the team will access
A description of the team
The team key
A list of member IDs who belong to the team
A human-friendly name for the team
A list of permission grants. Permission grants allow access to a specific action, without having to create or update a custom role.
A map of role attributes for the team
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v2/teams" \ -H "Content-Type: application/json" \ -d '{ "customRoleKeys": [ "example-role1", "example-role2" ], "description": "An example team", "key": "team-key-123abc", "memberIDs": [ "12ab3c45de678910fgh12345" ], "name": "Example team" }'{ "description": "Description for this team.", "key": "team-key-123abc", "name": "Example team", "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] }, "_creationDate": "1648671956143", "_links": { "parent": { "href": "/api/v2/teams", "type": "application/json" }, "roles": { "href": "/api/v2/teams/example-team/roles", "type": "application/json" }, "self": { "href": "/api/v2/teams/example-team", "type": "application/json" } }, "_lastModified": "1648672446072", "_version": 3, "_idpSynced": true, "roleAttributes": "{\"developerProjectKey\": [\"default\"]}", "roles": { "totalCount": 1, "items": [ { "key": "role-key-123abc", "name": "Example role", "projects": { "totalCount": 1, "items": [ { "_links": { "environments": { "href": "/api/v2/projects/example-project/environments", "type": "application/json" }, "self": { "href": "/api/v2/projects/example-project", "type": "application/json" } }, "key": "project-key-123abc", "name": "Example project" } ] }, "appliedOn": "1648672018410" } ], "_links": { "self": { "href": "/api/v2/teams/example-team/roles?limit=25", "type": "application/json" } } }, "members": { "totalCount": 15 }, "projects": { "totalCount": 1, "items": [ { "_links": { "environments": { "href": "/api/v2/projects/example-project/environments", "type": "application/json" }, "self": { "href": "/api/v2/projects/example-project", "type": "application/json" } }, "key": "project-key-123abc", "name": "Example project" } ] }, "maintainers": { "totalCount": 1, "items": [ { "_id": "569f183514f4432160000007", "_links": { "self": { "href": "/api/v2/members/569f183514f4432160000007", "type": "application/json" } }, "email": "ariel@acme.com", "firstName": "Ariel", "lastName": "Flores", "role": "reader" } ], "_links": { "self": { "href": "/api/v2/teams/example-team/maintainers?limit=20", "type": "application/json" } } }}List teams GET
Return a list of teams. By default, this returns the first 20 teams. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering teams LaunchDarkly supports the following fields for filters: - `query` is a string that matches against the teams' names and keys. It is not case-sensitive. - A request with `query:abc` returns teams with the string `abc` in their name or key. - `nomembers` is a boolean that filters the list of teams who have 0 members - A request with `nomembers:true` returns teams that have 0 members - A request with `nomembers:false` returns teams that have 1 or more members ### Sorting teams LaunchDarkly supports the following fields for sorting: - `name` sorts by team name. It is not case-sensitive. - `memberCount` sorts by the number of members on the team. By default, the sort is in ascending order. Use `-` to sort in descending order. For example, `?sort=name` sorts the response by team name in ascending order, and `?sort=-memberCount` sorts by member count from largest to smallest. Combine fields with a comma to break ties, for example `?sort=-memberCount,name`. ### Expanding the teams response LaunchDarkly supports expanding several fields in the "List teams" response. By default, these fields are **not** included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `roleAttributes` includes a list of the role attributes that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,maintainers` includes the `members` and `maintainers` fields in the response.
Get team GET
Fetch a team by key. ### Expanding the teams response LaunchDarkly supports several fields for expanding the "Get team" response. By default, these fields are **not** included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `roleAttributes` includes a list of the role attributes that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,roles` includes the `members` and `roles` fields in the response.