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

# Create a price alert

> Use this only when the user asks to be alerted when a token’s price goes above or below a level. Creates a price alert in their Burokku account that notifies them in Burokku, and by email, push or Telegram where those are set up. It never trades. Returns the alert as created.



## OpenAPI

````yaml /openapi.json post /alerts
openapi: 3.1.0
info:
  title: Burokku API
  version: '1'
  description: >-
    Read your Burokku portfolio: net worth, holdings, DeFi, perp and prediction
    market positions, liquidation risk, profit and loss, activity and alerts.
    Two writes only notify or watch: a price alert, and a watched address.
    Nothing in this API can trade, swap, send or sign. The same nine operations
    are the Burokku connector’s tools for AI apps.
servers:
  - url: https://api.burokku.app/v1
    description: Production
security:
  - oauth2:
      - portfolio.read
  - apiKey: []
tags:
  - name: Portfolio
    description: Net worth, holdings, positions, liquidation risk and profit and loss.
  - name: Activity
    description: Transactions and trades, newest first.
  - name: Alerts
    description: The account’s alerts, and price alerts that only notify.
  - name: Accounts
    description: Public addresses added watch-only.
paths:
  /alerts:
    post:
      tags:
        - Alerts
      summary: Create a price alert
      description: >-
        Use this only when the user asks to be alerted when a token’s price goes
        above or below a level. Creates a price alert in their Burokku account
        that notifies them in Burokku, and by email, push or Telegram where
        those are set up. It never trades. Returns the alert as created.
      operationId: create_price_alert
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePriceAlertInput'
      responses:
        '200':
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePriceAlert'
        '400':
          description: The request isn’t valid, or Burokku refuses the input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad-input:
                  value:
                    error:
                      code: bad-input
                      message: >-
                        Some of what was asked isn’t valid: limit: Too big:
                        expected number to be <=100
                bad-json:
                  value:
                    error:
                      code: bad-json
                      message: Send the body as JSON, up to 10 KB.
                unknown-asset:
                  value:
                    error:
                      code: unknown-asset
                      message: DOGEX isn’t a token Burokku tracks prices for.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            WWW-Authenticate:
              description: >-
                With an OAuth token lacking `portfolio.write`: an RFC 6750
                challenge with error="insufficient_scope" and
                scope="portfolio.read portfolio.write", so the app can ask for
                it.
              schema:
                type: string
          description: >-
            Refused. With a key or OAuth token that can only read,
            `insufficient-scope` (for an OAuth token, with a `WWW-Authenticate`
            challenge so the app can ask for `portfolio.write`; neither carries
            the rate headers, since the call never ran). Without an account (an
            anonymous connection), `account-required` with a sign-in link. Over
            the plan’s alerts, `plan-limit`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                insufficient-scope:
                  value:
                    error:
                      code: insufficient-scope
                      message: >-
                        This key or connection can only read. Make a key, or
                        connect again, with permission to watch addresses and
                        set alerts.
                account-required:
                  value:
                    error:
                      code: account-required
                      message: >-
                        Alerts need a Burokku account. Sign in at
                        https://app.burokku.app/oauth/claim?c=… to set one; the
                        addresses you added come with you.
        '413':
          description: The body is over 10 KB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: too-large
                  message: Send the body as JSON, up to 10 KB.
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/Off'
      security:
        - oauth2:
            - portfolio.write
        - apiKey: []
