Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 4.3 KB

TeamsBetaApi.md

File metadata and controls

60 lines (39 loc) · 4.3 KB

LaunchDarklyApi.TeamsBetaApi

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

Method HTTP request Description
patchTeams PATCH /api/v2/teams Update teams

patchTeams

BulkEditTeamsRep patchTeams(teamsPatchInput)

Update teams

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. <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 { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;addMembersToTeams&quot;, &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot; ], &quot;teamKeys&quot;: [ &quot;example-team-1&quot;, &quot;example-team-2&quot; ] }] } ``` #### 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: - `{&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;addAllMembersToTeams&quot;, &quot;teamKeys&quot;: [ &quot;example-team-1&quot;, &quot;example-team-2&quot; ], &quot;filterLastSeen&quot;: { &quot;never&quot;: true } }] } ``` </details>

Example

import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';

let apiInstance = new LaunchDarklyApi.TeamsBetaApi();
let teamsPatchInput = {"comment":"Optional comment about the update","instructions":[{"kind":"addMembersToTeams","memberIDs":["1234a56b7c89d012345e678f"],"teamKeys":["example-team-1","example-team-2"]}]}; // TeamsPatchInput | 
apiInstance.patchTeams(teamsPatchInput, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
teamsPatchInput TeamsPatchInput

Return type

BulkEditTeamsRep

Authorization

ApiKey

HTTP request headers

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