---
title: "Add/Update Default Segment for Users"
method: PUT
path: "/v1/segment/preference"
tags: ["Segment Preference"]
---

# Add/Update Default Segment for Users

`PUT /v1/segment/preference`

## Request

- Base URL: `https://api.leadboxer.com`
- URL: `https://api.leadboxer.com/v1/segment/preference`
- Auth: API key in header `x-api-key`

Sets the given Segment ID as the default segment for the provided list of User IDs under the specified Dataset ID.
Users included in the list will have their default segment added or updated accordingly.
Any users not included in the list will have their existing default-segment association under this dataset removed.

## Query parameters

- `email` string, required

## Request body

- SegmentPreferenceRequest
  - `datasetId` string, required: Dataset ID for which you need to assign segment as default.
  - `segmentId` integer, required: Segment ID which you want to assign as default.
  - `users` integer[]: List of User IDs for whom you need to assign a segment as default.

## Response `204`

Segment Preference updated successfully. No content returned.

## Other responses

- `400`: Bad Request: The request is invalid or malformed (missing/incorrect parameters).
- `402`: Payment Required: The client has exceeded credit limits.
- `403`: Forbidden: The authenticated user does not have permission to access this resource.
- `404`: Not Found: The requested resource does not exist.
- `409`: Conflict: The request could not be completed due to a resource state conflict.
- `429`: Too Many Requests: Rate limit exceeded. The client has sent too many requests in a given time period
- `500`: Interval Server Error: An unexpected error occurred on the server.

---

[API](https://skmtc.dev/leadboxer/apis/leadboxer-api.md) · [All operations](https://skmtc.dev/leadboxer/apis/leadboxer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/leadboxer/apis/leadboxer-api/revisions/34249b480395?raw)
