Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 9 KB

AccountMembersBetaApi.md

File metadata and controls

83 lines (63 loc) · 9 KB

AccountMembersBetaApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
patchMembers PATCH /api/v2/members Modify account members

patchMembers

BulkEditMembersRep patchMembers(membersPatchInput)

Modify account members

> ### 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. <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 built-in role. To learn more about built-in roles, read LaunchDarkly's built-in roles. - `memberIDs`: List of member IDs. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceMemberRoles&quot;, &quot;value&quot;: &quot;reader&quot;, &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot;, &quot;507f1f77bcf86cd799439011&quot; ] }] } ``` #### 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 built-in role. To learn more about built-in roles, read LaunchDarkly's built-in roles. - `filterLastSeen`: (Optional) A JSON object with one of the following formats: - `{&quot;never&quot;: 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. - `{&quot;noData&quot;: true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps. - `{&quot;before&quot;: 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 { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceAllMembersRoles&quot;, &quot;value&quot;: &quot;reader&quot;, &quot;filterLastSeen&quot;: { &quot;never&quot;: 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 { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceMembersCustomRoles&quot;, &quot;values&quot;: [ &quot;example-custom-role&quot; ], &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot;, &quot;507f1f77bcf86cd799439011&quot; ] }] } ``` #### 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: - `{&quot;never&quot;: 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. - `{&quot;noData&quot;: true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps. - `{&quot;before&quot;: 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 { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceAllMembersCustomRoles&quot;, &quot;values&quot;: [ &quot;example-custom-role&quot; ], &quot;filterLastSeen&quot;: { &quot;never&quot;: 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 { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceMembersRoleAttributes&quot;, &quot;value&quot;: { &quot;myRoleProjectKey&quot;: [&quot;mobile&quot;, &quot;web&quot;], &quot;myRoleEnvironmentKey&quot;: [&quot;production&quot;] }, &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot;, &quot;507f1f77bcf86cd799439011&quot; ] }] } ``` </details>

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.AccountMembersBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    AccountMembersBetaApi apiInstance = new AccountMembersBetaApi(defaultClient);
    MembersPatchInput membersPatchInput = new MembersPatchInput(); // MembersPatchInput | 
    try {
      BulkEditMembersRep result = apiInstance.patchMembers(membersPatchInput);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AccountMembersBetaApi#patchMembers");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
membersPatchInput MembersPatchInput

Return type

BulkEditMembersRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Members response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
409 Status conflict -
429 Rate limited -