> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serialized.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Price Triggers

> Arm up to 1,000 triggers on a price webhook, on up to 100 distinct tokens, idempotent. Free.

`POST /v1/webhook/price/{id}/add` · **Free**

Arms up to 1,000 triggers on a price webhook, on up to 100 distinct tokens per call. Idempotent: a trigger already there with the same id, token and condition comes back in `alreadyIn` with its `status`, whatever it is; the same id with another condition comes back in `rejected` (`details.reason: "idTaken"`: an id stays taken for 30 days after its trigger ends). A trigger you removed is not armed again: it comes back in `alreadyIn` with `status: "removed"`, so check `status`, and arm it again under a new id. A condition already true fires at once. The response never carries the token's price.

`rejected` gives each trigger that was not armed, with its index and error: a malformed field (`INVALID_PARAM` or `INVALID_CHAIN`, `details.param` names it), a token not covered (`details.reason` `nativeCoin`, `wrappedNative` or `stablecoin`), an unknown token (`NOT_FOUND`), an `eq` on a token with no price yet in the level's unit (`details.reason: "noPrice"`), an id used twice in the call (`duplicateId`), a trigger with both `priceUsd` and `priceNative` (`INVALID_PARAM`: set one). The others are armed. Free; your account must be able to pay for the triggers it arms (1 credit per trigger sent to your URL).

```bash cURL theme={null}
curl -X POST 'https://api.serialized.xyz/v1/webhook/price/tpsl/add' \
  -H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \
  -d '{"triggers":[{"id":"order-8814","chain":"evm:8453","address":"0x4ed4e862860bed51a9570b96d89af5e1b0efefed","priceUsd":{"eq":"0.0042"}},{"id":"order-8812","chain":"solana","address":"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263","priceUsd":{"gte":"0.000023"}}]}'
```

```json Response theme={null}
{
  "data": {
    "id": "tpsl",
    "armed": [{ "index": 0, "id": "order-8814", "direction": "gte" }],
    "alreadyIn": [{ "index": 1, "id": "order-8812", "status": "active" }],
    "rejected": []
  }
}
```


## OpenAPI

````yaml openapi.json POST /v1/webhook/price/{id}/add
openapi: 3.1.0
info:
  title: Serialized Data API
  description: >-
    On-chain data for trading apps - tokens, candles, token filters. Built on
    our own indexers. 18 EVM chains + Solana, live.
  version: 0.1.0
servers:
  - url: https://demo.serialized.xyz
    description: 'Demo: no key needed, read endpoints, rate-limited per IP'
  - url: https://api.serialized.xyz
    description: 'Production: your API key in the Authorization header'
security:
  - apiKey: []
  - {}
paths:
  /v1/webhook/price/{id}/add:
    post:
      summary: Add Price Triggers
      description: >-
        Arms up to 1,000 triggers on a price webhook, on up to 100 distinct
        tokens per call. Idempotent: a trigger already there with the same id,
        token and condition comes back in `alreadyIn` with its `status`; the
        same id with another condition comes back in `rejected` (`idTaken`). A
        trigger you removed is not armed again (`alreadyIn` with `status:
        "removed"`): arm it again under a new id. A condition already true fires
        at once. Free; your account must be able to pay for the triggers it
        arms.
      operationId: price-webhook-add
      parameters:
        - schema:
            type: string
            x-default: tpsl
          in: path
          name: id
          required: true
          description: 'The price webhook id: yours, or the `wh_…` id we generated.'
          example: tpsl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - triggers
              properties:
                triggers:
                  description: >-
                    1 to 1,000 triggers per call, on up to 100 distinct tokens:
                    `{ "id"?, "name"?, "chain", "address", "priceUsd": { "gt" |
                    "gte" | "lt" | "lte" | "eq": "<level>" } }`, the level in
                    USD, or the same with `priceNative`, the level in the native
                    coin of the chain (one of the two; a decimal string of at
                    most 32 characters, or a JSON number). An invalid trigger
                    comes back in `rejected` with its index; the others are
                    armed.
                  type: array
                  items: {}
      responses:
        '200':
          description: Standard `{ data, meta }` envelope.
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: Authorization
      in: header
      description: Your raw API key (not needed on the demo server).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.