All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| delete_user | DELETE /api/v2/users/{projectKey}/{environmentKey}/{userKey} | Delete user |
| get_search_users | GET /api/v2/user-search/{projectKey}/{environmentKey} | Find users |
| get_user | GET /api/v2/users/{projectKey}/{environmentKey}/{userKey} | Get user |
| get_users | GET /api/v2/users/{projectKey}/{environmentKey} | List users |
delete_user(project_key, environment_key, user_key)
Delete user
After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Delete context instances instead of this endpoint.
Delete a user by key.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.UsersApi(api_client)
project_key = 'project_key_example' # str | The project key
environment_key = 'environment_key_example' # str | The environment key
user_key = 'user_key_example' # str | The user key
try:
# Delete user
api_instance.delete_user(project_key, environment_key, user_key)
except Exception as e:
print("Exception when calling UsersApi->delete_user: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_key | str | The project key | |
| environment_key | str | The environment key | |
| user_key | str | The user key |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 204 | Action succeeded | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 409 | Status conflict | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Users get_search_users(project_key, environment_key, q=q, limit=limit, offset=offset, after=after, sort=sort, search_after=search_after, filter=filter)
Find users
After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Search for context instances instead of this endpoint.
Search users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query.
An example user attribute filter set is filter=firstName:Anna,activeTrial:false. This matches users that have the user attribute firstName set to Anna, that also have the attribute activeTrial set to false.
To paginate through results, follow the next link in the _links object. To learn more, read Representations.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.users import Users
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.UsersApi(api_client)
project_key = 'project_key_example' # str | The project key
environment_key = 'environment_key_example' # str | The environment key
q = 'q_example' # str | Full-text search for users based on name, first name, last name, e-mail address, or key (optional)
limit = 56 # int | Specifies the maximum number of items in the collection to return (max: 50, default: 20) (optional)
offset = 56 # int | Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection. (optional)
after = 56 # int | A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly (optional)
sort = 'sort_example' # str | Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order. (optional)
search_after = 'search_after_example' # str | Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. (optional)
filter = 'filter_example' # str | A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue (optional)
try:
# Find users
api_response = api_instance.get_search_users(project_key, environment_key, q=q, limit=limit, offset=offset, after=after, sort=sort, search_after=search_after, filter=filter)
print("The response of UsersApi->get_search_users:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsersApi->get_search_users: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_key | str | The project key | |
| environment_key | str | The environment key | |
| q | str | Full-text search for users based on name, first name, last name, e-mail address, or key | [optional] |
| limit | int | Specifies the maximum number of items in the collection to return (max: 50, default: 20) | [optional] |
| offset | int | Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection. | [optional] |
| after | int | A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly | [optional] |
| sort | str | Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order. | [optional] |
| search_after | str | Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. | [optional] |
| filter | str | A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Users collection response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserRecord get_user(project_key, environment_key, user_key)
Get user
After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Get context instances instead of this endpoint.
Get a user by key. The user object contains all attributes sent in variation calls for that key.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.user_record import UserRecord
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.UsersApi(api_client)
project_key = 'project_key_example' # str | The project key
environment_key = 'environment_key_example' # str | The environment key
user_key = 'user_key_example' # str | The user key
try:
# Get user
api_response = api_instance.get_user(project_key, environment_key, user_key)
print("The response of UsersApi->get_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsersApi->get_user: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_key | str | The project key | |
| environment_key | str | The environment key | |
| user_key | str | The user key |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | User response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UsersRep get_users(project_key, environment_key, limit=limit, search_after=search_after)
List users
After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Search for contexts instead of this endpoint.
List all users in the environment. Includes the total count of users. This is useful for exporting all users in the system for further analysis.
Each page displays users up to a set limit. The default is 20. To page through, follow the next link in the _links object. To learn more, read Representations.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.users_rep import UsersRep
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.UsersApi(api_client)
project_key = 'project_key_example' # str | The project key
environment_key = 'environment_key_example' # str | The environment key
limit = 56 # int | The number of elements to return per page (optional)
search_after = 'search_after_example' # str | Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. (optional)
try:
# List users
api_response = api_instance.get_users(project_key, environment_key, limit=limit, search_after=search_after)
print("The response of UsersApi->get_users:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsersApi->get_users: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_key | str | The project key | |
| environment_key | str | The environment key | |
| limit | int | The number of elements to return per page | [optional] |
| search_after | str | Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Users collection response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]