Skip to content
Docs
Esc
↑↓navigate↵open⌘Jpreview

Create an alert rule.

Creates an alert rule of one kind; the API checks the fields that kind needs.

POST/v1/me/alerts
Authorization
sessionAPI key · cookierequired

An opaque, revocable INVICTUS session set by createSession.

Header parameters
Idempotency-Keystringrequired

A key the client makes per intended write; a repeat with the same key and body is answered as the first, never applied twice.

min length 1 · max length 200
X-Telegram-Userstring

With the service credential: the linked Telegram user the call acts for.

matches ^[0-9]{1,20}$
Request body
requiredapplication/json
kindstringrequired

What the rule watches.

Allowed:out-of-rangeback-in-rangenear-edgefees-readyvalue-movedclosed-elsewhereprice-levelprice-movepool-metricnew-pooltoken-changetransactionfunds-movednew-loginkey-exportsource-stale
subjectobject | nullrequired

What the rule is about; null for an account-wide rule.

Show properties
Any of:
object
typestringrequired

What kind of thing the subject is.

Allowed:poolpositionwallettokenoperationaccounttrader
idstringrequired

Its id: a pool path, a wallet reference, a public id.

min length 1 · max length 200
null
null
conditionobjectrequired

When the rule fires; the fields its kind needs.

Show properties
thresholdPercentDecimal

The change that fires the rule, in percent.

max length 80 · matches ^-?[0-9]+(?:\.[0-9]+)?$
levelUsdDecimal

The price level that fires the rule, in US dollars.

max length 80 · matches ^-?[0-9]+(?:\.[0-9]+)?$
directionstring

Fire on a move up, down, or either way.

Allowed:updowneither
windowSecondsnumber

The window a change is measured over, in seconds.

Allowed:300360086400
metricstring

The pool figure a pool-metric rule watches.

Allowed:fee-aprtvlvolumeliquidity
deliveryobjectrequired

How its notifications are delivered.

Show properties
channelsstring[]required

Where a notification is delivered: the inbox, Telegram, or both.

min items 1 · max items 2
cooldownSecondsintegerrequired

The least time between two notifications of the rule, in seconds.

min 0 · max 86400
quietHoursobject | nullrequired

Hours in which no notification is sent; null for none.

Show properties
Any of:
object
fromstringrequired

When quiet hours start, as HH:MM.

matches ^([01]\d|2[0-3]):[0-5]\d$
tostringrequired

When quiet hours end, as HH:MM.

matches ^([01]\d|2[0-3]):[0-5]\d$
timeZonestringrequired

The IANA time zone of from and to.

min length 1 · max length 64
null
null
digeststringrequired

Send each notification at once, or a daily digest.

Allowed:offdaily
Responses
201

Success.

kindstringrequired

What the rule watches.

Allowed:out-of-rangeback-in-rangenear-edgefees-readyvalue-movedclosed-elsewhereprice-levelprice-movepool-metricnew-pooltoken-changetransactionfunds-movednew-loginkey-exportsource-stale
subjectobject | nullrequired

What the rule is about; null for an account-wide rule.

Show properties
Any of:
object
typestringrequired

What kind of thing the subject is.

Allowed:poolpositionwallettokenoperationaccounttrader
idstringrequired

Its id: a pool path, a wallet reference, a public id.

min length 1 · max length 200
null
null
conditionobjectrequired

When the rule fires; the fields its kind needs.

Show properties
thresholdPercentDecimal

The change that fires the rule, in percent.

max length 80 · matches ^-?[0-9]+(?:\.[0-9]+)?$
levelUsdDecimal

The price level that fires the rule, in US dollars.

max length 80 · matches ^-?[0-9]+(?:\.[0-9]+)?$
directionstring

Fire on a move up, down, or either way.

Allowed:updowneither
windowSecondsnumber

The window a change is measured over, in seconds.

Allowed:300360086400
metricstring

The pool figure a pool-metric rule watches.

Allowed:fee-aprtvlvolumeliquidity
deliveryobjectrequired

How its notifications are delivered.

Show properties
channelsstring[]required

Where a notification is delivered: the inbox, Telegram, or both.

min items 1 · max items 2
cooldownSecondsintegerrequired

The least time between two notifications of the rule, in seconds.

min 0 · max 86400
quietHoursobject | nullrequired

Hours in which no notification is sent; null for none.

Show properties
Any of:
object
fromstringrequired

When quiet hours start, as HH:MM.

matches ^([01]\d|2[0-3]):[0-5]\d$
tostringrequired

When quiet hours end, as HH:MM.

matches ^([01]\d|2[0-3]):[0-5]\d$
timeZonestringrequired

The IANA time zone of from and to.

min length 1 · max length 64
null
null
digeststringrequired

Send each notification at once, or a daily digest.

Allowed:offdaily
idstringrequired

The rule's id.

matches ^[A-Za-z0-9_-]{8,64}$
enabledbooleanrequired

False while the rule is switched off.

mutedUntilinteger | nullrequired

Until when the rule is muted, in Unix seconds; null when it is not.

Show properties
Any of:
integer
integer
null
null
lastFiredAtinteger | nullrequired

When the rule last fired, in Unix seconds; null if never.

Show properties
Any of:
integer
integer
null
null
revisionintegerrequired

The revision to send with a change.

min 0 · max 9007199254740991
400

Invalid input; errors names the fields.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
401

No session, or it ended.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
409

In conflict with the current state.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
429

Too many requests; retryAfterSeconds says when to ask again.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
500

Server error.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST '/v1/me/alerts' \
  -H 'Cookie: session=YOUR_API_KEY' \
  -H 'Idempotency-Key: string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": "out-of-range",
  "subject": {
    "type": "pool",
    "id": "string"
  },
  "condition": {
    "thresholdPercent": "1234.56",
    "levelUsd": "1234.56",
    "direction": "up",
    "windowSeconds": 300,
    "metric": "fee-apr"
  },
  "delivery": {
    "channels": [
      "inbox"
    ],
    "cooldownSeconds": 0,
    "quietHours": {
      "from": "string",
      "to": "string",
      "timeZone": "Asia/Jakarta"
    },
    "digest": "off"
  }
}'
Response
{
  "kind": "out-of-range",
  "subject": {
    "type": "pool",
    "id": "string"
  },
  "condition": {
    "thresholdPercent": "1234.56",
    "levelUsd": "1234.56",
    "direction": "up",
    "windowSeconds": 300,
    "metric": "fee-apr"
  },
  "delivery": {
    "channels": [
      "inbox"
    ],
    "cooldownSeconds": 0,
    "quietHours": {
      "from": "string",
      "to": "string",
      "timeZone": "Asia/Jakarta"
    },
    "digest": "off"
  },
  "id": "Xq3v9Kp2LmN8RtY4",
  "enabled": true,
  "mutedUntil": 1793145600,
  "lastFiredAt": 1793145600,
  "revision": 0
}