---
title: "Change a price alert with a durable receipt"
method: POST
path: "/v1/price-alerts/commands"
tags: ["price-alerts"]
---

# Change a price alert with a durable receipt

`POST /v1/price-alerts/commands`

## Request

- Base URL: `https://app.legend.trade/api/rest`
- URL: `https://app.legend.trade/api/rest/v1/price-alerts/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
      - `symbol` string, required
      - `targetPrice` number, required
      - `direction` 'above' | 'below', required
      - `kind` 'create', required
    - object
      - `id` string, uuid, required
      - `targetPrice` number, required
      - `direction` 'above' | 'below', required
      - `kind` 'update', required
    - object
      - `id` string, uuid, required
      - `kind` 'delete', required

## Response `200`

Successful response

- PriceAlertCommandReceipt: The original outcome, not current alert state. An alert can trigger after this command. Read the alert after recovery.
  - `operationId` string, uuid, required
  - `status` 'succeeded' | 'rejected', required
  - `result` PriceAlertCommandResult, required
    - `viewerId` string, uuid, required
    - `alertId` string, uuid, required
    - `alert` PriceAlert, required
      - `id` string, required
      - `symbol` string, required
      - `direction` 'above' | 'below', required
      - `target_price` number, required
      - `status` 'active' | 'triggered', required
      - `triggered_at` string, nullable, required
      - `created_at` string, required
    - `deleted` boolean, 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`: 1 breaking, 1 info
  - the response property `result/anyOf[#/components/schemas/PriceAlertCommandResult]/alert/anyOf[#/components/schemas/PriceAlert]/triggered_at` became nullable for the status `200`
  - response property `result/anyOf[#/components/schemas/PriceAlertCommandResult]/alert/anyOf[#/components/schemas/PriceAlert]/triggered_at` 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/price-alerts/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)
