All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
delete_member | DELETE /api/v2/members/{id} | Delete account member |
get_member | GET /api/v2/members/{id} | Get account member |
get_members | GET /api/v2/members | List account members |
patch_member | PATCH /api/v2/members/{id} | Modify an account member |
post_member_teams | POST /api/v2/members/{id}/teams | Add a member to teams |
post_members | POST /api/v2/members | Invite new members |
delete_member(id)
Delete account member
Delete a single account member by ID. Requests to delete account members will not work if SCIM is enabled for the account.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import account_members_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
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'] = 'YOUR_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 = account_members_api.AccountMembersApi(api_client)
id = "id_example" # str | The member ID
# example passing only required values which don't have defaults set
try:
# Delete account member
api_instance.delete_member(id)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->delete_member: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | The member ID |
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]
Member get_member(id)
Get account member
Get a single account member by member ID. me
is a reserved value for the id
parameter that returns the caller's member information.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import account_members_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.member import Member
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
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'] = 'YOUR_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 = account_members_api.AccountMembersApi(api_client)
id = "id_example" # str | The member ID
expand = "expand_example" # str | A comma-separated list of properties that can reveal additional information in the response. (optional)
# example passing only required values which don't have defaults set
try:
# Get account member
api_response = api_instance.get_member(id)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->get_member: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get account member
api_response = api_instance.get_member(id, expand=expand)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->get_member: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | The member ID | |
expand | str | A comma-separated list of properties that can reveal additional information in the response. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Member response | - |
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]
Members get_members()
List account members
Return a list of account members. By default, this returns the first 20 members. Page through this list with the limit
parameter and by following the first
, prev
, next
, and last
links in the returned _links
field. These links are not present if the pages they refer to don't exist. For example, the first
and prev
links will be missing from the response on the first page. ### Filtering members LaunchDarkly supports the following fields for filters: - query
is a string that matches against the members' emails and names. It is not case sensitive. - role
is a |
separated list of roles and custom roles. It filters the list to members who have any of the roles in the list. For the purposes of this filtering, Owner
counts as Admin
. - id
is a |
separated list of member IDs. It filters the list to members who match any of the IDs in the list. - email
is a |
separated list of member emails. It filters the list to members who match any of the emails in the list. - team
is a string that matches against the key of the teams the members belong to. It is not case sensitive. - noteam
is a boolean that filters the list of members who are not on a team if true and members on a team if false. - lastSeen
is a JSON object in 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. - accessCheck
is a string that represents a specific action on a specific resource and is in the format <ActionSpecifier>:<ResourceSpecifier>
. It filters the list to members who have the ability to perform that action on that resource. Note: accessCheck
is only supported in API version 20220603
and earlier. To learn more, read Versioning. - For example, the filter accessCheck:createApprovalRequest:proj/default:env/test:flag/alternate-page
matches members with the ability to create an approval request for the alternate-page
flag in the test
environment of the default
project. - Wildcard and tag filters are not supported when filtering for access. For example, the filter query:abc,role:admin|customrole
matches members with the string abc
in their email or name, ignoring case, who also are either an Owner
or Admin
or have the custom role customrole
. ### Sorting members LaunchDarkly supports two fields for sorting: displayName
and lastSeen
: - displayName
sorts by first + last name, using the member's email if no name is set. - lastSeen
sorts by the _lastSeen
property. LaunchDarkly considers members that have never been seen or have no data the oldest.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import account_members_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.members import Members
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'] = 'YOUR_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 = account_members_api.AccountMembersApi(api_client)
limit = 1 # int | The number of members to return in the response. Defaults to 20. (optional)
offset = 1 # int | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
filter = "filter_example" # str | A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above. (optional)
expand = "expand_example" # str | A comma-separated list of properties that can reveal additional information in the response. (optional)
sort = "sort_example" # str | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# List account members
api_response = api_instance.get_members(limit=limit, offset=offset, filter=filter, expand=expand, sort=sort)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->get_members: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | The number of members to return in the response. Defaults to 20. | [optional] |
offset | int | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | [optional] |
filter | str | A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above. | [optional] |
expand | str | A comma-separated list of properties that can reveal additional information in the response. | [optional] |
sort | str | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Members collection response | - |
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]
Member patch_member(id, json_patch)
Modify an account member
Update a single account member. Updating a member uses a JSON patch representation of the desired changes. To learn more, read Updates. To update fields in the account member object that are arrays, set the path
to the name of the field and then append /<array index>
. Use /0
to add to the beginning of the array. Use /-
to add to the end of the array. For example, to add a new custom role to a member, use the following request body: [ { \"op\": \"add\", \"path\": \"/customRoles/0\", \"value\": \"some-role-id\" } ]
You can update only an account member's role or custom role using a JSON patch. Members can update their own names and email addresses though the LaunchDarkly UI. When SAML SSO or SCIM is enabled for the account, account members are managed in the Identity Provider (IdP). Requests to update account members will succeed, but the IdP will override the update shortly afterwards.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import account_members_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.member import Member
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
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'] = 'YOUR_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 = account_members_api.AccountMembersApi(api_client)
id = "id_example" # str | The member ID
json_patch = JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]) # JSONPatch |
# example passing only required values which don't have defaults set
try:
# Modify an account member
api_response = api_instance.patch_member(id, json_patch)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->patch_member: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | The member ID | |
json_patch | JSONPatch |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Member response | - |
400 | Invalid request | - |
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]
Member post_member_teams(id, member_teams_post_input)
Add a member to teams
Add one member to one or more teams.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import account_members_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.member import Member
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.member_teams_post_input import MemberTeamsPostInput
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
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'] = 'YOUR_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 = account_members_api.AccountMembersApi(api_client)
id = "id_example" # str | The member ID
member_teams_post_input = MemberTeamsPostInput(
team_keys=["team1","team2"],
) # MemberTeamsPostInput |
# example passing only required values which don't have defaults set
try:
# Add a member to teams
api_response = api_instance.post_member_teams(id, member_teams_post_input)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->post_member_teams: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | The member ID | |
member_teams_post_input | MemberTeamsPostInput |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Member response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Member not found | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Members post_members(new_member_form_list_post)
Invite new members
Invite one or more new members to join an account. Each member is sent an invitation. Members with "admin" or "owner" roles may create new members, as well as anyone with a "createMember" permission for "member/\*". If a member cannot be invited, the entire request is rejected and no members are invited from that request. Each member must have an email
field and either a role
or a customRoles
field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the "message" field of the response. Requests to create account members will not work if SCIM is enabled for the account. No more than 50 members may be created per request. A request may also fail because of conflicts with existing members. These conflicts are reported using the additional code
and invalid_emails
response fields with the following possible values for code
: - email_already_exists_in_account: A member with this email address already exists in this account. - email_taken_in_different_account: A member with this email address exists in another account. - duplicate_emails: This request contains two or more members with the same email address. A request that fails for one of the above reasons returns an HTTP response code of 400 (Bad Request).
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import account_members_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.members import Members
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from launchdarkly_api.model.new_member_form_list_post import NewMemberFormListPost
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'] = 'YOUR_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 = account_members_api.AccountMembersApi(api_client)
new_member_form_list_post = NewMemberFormListPost([
NewMemberForm(
email="sandy@acme.com",
password="***",
first_name="Ariel",
last_name="Flores",
role="reader",
custom_roles=["customRole1","customRole2"],
team_keys=["team-1","team-2"],
role_attributes=RoleAttributeMap(
key=RoleAttributeValues([
"key_example",
]),
),
),
]) # NewMemberFormListPost |
# example passing only required values which don't have defaults set
try:
# Invite new members
api_response = api_instance.post_members(new_member_form_list_post)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling AccountMembersApi->post_members: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
new_member_form_list_post | NewMemberFormListPost |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Member collection response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]