For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
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 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.
Semantic patch requests support the following kind instructions for updating expiring user targets.
Schedules a date and time when LaunchDarkly will remove a user from segment targeting.
targetType: A segment’s target type, must be either included or excluded.userKey: The user key.value: The date when the user should expire from the segment targeting, in Unix milliseconds.Updates the date and time when LaunchDarkly will remove a user from segment targeting.
targetType: A segment’s target type, must be either included or excluded.userKey: The user key.value: The new date when the user should expire from the segment targeting, in Unix milliseconds.version: The segment version.Removes the scheduled expiration for the user in the segment.
targetType: A segment’s target type, must be either included or excluded.userKey: The user key.curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": [
{
"kind": "updateExpireUserTargetDate",
"targetType": "included",
"userKey": "user-key-123abc",
"value": 1587582000000,
"version": 0
}
],
"comment": "optional comment"
}
'{
"items": [
{
"_id": "12ab3c45de678910fgh12345",
"_version": 1,
"expirationDate": "1658192820000",
"userKey": "example-user-key",
"_resourceId": {
"kind": "<string>",
"projectKey": "<string>",
"environmentKey": "<string>",
"flagKey": "<string>",
"key": "<string>"
},
"targetType": "included",
"variationId": "ce67d625-a8b9-4fb5-a344-ab909d9d4f4d"
}
],
"_links": {},
"totalInstructions": 1,
"successfulInstructions": 1,
"failedInstructions": 0,
"errors": [
{
"instructionIndex": 1,
"message": "example error message"
}
]
}Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The project key
The environment key
The segment key
Semantic patch instructions for the desired changes to the resource
Show child attributes
[
{
"kind": "updateExpireUserTargetDate",
"targetType": "included",
"userKey": "user-key-123abc",
"value": 1587582000000,
"version": 0
}
]Optional description of changes
"optional comment"
Expiring user target response
An array of expiring user targets
Show child attributes
The location and content type of related resources
Show child attributes
The total count of instructions sent in the PATCH request
1
The total count of successful instructions sent in the PATCH request
1
The total count of the failed instructions sent in the PATCH request
0
An array of error messages for the failed instructions
Show child attributes
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": [
{
"kind": "updateExpireUserTargetDate",
"targetType": "included",
"userKey": "user-key-123abc",
"value": 1587582000000,
"version": 0
}
],
"comment": "optional comment"
}
'{
"items": [
{
"_id": "12ab3c45de678910fgh12345",
"_version": 1,
"expirationDate": "1658192820000",
"userKey": "example-user-key",
"_resourceId": {
"kind": "<string>",
"projectKey": "<string>",
"environmentKey": "<string>",
"flagKey": "<string>",
"key": "<string>"
},
"targetType": "included",
"variationId": "ce67d625-a8b9-4fb5-a344-ab909d9d4f4d"
}
],
"_links": {},
"totalInstructions": 1,
"successfulInstructions": 1,
"failedInstructions": 0,
"errors": [
{
"instructionIndex": 1,
"message": "example error message"
}
]
}