For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
      • POSTAdd multiple members to team
      • POSTCreate team
      • DELDelete team
      • GETGet team
      • GETGet team custom roles
      • GETGet team maintainers
      • GETList teams
      • PATCHUpdate team
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewTeams

Update team

PATCH
/api/v2/teams/:teamKey
PATCH
/api/v2/teams/:teamKey
$curl -X PATCH https://app.launchdarkly.com/api/v2/teams/teamKey \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "instructions": [
> {
> "kind": "updateDescription",
> "value": "New description for the team"
> }
> ],
> "comment": "Optional comment about the update"
>}'
1{
2 "description": "Description for this team.",
3 "key": "team-key-123abc",
4 "name": "Example team",
5 "_access": {
6 "denied": [
7 {
8 "action": "string",
9 "reason": {
10 "effect": "allow",
11 "resources": [
12 "proj/*:env/*;qa_*:/flag/*"
13 ],
14 "notResources": [
15 "string"
16 ],
17 "actions": [
18 "*"
19 ],
20 "notActions": [
21 "string"
22 ],
23 "role_name": "string"
24 }
25 }
26 ],
27 "allowed": [
28 {
29 "action": "string",
30 "reason": {
31 "effect": "allow",
32 "resources": [
33 "proj/*:env/*;qa_*:/flag/*"
34 ],
35 "notResources": [
36 "string"
37 ],
38 "actions": [
39 "*"
40 ],
41 "notActions": [
42 "string"
43 ],
44 "role_name": "string"
45 }
46 }
47 ]
48 },
49 "_creationDate": 1648671956143,
50 "_links": {
51 "parent": {
52 "href": "/api/v2/teams",
53 "type": "application/json"
54 },
55 "roles": {
56 "href": "/api/v2/teams/example-team/roles",
57 "type": "application/json"
58 },
59 "self": {
60 "href": "/api/v2/teams/example-team",
61 "type": "application/json"
62 }
63 },
64 "_lastModified": 1648672446072,
65 "_version": 3,
66 "_idpSynced": true,
67 "roleAttributes": "{\"developerProjectKey\": [\"default\"]}",
68 "roles": {
69 "totalCount": 1,
70 "items": [
71 {
72 "key": "role-key-123abc",
73 "name": "Example role",
74 "projects": {
75 "totalCount": 1,
76 "items": [
77 {
78 "_id": "57be1db38b75bf0772d11383",
79 "_links": {
80 "environments": {
81 "href": "/api/v2/projects/example-project/environments",
82 "type": "application/json"
83 },
84 "self": {
85 "href": "/api/v2/projects/example-project",
86 "type": "application/json"
87 }
88 },
89 "key": "project-key-123abc",
90 "name": "Example project"
91 }
92 ]
93 },
94 "appliedOn": 1648672018410
95 }
96 ],
97 "_links": {
98 "self": {
99 "href": "/api/v2/teams/example-team/roles?limit=25",
100 "type": "application/json"
101 }
102 }
103 },
104 "members": {
105 "totalCount": 15
106 },
107 "projects": {
108 "totalCount": 1,
109 "items": [
110 {
111 "_id": "57be1db38b75bf0772d11383",
112 "_links": {
113 "environments": {
114 "href": "/api/v2/projects/example-project/environments",
115 "type": "application/json"
116 },
117 "self": {
118 "href": "/api/v2/projects/example-project",
119 "type": "application/json"
120 }
121 },
122 "key": "project-key-123abc",
123 "name": "Example project"
124 }
125 ]
126 },
127 "maintainers": {
128 "totalCount": 1,
129 "items": [
130 {
131 "_links": {
132 "self": {
133 "href": "/api/v2/members/569f183514f4432160000007",
134 "type": "application/json"
135 }
136 },
137 "_id": "569f183514f4432160000007",
138 "role": "reader",
139 "email": "ariel@acme.com",
140 "firstName": "Ariel",
141 "lastName": "Flores"
142 }
143 ],
144 "_links": {
145 "self": {
146 "href": "/api/v2/teams/example-team/maintainers?limit=20",
147 "type": "application/json"
148 }
149 }
150 }
151}
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](https://launchdarkly.com/docs/api#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](https://launchdarkly.com/docs/api/account-members/get-members) response. It is the `_id` field of each element in the `items` array. <details> <summary>Click to expand instructions for <strong>updating teams</strong></summary> #### 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: ```json { "instructions": [{ "kind": "addCustomRoles", "values": [ "example-custom-role" ] }] } ``` #### addMembers Adds members to the team. ##### Parameters - `values`: List of member IDs to add. Here's an example: ```json { "instructions": [{ "kind": "addMembers", "values": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### 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: ```json { "instructions": [{ "kind": "addPermissionGrants", "actions": [ "updateTeamName", "updateTeamDescription" ], "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### 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: ```json { "instructions": [ { "kind": "addRoleAttribute", "key": "testAttribute", "values": ["someNewValue", "someOtherNewValue"] } ] } ``` #### 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: ```json { "instructions": [{ "kind": "removeCustomRoles", "values": [ "example-custom-role" ] }] } ``` #### removeMembers Removes members from the team. ##### Parameters - `values`: List of member IDs to remove. Here's an example: ```json { "instructions": [{ "kind": "removeMembers", "values": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### 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: ```json { "instructions": [{ "kind": "removePermissionGrants", "actions": [ "updateTeamName", "updateTeamDescription" ], "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### removeRoleAttribute Removes a role attribute from the team. ##### Parameters - `key`: The role attribute key to remove. Here's an example: ```json { "instructions": [ { "kind": "removeRoleAttribute", "key": "testAttribute" } ] } ``` #### 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: ```json { "instructions": [{ "kind": "replaceMembers", "values": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### replaceRoleAttributes Replaces the existing role attributes for the team with new role attributes. ##### Parameters - `value`: A map of role attribute keys to lists of role attribute values Here's an example: ```json { "instructions": [{ "kind": "replaceRoleAttributes", "value": { "testAttribute": [ "someNewValue", "someOtherNewValue" ], "projectRoleAttribute": [ "project1", "project2"] } }] } ``` #### updateDescription Updates the description of the team. ##### Parameters - `value`: The new description. Here's an example: ```json { "instructions": [{ "kind": "updateDescription", "value": "Updated team description" }] } ``` #### updateName Updates the name of the team. ##### Parameters - `value`: The new name. Here's an example: ```json { "instructions": [{ "kind": "updateName", "value": "Updated team name" }] } ``` #### 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: ```json { "instructions": [ { "kind": "updateRoleAttribute", "key": "testAttribute", "values": ["someNewValue", "someOtherNewValue"] } ] } ``` </details> ### 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.
Was this page helpful?
Previous

Teams Beta

Next
Built with

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}

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}

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}

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}

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}

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}

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}

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}

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}

replaceRoleAttributes

Replaces the existing role attributes for the team with new role attributes.

Parameters
  • value: A map of role attribute keys to lists of role attribute values

Here’s an example:

1{
2 "instructions": [{
3 "kind": "replaceRoleAttributes",
4 "value": {
5 "testAttribute": [ "someNewValue", "someOtherNewValue" ],
6 "projectRoleAttribute": [ "project1", "project2"]
7 }
8 }]
9}

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}

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}

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.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

teamKeystringRequiredformat: "string"
The team key

Query parameters

expandstringOptionalformat: "string"

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
descriptionstring
A description of the team
keystring
The team key
namestring

A human-friendly name for the team

_accessobject
Details on the allowed and denied actions for this team
_creationDatelong
Timestamp of when the team was created
_linksmap from strings to objects
The location and content type of related resources
_lastModifiedlong
Timestamp of when the team was most recently updated
_versioninteger
The team version
_idpSyncedboolean

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 strings
A map of role attributes for the team
rolesobject

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

membersobject

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

projectsobject

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

maintainersobject

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

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
405
Method Not Allowed Error
409
Conflict Error
429
Too Many Requests Error