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
      • POSTAdd a member to teams
      • DELDelete account member
      • GETGet account member
      • POSTInvite new members
      • GETList account members
      • PATCHModify account members
      • PATCHModify an account member
    • 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
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewAccount Members

Modify account members

Beta
PATCH
/api/v2/members
PATCH
/api/v2/members
$curl -X PATCH https://app.launchdarkly.com/api/v2/members \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "instructions": [
> {
> "kind": "replaceMembersRoles",
> "memberIDs": [
> "1234a56b7c89d012345e678f",
> "507f1f77bcf86cd799439011"
> ],
> "value": "reader"
> }
> ],
> "comment": "Optional comment about the update"
>}'
1{
2 "members": [
3 "1234a56b7c89d012345e678f"
4 ],
5 "errors": [
6 {
7 "507f1f77bcf86cd799439011": "you cannot modify your own role"
8 }
9 ]
10}
> ### Full use of this API resource is an Enterprise feature > > The ability to perform a partial update to multiple members is available to customers on an Enterprise plan. If you are on another plan, you can update members individually. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/). Perform a partial update to multiple members. Updating members 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 members. <details> <summary>Click to expand instructions for <strong>updating members</strong></summary> #### replaceMembersRoles Replaces the roles of the specified members. This also removes all custom roles assigned to the specified members. ##### Parameters - `value`: The new role. Must be a valid [base role](https://launchdarkly.com/docs/home/getting-started/vocabulary#base-role). To learn more, read [Roles](https://launchdarkly.com/docs/home/account/roles). - `memberIDs`: List of member IDs. Here's an example: ```json { "instructions": [{ "kind": "replaceMembersRoles", "value": "reader", "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### replaceAllMembersRoles Replaces the roles of all members. This also removes all custom roles assigned to the specified members. Members that match any of the filters are **excluded** from the update. ##### Parameters - `value`: The new role. Must be a valid [base role](https://launchdarkly.com/docs/home/getting-started/vocabulary#base-role). To learn more, read [Roles](https://launchdarkly.com/docs/home/account/roles). - `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": "replaceAllMembersRoles", "value": "reader", "filterLastSeen": { "never": true } }] } ``` #### replaceMembersCustomRoles Replaces the custom roles of the specified members. ##### Parameters - `values`: List of new custom roles. Must be a valid custom role key or ID. - `memberIDs`: List of member IDs. Here's an example: ```json { "instructions": [{ "kind": "replaceMembersCustomRoles", "values": [ "example-custom-role" ], "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` #### replaceAllMembersCustomRoles Replaces the custom roles of all members. Members that match any of the filters are **excluded** from the update. ##### Parameters - `values`: List of new roles. Must be a valid custom role key or ID. - `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": "replaceAllMembersCustomRoles", "values": [ "example-custom-role" ], "filterLastSeen": { "never": true } }] } ``` #### replaceMembersRoleAttributes Replaces the role attributes of the specified members. ##### Parameters - `value`: Map of role attribute keys to lists of values. - `memberIDs`: List of member IDs. Here's an example: ```json { "instructions": [{ "kind": "replaceMembersRoleAttributes", "value": { "myRoleProjectKey": ["mobile", "web"], "myRoleEnvironmentKey": ["production"] }, "memberIDs": [ "1234a56b7c89d012345e678f", "507f1f77bcf86cd799439011" ] }] } ``` </details>
Was this page helpful?
Previous

Modify an account member

Next
Built with

Full use of this API resource is an Enterprise feature

The ability to perform a partial update to multiple members is available to customers on an Enterprise plan. If you are on another plan, you can update members individually. To learn more, read about our pricing. To upgrade your plan, contact Sales.

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

Click to expand instructions for updating members

replaceMembersRoles

Replaces the roles of the specified members. This also removes all custom roles assigned to the specified members.

Parameters
  • value: The new role. Must be a valid base role. To learn more, read Roles.
  • memberIDs: List of member IDs.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "replaceMembersRoles",
4 "value": "reader",
5 "memberIDs": [
6 "1234a56b7c89d012345e678f",
7 "507f1f77bcf86cd799439011"
8 ]
9 }]
10}

replaceAllMembersRoles

Replaces the roles of all members. This also removes all custom roles assigned to the specified members.

Members that match any of the filters are excluded from the update.

Parameters
  • value: The new role. Must be a valid base role. To learn more, read Roles.
  • 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": "replaceAllMembersRoles",
4 "value": "reader",
5 "filterLastSeen": { "never": true }
6 }]
7}

replaceMembersCustomRoles

Replaces the custom roles of the specified members.

Parameters
  • values: List of new custom roles. Must be a valid custom role key or ID.
  • memberIDs: List of member IDs.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "replaceMembersCustomRoles",
4 "values": [ "example-custom-role" ],
5 "memberIDs": [
6 "1234a56b7c89d012345e678f",
7 "507f1f77bcf86cd799439011"
8 ]
9 }]
10}

replaceAllMembersCustomRoles

Replaces the custom roles of all members. Members that match any of the filters are excluded from the update.

Parameters
  • values: List of new roles. Must be a valid custom role key or ID.
  • 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": "replaceAllMembersCustomRoles",
4 "values": [ "example-custom-role" ],
5 "filterLastSeen": { "never": true }
6 }]
7}

replaceMembersRoleAttributes

Replaces the role attributes of the specified members.

Parameters
  • value: Map of role attribute keys to lists of values.
  • memberIDs: List of member IDs.

Here’s an example:

1{
2 "instructions": [{
3 "kind": "replaceMembersRoleAttributes",
4 "value": {
5 "myRoleProjectKey": ["mobile", "web"],
6 "myRoleEnvironmentKey": ["production"]
7 },
8 "memberIDs": [
9 "1234a56b7c89d012345e678f",
10 "507f1f77bcf86cd799439011"
11 ]
12 }]
13}

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

Members response
memberslist of strings
A list of members IDs of the members who were successfully updated.
errorslist of maps from strings to strings
A list of member IDs and errors for the members whose updates failed.

Errors

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