---
title: "Update strategy segments"
method: POST
path: "/api/admin/segments/strategies"
tags: ["Strategies"]
---

# Update strategy segments

`POST /api/admin/segments/strategies`

Sets the segments of the strategy specified to be exactly the ones passed in the payload. Any segments that were used by the strategy before will be removed if they are not in the provided list of segments.

## Request body

- UpdateFeatureStrategySegmentsSchema — Data required to update segments for a strategy.
  - `projectId` string, required — The ID of the project that the strategy belongs to.
  - `strategyId` string, required — The ID of the strategy to update segments for.
  - `environmentId` string, required — The ID of the strategy environment.
  - `segmentIds` integer[], required — The new list of segments (IDs) to use for this strategy. Any segments not in this list will be removed from the strategy.

## Response `201`

The resource was successfully created.

- UpdateFeatureStrategySegmentsSchema — Data required to update segments for a strategy.
  - `projectId` string, required — The ID of the project that the strategy belongs to.
  - `strategyId` string, required — The ID of the strategy to update segments for.
  - `environmentId` string, required — The ID of the strategy environment.
  - `segmentIds` integer[], required — The new list of segments (IDs) to use for this strategy. Any segments not in this list will be removed from the strategy.

## Other responses

- `400` — The request data does not match what we expect.
- `401` — Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`.
- `403` — The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation
- `415` — The operation does not support request payloads of the provided type. Please ensure that you're using one of the listed payload types and that you have specified the right content type in the "content-type" header.

---

[API](https://skmtc.net/unleash/apis/unleash-api-3.md) · [All operations](https://skmtc.net/unleash/apis/unleash-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unleash/unleash-api-3/revisions/b2c3116e633e/schema)
