Update team

PATCH
/api/v2/teams/:teamKey

Perform a partial update to a team. Updating a team uses the semantic patch format.

To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch to your Content-Type header. To learn more, read Updates using semantic patch.

Instructions

Semantic patch requests support the following kind instructions for updating teams. Several of the instructions require one or more member IDs as parameters. The member ID is returned as part of the List account members response. It is the _id field of each element in the items array.

Click to expand instructions for updating teams

addCustomRoles

Adds custom roles to the team. Team members will have these custom roles granted to them.

Parameters
  • values: List of custom role keys.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "addCustomRoles",
4 "values": [ "example-custom-role" ]
5 }]
6}

removeCustomRoles

Removes custom roles from the team. The app will no longer grant these custom roles to the team members.

Parameters
  • values: List of custom role keys.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "removeCustomRoles",
4 "values": [ "example-custom-role" ]
5 }]
6}

addRoleAttribute

Adds a role attribute to a team. Team members will have these role attribute values scoped for all custom roles granted to them.

Parameters
  • key: The role attribute key to add.
  • values: List of role attribute values for that key.

Here’s an example:

1{
2 "instructions": [
3 {
4 "kind": "addRoleAttribute",
5 "key": "testAttribute",
6 "values": ["someNewValue", "someOtherNewValue"]
7 }
8 ]
9}

updateRoleAttribute

Updates a role attribute on the team. Any existing values for the given key will be replaced with the new values. Team members will have these role attribute values scoped for all custom roles granted to them.

Parameters
  • key: The role attribute key to update.
  • values: List of role attribute values for that key.

Here’s an example:

1{
2 "instructions": [
3 {
4 "kind": "updateRoleAttribute",
5 "key": "testAttribute",
6 "values": ["someNewValue", "someOtherNewValue"]
7 }
8 ]
9}

removeRoleAttribute

Removes a role attribute from the team.

Parameters
  • key: The role attribute key to remove.

Here’s an example:

1{
2 "instructions": [
3 {
4 "kind": "removeRoleAttribute",
5 "key": "testAttribute"
6 }
7 ]
8}

addMembers

Adds members to the team.

Parameters
  • values: List of member IDs to add.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "addMembers",
4 "values": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ]
5 }]
6}

removeMembers

Removes members from the team.

Parameters
  • values: List of member IDs to remove.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "removeMembers",
4 "values": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ]
5 }]
6}

replaceMembers

Replaces the existing members of the team with the new members.

Parameters
  • values: List of member IDs of the new members.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "replaceMembers",
4 "values": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ]
5 }]
6}

addPermissionGrants

Adds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an actionSet or a list of actions but not both at the same time. The members do not have to be team members to have a permission grant for the team.

Parameters
  • actionSet: Name of the action set.
  • actions: List of actions.
  • memberIDs: List of member IDs.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "addPermissionGrants",
4 "actions": [ "updateTeamName", "updateTeamDescription" ],
5 "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ]
6 }]
7}

removePermissionGrants

Removes permission grants from members for the team. A permission grant may have either an actionSet or a list of actions but not both at the same time. The actionSet and actions must match an existing permission grant.

Parameters
  • actionSet: Name of the action set.
  • actions: List of actions.
  • memberIDs: List of member IDs.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "removePermissionGrants",
4 "actions": [ "updateTeamName", "updateTeamDescription" ],
5 "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ]
6 }]
7}

updateDescription

Updates the description of the team.

Parameters
  • value: The new description.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "updateDescription",
4 "value": "Updated team description"
5 }]
6}

updateName

Updates the name of the team.

Parameters
  • value: The new name.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "updateName",
4 "value": "Updated team name"
5 }]
6}

Expanding the teams response

LaunchDarkly supports four fields for expanding the “Update 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.
  • 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.

Path parameters

teamKeystringRequired

The team key

Query parameters

expandstringOptional

A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.

Request

This endpoint expects an object.
instructionslist of maps from strings to anyRequired

The instructions to perform when updating. This should be an array with objects that look like <code>{“kind”: “update_action”}</code>. Some instructions also require additional parameters as part of this object.

commentstringOptional

Optional comment describing the update

Response

Teams response

descriptionstringOptional

A description of the team

keystringOptional

The team key

namestringOptional

A human-friendly name for the team

_accessobjectOptional

Details on the allowed and denied actions for this team

_creationDatelongOptional

Timestamp of when the team was created

_lastModifiedlongOptional

Timestamp of when the team was most recently updated

_versionintegerOptional

The team version

_idpSyncedbooleanOptional

Whether the team has been synced with an external identity provider (IdP). Team sync is available to customers on an Enterprise plan.

roleAttributesmap from strings to lists of stringsOptional

A map of role attributes for the team

rolesobjectOptional

Paginated list of the custom roles assigned to this team. Only included if specified in the expand query parameter.

membersobjectOptional

Details on the total count of members that belong to the team. Only included if specified in the expand query parameter.

projectsobjectOptional

Paginated list of the projects that the team has any write access to. Only included if specified in the expand query parameter.

maintainersobjectOptional

Paginated list of the maintainers assigned to this team. Only included if specified in the expand query parameter.

Errors

Built with