All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
delete_segment | DELETE /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} | Delete segment |
get_context_instance_segments_membership_by_env | POST /api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate | List segment memberships for context instance |
get_expiring_targets_for_segment | GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey} | Get expiring targets for segment |
get_expiring_user_targets_for_segment | GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} | Get expiring user targets for segment |
get_segment | GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} | Get segment |
get_segment_membership_for_context | GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts/{contextKey} | Get big segment membership for context |
get_segment_membership_for_user | GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users/{userKey} | Get big segment membership for user |
get_segments | GET /api/v2/segments/{projectKey}/{environmentKey} | List segments |
patch_expiring_targets_for_segment | PATCH /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey} | Update expiring targets for segment |
patch_expiring_user_targets_for_segment | PATCH /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} | Update expiring user targets for segment |
patch_segment | PATCH /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} | Patch segment |
post_segment | POST /api/v2/segments/{projectKey}/{environmentKey} | Create segment |
update_big_segment_context_targets | POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts | Update context targets on a big segment |
update_big_segment_targets | POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users | Update user context targets on a big segment |
delete_segment(project_key, environment_key, segment_key)
Delete segment
Delete a segment.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
# example passing only required values which don't have defaults set
try:
# Delete segment
api_instance.delete_segment(project_key, environment_key, segment_key)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->delete_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment 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]
ContextInstanceSegmentMemberships get_context_instance_segments_membership_by_env(project_key, environment_key, context_instance)
List segment memberships for context instance
For a given context instance with attributes, get membership details for all segments. In the request body, pass in the context instance.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.context_instance import ContextInstance
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.context_instance_segment_memberships import ContextInstanceSegmentMemberships
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
context_instance = ContextInstance(
key=None,
) # ContextInstance |
# example passing only required values which don't have defaults set
try:
# List segment memberships for context instance
api_response = api_instance.get_context_instance_segments_membership_by_env(project_key, environment_key, context_instance)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_context_instance_segments_membership_by_env: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
context_instance | ContextInstance |
ContextInstanceSegmentMemberships
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Context instance segment membership collection response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExpiringTargetGetResponse get_expiring_targets_for_segment(project_key, environment_key, segment_key)
Get expiring targets for segment
Get a list of a segment's context targets that are scheduled for removal.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
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.expiring_target_get_response import ExpiringTargetGetResponse
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
# example passing only required values which don't have defaults set
try:
# Get expiring targets for segment
api_response = api_instance.get_expiring_targets_for_segment(project_key, environment_key, segment_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_expiring_targets_for_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Expiring context target response | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExpiringUserTargetGetResponse get_expiring_user_targets_for_segment(project_key, environment_key, segment_key)
Get expiring user targets for segment
Contexts are now available > > After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Get expiring targets for segment instead of this endpoint. To learn more, read Contexts. Get a list of a segment's user targets that are scheduled for removal.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.expiring_user_target_get_response import ExpiringUserTargetGetResponse
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
# example passing only required values which don't have defaults set
try:
# Get expiring user targets for segment
api_response = api_instance.get_expiring_user_targets_for_segment(project_key, environment_key, segment_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_expiring_user_targets_for_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Expiring user target response | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserSegment get_segment(project_key, environment_key, segment_key)
Get segment
Get a single segment by key.
Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.user_segment import UserSegment
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 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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
# example passing only required values which don't have defaults set
try:
# Get segment
api_response = api_instance.get_segment(project_key, environment_key, segment_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Segment response | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BigSegmentTarget get_segment_membership_for_context(project_key, environment_key, segment_key, context_key)
Get big segment membership for context
Get the membership status (included/excluded) for a given context in this big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.big_segment_target import BigSegmentTarget
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
context_key = "contextKey_example" # str | The context key
# example passing only required values which don't have defaults set
try:
# Get big segment membership for context
api_response = api_instance.get_segment_membership_for_context(project_key, environment_key, segment_key, context_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_segment_membership_for_context: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
context_key | str | The context key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Segment membership for context response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BigSegmentTarget get_segment_membership_for_user(project_key, environment_key, segment_key, user_key)
Get big segment membership for user
Contexts are now available > > After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Get expiring targets for segment instead of this endpoint. To learn more, read Contexts. Get the membership status (included/excluded) for a given user in this big segment. This operation does not support standard segments.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.big_segment_target import BigSegmentTarget
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
user_key = "userKey_example" # str | The user key
# example passing only required values which don't have defaults set
try:
# Get big segment membership for user
api_response = api_instance.get_segment_membership_for_user(project_key, environment_key, segment_key, user_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_segment_membership_for_user: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
user_key | str | The user key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Segment membership for user response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserSegments get_segments(project_key, environment_key)
List segments
Get a list of all segments in the given project.
Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.user_segments import UserSegments
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
limit = 1 # int | The number of segments to return. Defaults to 20. (optional)
offset = 1 # int | Where to start in the list. Use this 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)
sort = "sort_example" # str | Accepts sorting order and fields. Fields can be comma separated. Possible fields are 'creationDate', 'name', 'lastModified'. Example: `sort=name` sort by names ascending or `sort=-name,creationDate` sort by names descending and creationDate ascending. (optional)
filter = "filter_example" # str | Accepts filter by kind, query, tags, unbounded, or external. To filter by kind or query, use the `equals` operator. To filter by tags, use the `anyOf` operator. Query is a 'fuzzy' search across segment key, name, and description. Example: `filter=tags anyOf ['enterprise', 'beta'],query equals 'toggle'` returns segments with 'toggle' in their key, name, or description that also have 'enterprise' or 'beta' as a tag. To filter by unbounded, use the `equals` operator. Example: `filter=unbounded equals true`. To filter by external, use the `exists` operator. Example: `filter=external exists true`. (optional)
# example passing only required values which don't have defaults set
try:
# List segments
api_response = api_instance.get_segments(project_key, environment_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_segments: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# List segments
api_response = api_instance.get_segments(project_key, environment_key, limit=limit, offset=offset, sort=sort, filter=filter)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->get_segments: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
limit | int | The number of segments to return. Defaults to 20. | [optional] |
offset | int | Where to start in the list. Use this 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] |
sort | str | Accepts sorting order and fields. Fields can be comma separated. Possible fields are 'creationDate', 'name', 'lastModified'. Example: `sort=name` sort by names ascending or `sort=-name,creationDate` sort by names descending and creationDate ascending. | [optional] |
filter | str | Accepts filter by kind, query, tags, unbounded, or external. To filter by kind or query, use the `equals` operator. To filter by tags, use the `anyOf` operator. Query is a 'fuzzy' search across segment key, name, and description. Example: `filter=tags anyOf ['enterprise', 'beta'],query equals 'toggle'` returns segments with 'toggle' in their key, name, or description that also have 'enterprise' or 'beta' as a tag. To filter by unbounded, use the `equals` operator. Example: `filter=unbounded equals true`. To filter by external, use the `exists` operator. Example: `filter=external exists true`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Segment collection response | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExpiringTargetPatchResponse patch_expiring_targets_for_segment(project_key, environment_key, segment_key, patch_segment_expiring_target_input_rep)
Update expiring targets for segment
Update expiring context targets for a segment. Updating a context target expiration 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. If the request is well-formed but any of its instructions failed to process, this operation returns status code 200
. In this case, the response errors
array will be non-empty. ### Instructions Semantic patch requests support the following kind
instructions for updating expiring context targets.
Click to expand instructions for updating expiring context targets
#### addExpiringTarget Schedules a date and time when LaunchDarkly will remove a context from segment targeting. The segment must already have the context as an individual target. ##### Parameters -targetType
: The type of individual target for this context. Must be either included
or excluded
. - contextKey
: The context key. - contextKind
: The kind of context being targeted. - value
: The date when the context should expire from the segment targeting, in Unix milliseconds. Here's an example: json { \"instructions\": [{ \"kind\": \"addExpiringTarget\", \"targetType\": \"included\", \"contextKey\": \"user-key-123abc\", \"contextKind\": \"user\", \"value\": 1754092860000 }] }
#### updateExpiringTarget Updates the date and time when LaunchDarkly will remove a context from segment targeting. ##### Parameters - targetType
: The type of individual target for this context. Must be either included
or excluded
. - contextKey
: The context key. - contextKind
: The kind of context being targeted. - value
: The new date when the context should expire from the segment targeting, in Unix milliseconds. - version
: (Optional) The version of the expiring target to update. If included, update will fail if version doesn't match current version of the expiring target. Here's an example: json { \"instructions\": [{ \"kind\": \"updateExpiringTarget\", \"targetType\": \"included\", \"contextKey\": \"user-key-123abc\", \"contextKind\": \"user\", \"value\": 1754179260000 }] }
#### removeExpiringTarget Removes the scheduled expiration for the context in the segment. ##### Parameters - targetType
: The type of individual target for this context. Must be either included
or excluded
. - contextKey
: The context key. - contextKind
: The kind of context being targeted. Here's an example: json { \"instructions\": [{ \"kind\": \"removeExpiringTarget\", \"targetType\": \"included\", \"contextKey\": \"user-key-123abc\", \"contextKind\": \"user\", }] }
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.expiring_target_patch_response import ExpiringTargetPatchResponse
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.patch_segment_expiring_target_input_rep import PatchSegmentExpiringTargetInputRep
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
patch_segment_expiring_target_input_rep = PatchSegmentExpiringTargetInputRep(
comment="optional comment",
instructions=[
PatchSegmentExpiringTargetInstruction(
kind="addExpiringTarget",
context_key="context_key_example",
context_kind="user",
target_type="included",
value=1653469200000,
version=1,
),
],
) # PatchSegmentExpiringTargetInputRep |
# example passing only required values which don't have defaults set
try:
# Update expiring targets for segment
api_response = api_instance.patch_expiring_targets_for_segment(project_key, environment_key, segment_key, patch_segment_expiring_target_input_rep)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->patch_expiring_targets_for_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
patch_segment_expiring_target_input_rep | PatchSegmentExpiringTargetInputRep |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Expiring target 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]
ExpiringUserTargetPatchResponse patch_expiring_user_targets_for_segment(project_key, environment_key, segment_key, patch_segment_request)
Update expiring user targets for segment
Contexts are now available > > After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Update expiring targets for segment instead of this endpoint. To learn more, read Contexts. Update expiring user targets for a segment. Updating a user target expiration uses the semantic patch format. To make a semantic patch request, you must append
domain-model=launchdarkly.semanticpatch
to yourContent-Type
header. To learn more, read Updates using semantic patch. If the request is well-formed but any of its instructions failed to process, this operation returns status code200
. In this case, the responseerrors
array will be non-empty. ### Instructions Semantic patch requests support the followingkind
instructions for updating expiring user targets.Click to expand instructions for updating expiring user targets
#### addExpireUserTargetDate Schedules a date and time when LaunchDarkly will remove a user from segment targeting. ##### Parameters -targetType
: A segment's target type, must be eitherincluded
orexcluded
. -userKey
: The user key. -value
: The date when the user should expire from the segment targeting, in Unix milliseconds. #### updateExpireUserTargetDate Updates the date and time when LaunchDarkly will remove a user from segment targeting. ##### Parameters -targetType
: A segment's target type, must be eitherincluded
orexcluded
. -userKey
: The user key. -value
: The new date when the user should expire from the segment targeting, in Unix milliseconds. -version
: The segment version. #### removeExpireUserTargetDate Removes the scheduled expiration for the user in the segment. ##### Parameters -targetType
: A segment's target type, must be eitherincluded
orexcluded
. -userKey
: The user key.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.expiring_user_target_patch_response import ExpiringUserTargetPatchResponse
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.patch_segment_request import PatchSegmentRequest
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
patch_segment_request = PatchSegmentRequest(
comment="optional comment",
instructions=[
PatchSegmentInstruction(
kind="addExpireUserTargetDate",
user_key="user_key_example",
target_type="included",
value=1653469200000,
version=1,
),
],
) # PatchSegmentRequest |
# example passing only required values which don't have defaults set
try:
# Update expiring user targets for segment
api_response = api_instance.patch_expiring_user_targets_for_segment(project_key, environment_key, segment_key, patch_segment_request)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->patch_expiring_user_targets_for_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
patch_segment_request | PatchSegmentRequest |
ExpiringUserTargetPatchResponse
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Expiring user target 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]
UserSegment patch_segment(project_key, environment_key, segment_key, patch_with_comment)
Patch segment
Update a segment. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read Updates. ### Using semantic patches on a segment 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. The body of a semantic patch request for updating segments requires an environmentKey
in addition to instructions
and an optional comment
. The body of the request takes the following properties: * comment
(string): (Optional) A description of the update. * environmentKey
(string): (Required) The key of the LaunchDarkly environment. * instructions
(array): (Required) A list of actions the update should perform. Each action in the list must be an object with a kind
property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. ### Instructions Semantic patch requests support the following kind
instructions for updating segments.
Click to expand instructions for updating segments
#### addIncludedTargets Adds context keys to the individual context targets included in the segment for the specifiedcontextKind
. Returns an error if this causes the same context key to be both included and excluded. ##### Parameters - contextKind
: The context kind the targets should be added to. - values
: List of keys. Here's an example: json { \"instructions\": [{ \"kind\": \"addIncludedTargets\", \"contextKind\": \"org\", \"values\": [ \"org-key-123abc\", \"org-key-456def\" ] }] }
#### addIncludedUsers Adds user keys to the individual user targets included in the segment. Returns an error if this causes the same user key to be both included and excluded. If you are working with contexts, use addIncludedTargets
instead of this instruction. ##### Parameters - values
: List of user keys. Here's an example: json { \"instructions\": [{ \"kind\": \"addIncludedUsers\", \"values\": [ \"user-key-123abc\", \"user-key-456def\" ] }] }
#### addExcludedTargets Adds context keys to the individual context targets excluded in the segment for the specified contextKind
. Returns an error if this causes the same context key to be both included and excluded. ##### Parameters - contextKind
: The context kind the targets should be added to. - values
: List of keys. Here's an example: json { \"instructions\": [{ \"kind\": \"addExcludedTargets\", \"contextKind\": \"org\", \"values\": [ \"org-key-123abc\", \"org-key-456def\" ] }] }
#### addExcludedUsers Adds user keys to the individual user targets excluded from the segment. Returns an error if this causes the same user key to be both included and excluded. If you are working with contexts, use addExcludedTargets
instead of this instruction. ##### Parameters - values
: List of user keys. Here's an example: json { \"instructions\": [{ \"kind\": \"addExcludedUsers\", \"values\": [ \"user-key-123abc\", \"user-key-456def\" ] }] }
#### removeIncludedTargets Removes context keys from the individual context targets included in the segment for the specified contextKind
. ##### Parameters - contextKind
: The context kind the targets should be removed from. - values
: List of keys. Here's an example: json { \"instructions\": [{ \"kind\": \"removeIncludedTargets\", \"contextKind\": \"org\", \"values\": [ \"org-key-123abc\", \"org-key-456def\" ] }] }
#### removeIncludedUsers Removes user keys from the individual user targets included in the segment. If you are working with contexts, use removeIncludedTargets
instead of this instruction. ##### Parameters - values
: List of user keys. Here's an example: json { \"instructions\": [{ \"kind\": \"removeIncludedUsers\", \"values\": [ \"user-key-123abc\", \"user-key-456def\" ] }] }
#### removeExcludedTargets Removes context keys from the individual context targets excluded from the segment for the specified contextKind
. ##### Parameters - contextKind
: The context kind the targets should be removed from. - values
: List of keys. Here's an example: json { \"instructions\": [{ \"kind\": \"removeExcludedTargets\", \"contextKind\": \"org\", \"values\": [ \"org-key-123abc\", \"org-key-456def\" ] }] }
#### removeExcludedUsers Removes user keys from the individual user targets excluded from the segment. If you are working with contexts, use removeExcludedTargets
instead of this instruction. ##### Parameters - values
: List of user keys. Here's an example: json { \"instructions\": [{ \"kind\": \"removeExcludedUsers\", \"values\": [ \"user-key-123abc\", \"user-key-456def\" ] }] }
#### updateName Updates the name of the segment. ##### Parameters - value
: Name of the segment. Here's an example: json { \"instructions\": [{ \"kind\": \"updateName\", \"value\": \"Updated segment name\" }] }
json { \"patch\": [ { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"new description\" } ] }
To update fields in the segment that are arrays, set the path
to the name of the field and then append /<array index>
. Use /0
to add the new entry to the beginning of the array. Use /-
to add the new entry to the end of the array. For example, to add a rule to a segment, use the following request body: json { \"patch\":[ { \"op\": \"add\", \"path\": \"/rules/0\", \"value\": { \"clauses\": [{ \"contextKind\": \"user\", \"attribute\": \"email\", \"op\": \"endsWith\", \"values\": [\".edu\"], \"negate\": false }] } } ] }
To add or remove targets from segments, we recommend using semantic patch. Semantic patch for segments includes specific instructions for adding and removing both included and excluded targets.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.user_segment import UserSegment
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.patch_with_comment import PatchWithComment
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
patch_with_comment = PatchWithComment(
patch=JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]),
comment="comment_example",
) # PatchWithComment |
# example passing only required values which don't have defaults set
try:
# Patch segment
api_response = api_instance.patch_segment(project_key, environment_key, segment_key, patch_with_comment)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->patch_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
patch_with_comment | PatchWithComment |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Segment 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]
UserSegment post_segment(project_key, environment_key, segment_body)
Create segment
Create a new segment.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.user_segment import UserSegment
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.segment_body import SegmentBody
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 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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_body = SegmentBody(
name="Example segment",
key="segment-key-123abc",
description="Bundle our sample customers together",
tags=["testing"],
unbounded=False,
unbounded_context_kind="device",
) # SegmentBody |
# example passing only required values which don't have defaults set
try:
# Create segment
api_response = api_instance.post_segment(project_key, environment_key, segment_body)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->post_segment: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_body | SegmentBody |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Segment 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]
update_big_segment_context_targets(project_key, environment_key, segment_key, segment_user_state)
Update context targets on a big segment
Update context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
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.segment_user_state import SegmentUserState
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
segment_user_state = SegmentUserState(
included=SegmentUserList(
add=[
"add_example",
],
remove=[
"remove_example",
],
),
excluded=SegmentUserList(
add=[
"add_example",
],
remove=[
"remove_example",
],
),
) # SegmentUserState |
# example passing only required values which don't have defaults set
try:
# Update context targets on a big segment
api_instance.update_big_segment_context_targets(project_key, environment_key, segment_key, segment_user_state)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->update_big_segment_context_targets: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
segment_user_state | SegmentUserState |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | Action succeeded | - |
400 | Invalid request | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_big_segment_targets(project_key, environment_key, segment_key, segment_user_state)
Update user context targets on a big segment
Update user context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import segments_api
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
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.segment_user_state import SegmentUserState
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 = segments_api.SegmentsApi(api_client)
project_key = "projectKey_example" # str | The project key
environment_key = "environmentKey_example" # str | The environment key
segment_key = "segmentKey_example" # str | The segment key
segment_user_state = SegmentUserState(
included=SegmentUserList(
add=[
"add_example",
],
remove=[
"remove_example",
],
),
excluded=SegmentUserList(
add=[
"add_example",
],
remove=[
"remove_example",
],
),
) # SegmentUserState |
# example passing only required values which don't have defaults set
try:
# Update user context targets on a big segment
api_instance.update_big_segment_targets(project_key, environment_key, segment_key, segment_user_state)
except launchdarkly_api.ApiException as e:
print("Exception when calling SegmentsApi->update_big_segment_targets: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_key | str | The project key | |
environment_key | str | The environment key | |
segment_key | str | The segment key | |
segment_user_state | SegmentUserState |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | Action succeeded | - |
400 | Invalid request | - |
401 | Invalid access token | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]