---
title: "Change notification state with a durable receipt"
method: POST
path: "/v1/notifications/commands"
tags: ["notifications"]
---

# Change notification state with a durable receipt

`POST /v1/notifications/commands`

## Request

- Base URL: `https://app.legend.trade/api/rest`
- URL: `https://app.legend.trade/api/rest/v1/notifications/commands`
- Auth: HTTP bearer

## Request body

- object
  - `operationId` string, uuid, required: Persist this UUID and input before transport. Retry the same pair after an unknown outcome. A new intent needs a new UUID.
  - `expectedUserId` string, uuid, required
  - `command` union, required
    - object
      - `kind` 'readItems', required
      - `ids` string[], required
    - object
      - `kind` 'setArchived', required
      - `ids` string[], required
      - `enabled` boolean, required
    - object
      - `kind` 'readAll', required
      - `feed` 'general' | 'chat' | 'announcements', required
    - object
      - `kind` 'patchPreferences', required
      - `patch` object, required
        - `followed_trader_activity` boolean
        - `followed_trader_notes` boolean
        - `copy_trades` boolean
        - `position_moves` boolean
        - `market_activity` boolean
        - `arena_activity` boolean
        - `new_followers` boolean
        - `referral_activity` boolean
        - `x_mutuals` boolean
        - `post_interactions` boolean
        - `clan_activity` boolean
        - `direct_messages` boolean
        - `group_messages` boolean
        - `followed_trader_min_notional` union
          - 0
          - 1000
          - 10000
          - 50000
          - 100000
        - `position_move_thresholds` union[]
          - union
            - 1
            - 5
            - 25
            - 50

## Response `200`

Successful response

- NotificationCommandReceipt: The original outcome, not current state. Read-all covers the database snapshot at execution. A committed retry cannot mark later items. Refresh after recovery.
  - `operationId` string, uuid, required
  - `status` 'succeeded' | 'rejected', required
  - `result` NotificationCommandResult, required
    - `viewerId` string, uuid, required
    - `changedCount` integer, required
    - `items` object[], required
      - `id` string, uuid, required
      - `readAt` string, nullable, required
      - `archivedAt` string, nullable, required
    - `unavailableItemIds` string[], required
    - `preferences` NotificationPreferencesOutput, required
      - `categories` NotificationCategory[], required
        - `key` string, required
        - `label` string, required
        - `description` string, required
        - `group` string, required
        - `enabled` boolean, required
      - `followed_trader_min_notional` number, required
      - `position_move_thresholds` number[], required
  - `error` object, nullable, required
    - `code` string, required
    - `message` string, required

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `500`: Internal server error

## Changes

- **2026-10-25** `8d368659667e`: 2 breaking, 2 info
  - the response property `result/anyOf[#/components/schemas/NotificationCommandResult]/items/items/archivedAt` became nullable for the status `200`
  - the response property `result/anyOf[#/components/schemas/NotificationCommandResult]/items/items/readAt` became nullable for the status `200`
  - response property `result/anyOf[#/components/schemas/NotificationCommandResult]/items/items/archivedAt` list-of-types was narrowed by removing types `null` from media type `application/json` of response `200`
  - response property `result/anyOf[#/components/schemas/NotificationCommandResult]/items/items/readAt` list-of-types was narrowed by removing types `null` from media type `application/json` of response `200`
- **2026-10-24** `47071fafc154`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/legend/apis/legend-api/changes/v1/notifications/commands/post.md)

---

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