---
title: "Toggle pin"
method: POST
path: "/api/v1/user/segments/{id}/pin"
tags: ["User"]
---

# Toggle pin

`POST /api/v1/user/segments/{id}/pin`

This mutation has no request body.

## Path parameters

- `id` integer, required

## Headers

- `X-CSRF-Token` string, required

## Response `200`

New pinned state

- UserSegmentPinResponse
  - `pinned` boolean, required

## Other responses

- `401` — Authentication required (no active session)
- `403` — Invalid CSRF
- `404` — Resource not found

## Changes

- **2026-07-26** `996f96a11758` — 1 breaking, 1 warning, 5 info
  - added the new required `header` request parameter `X-CSRF-Token`
  - for the `path` request parameter `id`, the min was set to `1.00`
  - api operation id `postUserSegmentsByIdPin` was added
  - added the media type `application/json` for the response with the status `200`
  - …3 more

[Change history](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/changes/api/v1/user/segments/:id/pin/post.md)

---

[API](https://skmtc.dev/openmercantil/apis/openmercantil-public-api.md) · [All operations](https://skmtc.dev/openmercantil/apis/openmercantil-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openmercantil/openmercantil-public-api/revisions/601ff6123c86/schema)
