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

# Update or pause own price alert

> Owner comes exclusively from the bearer key. Caller owner fields are rejected. Scopes are opt-in and independent of md.read and trading authority. Every request consumes the existing REST key limiter. URLs <=8 KiB and bodies <=32 KiB; no-store and credential-free CORS including PATCH/Idempotency-Key/If-Match. Uses the existing alert-eval service owner guard and durable journal. This adapter preserves its draft/arm/reviewed-replacement lifecycle and configVersion semantics. New configs are USD price crossing alerts with in-app delivery and zero hysteresis; reads also project existing app-native configurations. No webhook association/delivery. Submit a complete config to replace it, {enabled:false} to pause an active alert, {action:arm} for a draft or {action:resume} for a paused alert. These are separate idempotent writes. Replacement resets evaluation baseline and uses in-app delivery; it does not silently retain different app-native configuration.



## OpenAPI

````yaml https://www.oceanx.trade/api/v1/openapi.json patch /api/v1/price-alerts/{id}
openapi: 3.1.0
info:
  title: OceanX Developer API
  version: 1.0.0
  description: >-
    Public API for the OceanX trading platform. Currently in beta and free to
    use while in beta.


    This spec covers the **spot quote** domain. The wallet **tracker** and
    **perps** domains are documented at https://docs.oceanx.trade/api/overview
    and are not yet described here.
  contact:
    url: https://docs.oceanx.trade
  termsOfService: https://www.oceanx.trade/legal/terms
  license:
    name: Proprietary
    url: https://www.oceanx.trade/legal/terms
servers:
  - url: https://www.oceanx.trade
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Router
    description: >-
      Read-only Raptor route quotes and public Solana transaction status. Build
      and execution remain separately gated.
  - name: Market Data
    description: Read-only OceanX market context sourced and cached by VM producers.
  - name: Spot
    description: >-
      Executable Solana swap quotes off OceanX's own router, and the exit
      checker that reports whether a whole position can be sold.
  - name: Callouts
    description: >-
      Public token callouts — user-posted token calls with live click/volume
      attribution stats. Read-only.
  - name: Copy Trading
    description: Key-owner follow, fill and PnL reads; no execution authority.
  - name: Price Alerts
    description: Key-owner alert management through the existing evaluator; no webhooks.
