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 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 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 eitherincludedorexcluded.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 eitherincludedorexcluded.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 eitherincludedorexcluded.userKey: The user key.
Authorization
ApiKey read, writeIn: header
Scope: read, write
Path Parameters
The project key
stringThe environment key
stringThe segment key
stringRequest Body
application/json
Optional description of changes
Semantic patch instructions for the desired changes to the resource
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/api/v2/segments/string/string/expiring-user-targets/string" \ -H "Content-Type: application/json" \ -d '{ "instructions": [ { "kind": "updateExpireUserTargetDate", "targetType": "included", "userKey": "user-key-123abc", "value": 1587582000000, "version": 0 } ] }'{ "items": [ { "_id": "12ab3c45de678910fgh12345", "_version": 1, "expirationDate": "1658192820000", "userKey": "example-user-key", "targetType": "included", "variationId": "ce67d625-a8b9-4fb5-a344-ab909d9d4f4d", "_resourceId": { "kind": "string", "projectKey": "string", "environmentKey": "string", "flagKey": "string", "key": "string" } } ], "_links": { "property1": { "href": "string", "type": "string" }, "property2": { "href": "string", "type": "string" } }, "totalInstructions": 1, "successfulInstructions": 1, "failedInstructions": 0, "errors": [ { "instructionIndex": 1, "message": "example error message" } ]}Get expiring user targets for segment GET
> ### 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](https://launchdarkly.com/docs/api/segments/get-expiring-targets-for-segment) instead of this endpoint. To learn more, read [Contexts](https://launchdarkly.com/docs/home/observability/contexts). Get a list of a segment's user targets that are scheduled for removal.
List scheduled changes GET
Get a list of scheduled changes that will be applied to the feature flag.