components:
  schemas:
    CreatePriceAlertInput:
      type: object
      properties:
        asset:
          type: string
          minLength: 1
          maxLength: 21
          pattern: ^\$?[A-Za-z0-9.]{1,20}$
          description: A token symbol, like ETH.
        direction:
          type: string
          enum:
            - above
            - below
        level_usd:
          type: number
          exclusiveMinimum: 0
          maximum: 1000000000000
          description: The price, in US dollars.
      required:
        - asset
        - direction
        - level_usd
    CreatePriceAlert:
      type: object
      properties:
        alert:
          type: object
          properties:
            id:
              description: 'REST only: a stable opaque id.'
              type: string
            kind:
              type: string
              description: The alert template (price, move, health, liquidation…).
            watches:
              type: string
              description: What it watches, in the user’s language.
            'on':
              type: boolean
            starter:
              type: boolean
              description: >-
                One of the alerts Burokku suggests, not switched on by the user
                yet.
            channels:
              type: array
              items:
                type: string
                enum:
                  - inapp
                  - email
                  - push
                  - telegram
            fired:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
              description: How many times it has fired.
            asset:
              type: string
            direction:
              type: string
              enum:
                - above
                - below
            level_usd:
              type: number
          required:
            - kind
            - watches
            - 'on'
            - starter
            - channels
            - fired
            - asset
            - direction
            - level_usd
          additionalProperties: false
        manage_path:
          type: string
          description: Where the alert is managed in Burokku.
        read_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
          description: When these figures were read (ISO 8601, UTC).
        refreshing:
          type: boolean
          description: >-
            True while Burokku reads the accounts again behind this answer; a
            later call has newer figures.
        currency:
          type: object
          properties:
            code:
              type: string
              description: The currency the account shows money in (USD, EUR, JPY…).
            per_usd:
              type: number
              exclusiveMinimum: 0
              description: >-
                Units of that currency per US dollar, to convert the *_usd
                figures.
          required:
            - code
            - per_usd
          additionalProperties: false
      required:
        - alert
        - manage_path
        - read_at
        - refreshing
        - currency
      additionalProperties: false
    Error:
      type: object
      description: >-
        Burokku’s errors: a code to branch on and a sentence that says what
        happened and what to do, in the language of the request’s
        Accept-Language (English when it names none Burokku speaks).
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                What went wrong, for code to branch on: bad-input, bad-json,
                bad-cursor, unknown-asset, not-address, secret,
                account-required, plan-limit, insufficient-scope, not-found,
                LOCKED, method-not-allowed, too-large, rate-limited,
                daily-limit, off or server-error; a 400 or 403 without its own
                code comes as bad-request or forbidden. New codes may be added.
            message:
              type: string
              description: >-
                What happened and what to do, for a person to read. Don’t parse
                it.
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  headers:
    X-RateLimit-Limit:
      description: >-
        The plan’s calls a day, shared by the REST API and the connector. Always
        the daily quota, never the per-minute limit or the read budget. On every
        answer from an operation, successes and errors alike, both 429s
        included; not on a 401, or an answer about the request itself (an
        unknown path, 405, 413, `bad-json`, a 403 for scope).
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: >-
        Calls left today, after this call if it counted. Only calls that run are
        counted, and it never says more than is left.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: >-
        When the count starts again: the end of the UTC day, in Unix epoch
        seconds.
      schema:
        type: integer
    Retry-After:
      description: >-
        Seconds to wait: until the UTC day ends for `daily-limit`, 60 for
        `rate-limited`.
      schema:
        type: integer
  responses:
    Unauthorized:
      description: >-
        No token (`unauthorized`), or a key or token that isn’t valid: made up,
        expired, revoked or issued for the MCP server (`invalid-token`). The
        `WWW-Authenticate` header says the same (`error="invalid_token"` when a
        token was sent) and names this API’s protected resource metadata. No
        rate headers: the account isn’t known.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              value:
                error:
                  code: unauthorized
                  message: >-
                    Send an API key or an access token as a Bearer token in the
                    Authorization header.
            invalid-token:
              value:
                error:
                  code: invalid-token
                  message: >-
                    This API key or access token isn’t valid. It may have
                    expired or been revoked.
      headers:
        WWW-Authenticate:
          description: >-
            For example: Bearer realm="OAuth",
            resource_metadata="https://api.burokku.app/.well-known/oauth-protected-resource/v1",
            error="invalid_token", scope="portfolio.read portfolio.write
            offline_access"
          schema:
            type: string
    Locked:
      description: >-
        The account is locked (Settings → Security). Every call is refused until
        it’s unlocked, before anything is counted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: LOCKED
              message: >-
                Your account is locked. Security changes are on hold for 24
                hours from when it was locked.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
    RateLimited:
      description: >-
        Over a limit: 30 calls a minute per account (`rate-limited`,
        `Retry-After: 60`), or the plan’s calls for the UTC day, shared with the
        connector (`daily-limit`, which links only the pricing page;
        `Retry-After` is the seconds until the UTC day ends). Reads also count
        against the account’s read budget, which answers `rate-limited` with
        `Retry-After: 60`. A refused call isn’t counted, and the `X-RateLimit-*`
        headers still describe the day.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate-limited:
              value:
                error:
                  code: rate-limited
                  message: Too many calls in a minute. Try again in a minute.
            daily-limit:
              value:
                error:
                  code: daily-limit
                  message: >-
                    This account has used today’s 100 calls from AI apps and the
                    API; they start again at midnight UTC. Plans with more are
                    at https://burokku.app/pricing
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
    ServerError:
      description: Something failed on Burokku’s side. Try again in a minute.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: server-error
              message: Something went wrong on Burokku’s side. Try again in a minute.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
    'Off':
      description: Burokku for AI apps and the API is switched off for now.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: 'off'
              message: >-
                Burokku for AI apps and the API isn’t available right now. Try
                again later.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.1 for apps that act for a Burokku user: the authorization code
        grant with PKCE (S256) required of every client. Clients use a Client ID
        Metadata Document, or register at /oauth/register (at most 20
        registrations an hour from one network). Set `resource` to
        https://api.burokku.app/v1: a token issued for the MCP server (the
        default without `resource`) is refused here with a 401
        (`invalid-token`); a token is for one resource, so authorize once for
        each and refresh with the same `resource` (another gets
        `invalid_target`). Every grant includes portfolio.read. Authorization
        server metadata:
        https://app.burokku.app/.well-known/oauth-authorization-server; this
        API’s protected resource metadata:
        https://api.burokku.app/.well-known/oauth-protected-resource/v1. Access
        tokens last 1 hour; each refresh returns a new refresh token (use the
        newest), and one unused for 30 days lapses. OAuth errors are JSON, `{
        error, error_description }`.
      flows:
        authorizationCode:
          authorizationUrl: https://app.burokku.app/oauth/authorize
          tokenUrl: https://app.burokku.app/oauth/token
          refreshUrl: https://app.burokku.app/oauth/token
          scopes:
            portfolio.read: Read balances, positions, activity and alerts. Every grant has it.
            portfolio.write: Create price alerts and add watched addresses.
            offline_access: >-
              Get a refresh token, to stay connected past the access token’s
              hour.
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: bk_live_…
      description: >-
        A personal API key (`bk_live_` and 43 more characters), sent as
        `Authorization: Bearer bk_live_…`. A key reads only, unless it was made
        with write. Never put a key in a URL.

````

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