paths:
  /api/v1/price-alerts/{id}:
    patch:
      tags:
        - Price Alerts
      summary: Update or pause own price alert
      description: >-
        Owner comes exclusively from the bearer key. Caller owner fields are
        rejected. Scopes are opt-in and independent of md.read and trading
        authority. Every request consumes the existing REST key limiter. URLs
        <=8 KiB and bodies <=32 KiB; no-store and credential-free CORS including
        PATCH/Idempotency-Key/If-Match. Uses the existing alert-eval service
        owner guard and durable journal. This adapter preserves its
        draft/arm/reviewed-replacement lifecycle and configVersion semantics.
        New configs are USD price crossing alerts with in-app delivery and zero
        hysteresis; reads also project existing app-native configurations. No
        webhook association/delivery. Submit a complete config to replace it,
        {enabled:false} to pause an active alert, {action:arm} for a draft or
        {action:resume} for a paused alert. These are separate idempotent
        writes. Replacement resets evaluation baseline and uses in-app delivery;
        it does not silently retain different app-native configuration.
      operationId: updatePriceAlert
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[!-~]+$
          description: >-
            Per owner + public method/path + key. Same body replays the durable
            service result; changed body returns 409. Service retains records
            180 days (at least 24 hours).
        - name: If-Match
          in: header
          required: true
          schema:
            type: string
          description: >-
            Positive configVersion or quoted ETag. Guards config edits; service
            state transitions do not increment configVersion.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertPatch'
      responses:
        '200':
          description: >-
            Owner-scoped projection; unknown observations remain null.
            Cache-Control: no-store.
          headers:
            ETag:
              schema:
                type: string
              description: Quoted configVersion on alert item reads/writes.
            X-Request-Id:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PriceAlert'
                  meta:
                    $ref: '#/components/schemas/OwnedResponseMeta'
                required:
                  - data
                  - meta
                additionalProperties: false
        '400':
          description: >-
            Malformed input, unknown/repeated field, invalid cursor or altered
            cursor filters/owner.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '401':
          description: >-
            Missing, revoked, invalid or disabled API key. No session-cookie
            fallback.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '403':
          description: Key lacks this operation's explicit scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '404':
          description: >-
            Owned resource not found. Foreign and missing IDs are
            indistinguishable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '409':
          description: >-
            Idempotency conflict, alert capacity, terminal alert or invalid
            state transition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '410':
          description: Cursor expired or lost; restart pagination. Alert may be expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '412':
          description: If-Match no longer matches configVersion.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '422':
          description: >-
            Source exceeds the snapshot budget or qualified alert price/delivery
            capability is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '428':
          description: Idempotency-Key or required If-Match is missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '429':
          description: REST or alert-service quota exceeded; Retry-After provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '500':
          description: Existing API-key verification dependency failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
        '503':
          description: >-
            Admission, store or alert service unavailable. No fabricated
            empty/zero success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    AlertPatch:
      oneOf:
        - $ref: '#/components/schemas/AlertConfig'
        - type: object
          properties:
            enabled:
              const: false
          required:
            - enabled
          additionalProperties: false
        - type: object
          properties:
            action:
              enum:
                - arm
                - resume
          required:
            - action
          additionalProperties: false
    PriceAlert:
      type: object
      properties:
        id:
          type: string
          format: uuid
        assetKey:
          type: object
          properties:
            chain_id:
              type: string
            contract:
              type: string
          required:
            - chain_id
            - contract
          additionalProperties: false
        pool:
          type:
            - string
            - 'null'
        metric:
          enum:
            - price
            - market_cap
        quote:
          enum:
            - usd
            - native
        quoteAsset:
          type:
            - string
            - 'null'
        threshold:
          type: string
          pattern: ^\d+(\.\d{1,18})?$
          maxLength: 128
        condition:
          oneOf:
            - type: object
              properties:
                kind:
                  enum:
                    - above
                    - below
              required:
                - kind
              additionalProperties: false
            - type: object
              properties:
                kind:
                  const: crossed
                direction:
                  enum:
                    - up
                    - down
                    - either
              required:
                - kind
                - direction
              additionalProperties: false
        mode:
          enum:
            - once
            - repeat
        hysteresisPct:
          type: string
          pattern: ^\d+(\.\d{1,18})?$
          maxLength: 128
        cooldownMin:
          type: integer
          minimum: 1
          maximum: 1440
        expiresAtMs:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        deliveryChannels:
          type: array
          maxItems: 5
          items:
            enum:
              - in_app
              - telegram
              - web_push
              - mobile_push
              - email
        configVersion:
          type: integer
          minimum: 1
          maximum: 9007199254740991
        status:
          enum:
            - draft
            - active
            - paused
            - triggered
            - expired
            - cancelled
            - failed
            - offline_pending
        createdAtMs:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        lastTriggeredAtMs:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 9007199254740991
        eligibilityReason:
          type:
            - string
            - 'null'
        deliveryStatus:
          type:
            - string
            - 'null'
        state:
          type:
            - object
            - 'null'
          properties:
            baseline:
              type:
                - string
                - 'null'
              pattern: ^\d+(\.\d{1,18})?$
              maxLength: 128
            lastSampleTsMs:
              type:
                - integer
                - 'null'
              minimum: 0
              maximum: 9007199254740991
            lastSampleSeq:
              type:
                - integer
                - 'null'
              minimum: 0
              maximum: 9007199254740991
            awaitingRearm:
              type: boolean
            cooldownUntilMs:
              type:
                - integer
                - 'null'
              minimum: 0
              maximum: 9007199254740991
          additionalProperties: false
      required:
        - id
        - assetKey
        - pool
        - metric
        - quote
        - quoteAsset
        - threshold
        - condition
        - mode
        - hysteresisPct
        - cooldownMin
        - expiresAtMs
        - deliveryChannels
        - configVersion
        - status
        - createdAtMs
        - lastTriggeredAtMs
        - eligibilityReason
        - deliveryStatus
      additionalProperties: false
    OwnedResponseMeta:
      type: object
      required:
        - requestId
        - source
        - methodVersion
        - observedAtMs
        - staleAfterMs
      properties:
        requestId:
          type: string
        source:
          enum:
            - copy-trading-store
            - alert-eval-rs
        methodVersion:
          type: string
        observedAtMs:
          type: 'null'
        staleAfterMs:
          type: 'null'
        coverage:
          type: string
        completeHistory:
          type: boolean
        snapshotExpiresAtMs:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        pagination:
          const: service_keyset
        cursorTtlMs:
          const: 300000
        mode:
          type: object
          properties:
            disabled:
              type: boolean
            dryRun:
              type: boolean
            liveExecutionAvailable:
              const: false
          required:
            - disabled
            - dryRun
            - liveExecutionAvailable
          additionalProperties: false
        limits:
          type: object
          properties:
            maxPerTradeUsd:
              type: number
            dailyCapUsd:
              type: number
            slippageBps:
              type: number
            targets:
              type: integer
              minimum: 0
              maximum: 9007199254740991
          required:
            - maxPerTradeUsd
            - dailyCapUsd
            - slippageBps
            - targets
          additionalProperties: false
    OwnedApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          additionalProperties: false
        requestId:
          type: string
      required:
        - error
        - requestId
      additionalProperties: false
    AlertConfig:
      type: object
      properties:
        chain:
          type: string
          enum:
            - solana
            - ethereum
            - base
            - bnb
            - arbitrum
            - polygon
            - monad
            - hyperevm
            - robinhood
        token:
          type: string
          maxLength: 128
          description: >-
            Base58 Solana mint or 0x-prefixed 40-hex EVM address, according to
            chain. Fresh qualified service data is required.
        direction:
          type: string
          enum:
            - above
            - below
        thresholdUsd:
          type: string
          pattern: ^\d+(\.\d{1,18})?$
          maxLength: 128
          description: >-
            Positive exact USD decimal. At most 20 whole digits/18 fractional
            digits; must also fit the service evaluator's decimal range.
        repeat:
          type: string
          enum:
            - once
            - crossing
        cooldownSeconds:
          type: integer
          minimum: 60
          maximum: 86400
          multipleOf: 60
          description: Existing evaluator accepts whole minutes only.
        expiresAtMs:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: >-
            Explicit expiry after now and at most 30 days away; enforced by
            service.
      required:
        - chain
        - token
        - direction
        - thresholdUsd
        - repeat
        - cooldownSeconds
        - expiresAtMs
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An OceanX API key, created in the app under Settings → Developer API.
        Send it as `Authorization: Bearer ox_live_…`. Required scopes are
        operation-specific: market reads use md.read, tracker uses tracker.read,
        copy reads use copy.read, and alert operations use alerts.read or
        alerts.write. New scopes require explicit selection and grant no trading
        authority. Existing perps operations retain their documented scopes.

````

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