Skip to main content
PATCH
/
api
/
v2
/
users
/
{projectKey}
/
{userKey}
/
expiring-user-targets
/
{environmentKey}
Update expiring user target for flags
curl --request PATCH \
  --url https://app.launchdarkly.com/api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "instructions": [
    {
      "kind": "addExpireUserTargetDate",
      "flagKey": "sample-flag-key",
      "variationId": "ce12d345-a1b2-4fb5-a123-ab123d4d5f5d",
      "value": 1653469200000,
      "version": 1
    }
  ],
  "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.

Authorizations

Authorization
string
header
required

Path Parameters

projectKey
string<string>
required

The project key

userKey
string<string>
required

The user key

environmentKey
string<string>
required

The environment key

Body

application/json
instructions
object[]
required

The instructions to perform when updating

comment
string

Optional comment describing the change

Example:

"optional comment"

Response

Expiring user target response

items
object[]
required

An array of expiring user targets

The location and content type of related resources

totalInstructions
integer

The total count of instructions sent in the PATCH request

Example:

1

successfulInstructions
integer

The total count of successful instructions sent in the PATCH request

Example:

1

failedInstructions
integer

The total count of the failed instructions sent in the PATCH request

Example:

0

errors
object[]

An array of error messages for the failed instructions