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

# Get expiring targets for segment

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

Get a list of a segment's context 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 context target response

- ExpiringTargetGetResponse
  - `items` ExpiringTarget[], required — A list of expiring targets
    - `_id` string, required — The ID of this expiring target
    - `_version` integer, required — The version of this expiring target
    - `expirationDate` integer, required
    - `contextKind` string, required — The context kind of the context to be removed
    - `contextKey` string, required — A unique key used to represent the context to be removed
    - `targetType` string — A segment's target type, <code>included</code> or <code>excluded</code>. Included when expiring targets are updated on a segment.
    - `variationId` string — A unique ID used to represent the flag variation. Included when expiring targets are updated on a feature flag.
    - `_resourceId` ResourceId, required
      - `environmentKey` string — The environment key
      - `flagKey` string — Deprecated, use <code>key</code> instead
      - `key` string — The key of the flag or segment
      - `kind` string
      - `projectKey` string — The project key
  - `_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)
