---
title: "Get expiring user targets for segment"
method: GET
path: "/api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}"
tags: ["Segments"]
---

# Get expiring user targets for segment

`GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}`

> ### 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.

## Path parameters

- `projectKey` string, string, required — The project key
- `environmentKey` string, string, required — The environment key
- `segmentKey` string, string, required — The segment key

## Response `200`

Expiring user target response

- ExpiringUserTargetGetResponse
  - `items` ExpiringUserTargetItem[], required — An array of expiring user targets
    - `_id` string, required — The ID of this expiring user target
    - `_version` integer, required — The version of this expiring user target
    - `expirationDate` integer, required
    - `userKey` string, required — A unique key used to represent the user
    - `targetType` string — A segment's target type. Included when expiring user targets are updated on a segment.
    - `variationId` string — A unique key used to represent the flag variation. Included when expiring user targets are updated on a feature flag.
    - `_resourceId` ResourceIDResponse, required
      - `kind` string
      - `projectKey` string
      - `environmentKey` string
      - `flagKey` string
      - `key` string
  - `_links` object — The location and content type of related resources

## Other responses

- `401` — Invalid access token
- `404` — Invalid resource identifier
- `429` — Rate limited

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
