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
    • Teams Beta
      • PATCHUpdate teams
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewTeams Beta

Update teams

PATCH
/api/v2/teams
PATCH
/api/v2/teams
$curl -X PATCH https://app.launchdarkly.com/api/v2/teams \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "instructions": [
> {
> "kind": "addMembersToTeams",
> "memberIDs": [
> "1234a56b7c89d012345e678f"
> ],
> "teamKeys": [
> "example-team-1",
> "example-team-2"
> ]
> }
> ],
> "comment": "Optional comment about the update"
>}'
1{
2 "memberIDs": [
3 "1234a56b7c89d012345e678f"
4 ],
5 "teamKeys": [
6 "example-team-1"
7 ],
8 "errors": [
9 {
10 "example-team-2": "example failure message"
11 }
12 ]
13}
Perform a partial update to multiple teams. Updating teams 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. <details> <summary>Click to expand instructions for <strong>updating teams</strong></summary> #### addMembersToTeams Add the members to teams. ##### Parameters - `memberIDs`: List of member IDs to add. - `teamKeys`: List of teams to update. Here's an example: ```json { "instructions": [{ "kind": "addMembersToTeams", "memberIDs": [ "1234a56b7c89d012345e678f" ], "teamKeys": [ "example-team-1", "example-team-2" ] }] } ``` #### addAllMembersToTeams Add all members to the team. Members that match any of the filters are **excluded** from the update. ##### Parameters - `teamKeys`: List of teams to update. - `filterLastSeen`: (Optional) A JSON object with one of the following formats: - `{"never": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - `{"noData": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps. - `{"before": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive. - `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`. - `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive. - `ignoredMemberIDs`: (Optional) A list of member IDs. Here's an example: ```json { "instructions": [{ "kind": "addAllMembersToTeams", "teamKeys": [ "example-team-1", "example-team-2" ], "filterLastSeen": { "never": true } }] } ``` </details>
Was this page helpful?
Previous

Users

Next
Built with

Perform a partial update to multiple teams. Updating teams 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.

Click to expand instructions for updating teams

addMembersToTeams

Add the members to teams.

Parameters
  • memberIDs: List of member IDs to add.
  • teamKeys: List of teams to update.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "addMembersToTeams",
4 "memberIDs": [
5 "1234a56b7c89d012345e678f"
6 ],
7 "teamKeys": [
8 "example-team-1",
9 "example-team-2"
10 ]
11 }]
12}

addAllMembersToTeams

Add all members to the team. Members that match any of the filters are excluded from the update.

Parameters
  • teamKeys: List of teams to update.
  • filterLastSeen: (Optional) A JSON object with one of the following formats:
    • {"never": true} - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.
    • {"noData": true} - Members that have not been active since LaunchDarkly began recording last seen timestamps.
    • {"before": 1608672063611} - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.
  • filterQuery: (Optional) A string that matches against the members’ emails and names. It is not case sensitive.
  • filterRoles: (Optional) A | separated list of roles and custom roles. For the purposes of this filtering, Owner counts as Admin.
  • filterTeamKey: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive.
  • ignoredMemberIDs: (Optional) A list of member IDs.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "addAllMembersToTeams",
4 "teamKeys": [
5 "example-team-1",
6 "example-team-2"
7 ],
8 "filterLastSeen": { "never": true }
9 }]
10}

Authentication

Authorizationstring
API Key authentication via header

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
memberIDslist of strings
A list of member IDs of the members who were added to the teams.
teamKeyslist of strings
A list of team keys of the teams that were successfully updated.
errorslist of maps from strings to strings
A list of team keys and errors for the teams whose updates failed.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error