All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| getExpiringFlagsForUser | GET /api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey} | Get expiring dates on flags for user |
| getUserFlagSetting | GET /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey} | Get flag setting for user |
| getUserFlagSettings | GET /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags | List flag settings for user |
| patchExpiringFlagsForUser | PATCH /api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey} | Update expiring user target for flags |
| putFlagSetting | PUT /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey} | Update flag settings for user |
ExpiringUserTargetGetResponse getExpiringFlagsForUser(projectKey, userKey, environmentKey)
Get expiring dates on flags for user
Get a list of flags for which the given user is scheduled for removal.
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.UserSettingsApi();
let projectKey = "projectKey_example"; // String | The project key
let userKey = "userKey_example"; // String | The user key
let environmentKey = "environmentKey_example"; // String | The environment key
apiInstance.getExpiringFlagsForUser(projectKey, userKey, environmentKey, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| userKey | String | The user key | |
| environmentKey | String | The environment key |
- Content-Type: Not defined
- Accept: application/json
UserFlagSetting getUserFlagSetting(projectKey, environmentKey, userKey, featureFlagKey)
Get flag setting for user
Get a single flag setting for a user by flag key. <br /><br />The `_value` is the flag variation that the user receives. The `setting` indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled.
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.UserSettingsApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let userKey = "userKey_example"; // String | The user key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
apiInstance.getUserFlagSetting(projectKey, environmentKey, userKey, featureFlagKey, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| environmentKey | String | The environment key | |
| userKey | String | The user key | |
| featureFlagKey | String | The feature flag key |
- Content-Type: Not defined
- Accept: application/json
UserFlagSettings getUserFlagSettings(projectKey, environmentKey, userKey)
List flag settings for user
Get the current flag settings for a given user. <br /><br />The `_value` is the flag variation that the user receives. The `setting` indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled and the `alternate.page` flag disabled, and that the user has not been explicitly targeted to receive a particular variation.
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.UserSettingsApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let userKey = "userKey_example"; // String | The user key
apiInstance.getUserFlagSettings(projectKey, environmentKey, userKey, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| environmentKey | String | The environment key | |
| userKey | String | The user key |
- Content-Type: Not defined
- Accept: application/json
ExpiringUserTargetPatchResponse patchExpiringFlagsForUser(projectKey, userKey, environmentKey, patchUsersRequest)
Update expiring user target for flags
Schedule the specified user for removal from individual targeting on one or more flags. The user must already be individually targeted for each flag. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. Updating an expiring target 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 expiring user targets. <details> <summary>Click to expand instructions for <strong>updating expiring user targets</strong></summary> #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `flagKey`: The flag key * `variationId`: ID of a variation on the flag * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `flagKey`: The flag key * `variationId`: ID of a variation on the flag * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. * `version`: The version of the expiring user target to update. If included, update will fail if version doesn't match current version of the expiring user target. #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until explicitly removed, or until another removal is scheduled. ##### Parameters * `flagKey`: The flag key * `variationId`: ID of a variation on the flag </details>
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.UserSettingsApi();
let projectKey = "projectKey_example"; // String | The project key
let userKey = "userKey_example"; // String | The user key
let environmentKey = "environmentKey_example"; // String | The environment key
let patchUsersRequest = new LaunchDarklyApi.PatchUsersRequest(); // PatchUsersRequest |
apiInstance.patchExpiringFlagsForUser(projectKey, userKey, environmentKey, patchUsersRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| userKey | String | The user key | |
| environmentKey | String | The environment key | |
| patchUsersRequest | PatchUsersRequest |
ExpiringUserTargetPatchResponse
- Content-Type: application/json
- Accept: application/json
putFlagSetting(projectKey, environmentKey, userKey, featureFlagKey, valuePut)
Update flag settings for user
Enable or disable a feature flag for a user based on their key. Omitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user. If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone.
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.UserSettingsApi();
let projectKey = "projectKey_example"; // String | The project key
let environmentKey = "environmentKey_example"; // String | The environment key
let userKey = "userKey_example"; // String | The user key
let featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
let valuePut = new LaunchDarklyApi.ValuePut(); // ValuePut |
apiInstance.putFlagSetting(projectKey, environmentKey, userKey, featureFlagKey, valuePut, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| projectKey | String | The project key | |
| environmentKey | String | The environment key | |
| userKey | String | The user key | |
| featureFlagKey | String | The feature flag key | |
| valuePut | ValuePut |
null (empty response body)
- Content-Type: application/json
- Accept: application/json