Skip to content
Terminal
All pages

API reference

Generated from the OpenAPI description of the API. Every route, its parameters, answers and error codes.

Download the OpenAPI file

Authentication: apiKey: API key in the Authorization header, as Bearer.

Account

The account, the plan, usage and coins.

GET /v1/account

The account, the plan and the calling key.

Key scope
read

Responses

StatusDescriptionError codes
200The account, the plan and the calling key.
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

GET /v1/usage

Calls, previews, notes and the credit balance for this month and today.

Key scope
read

Responses

StatusDescriptionError codes
200Calls, previews, notes and the credit balance for this month and today.
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

GET /v1/assets

Coins the feed covers. No prices.

Key scope
read

Parameters

NameInTypeRequiredDescription
queryquerystringNo1 to 40 characters. Omit it for every active coin, up to 500. With it, up to 5 matches.

Responses

StatusDescriptionError codes
200Coins the feed covers. No prices.
400query must be 1 to 40 characters when you send it.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 402, 403, 429 and 500, as in common answers.

Rules

Rules, a preview of a condition, and the record of what the price did later.

GET /v1/rules

Every rule that is not archived, oldest first.

Key scope
read

Responses

StatusDescriptionError codes
200Every rule that is not archived, oldest first.
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/rules

Create a rule. The coin is added to the watchlist.

Key scope
rules:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The rule to create.

NameTypeRequiredDescription
kindstring: price_above, price_below, percent_change, volume_spike, unusual_moveYes
scopestring: symbol, watchlistNoDefault symbol. watchlist is for percent, volume and unusual kinds.
symbolstring or nullNoAn active coin. Required for symbol scope. Absent or null for a watchlist.
conditionobject, see the schemaYesPublic condition names for the rule's kind. Defaults fill optional fields. Read-only extras are refused.
cooldown_secondsinteger: 900, 1800, 3600, 14400, 43200, 86400, 604800NoDefault 3600, or 14400 for unusual_move.
note_modestring: auto, on_request, offNoDefault auto.
destination_idsarray of integer or nullNoNull, the default, sends to every active destination except bot webhooks.
namestringNo

Responses

StatusDescriptionError codes
201Create a rule. The coin is added to the watchlist.
400A field is wrong, a read-only condition extra was sent, or Idempotency-Key is missing or not printable ASCII.See the list
402The plan's active rules are full (limit rules), the coin would pass the watchlist limit (limit coins), or a block of calls cannot be paid.See the list
409The same condition already exists (reason duplicate_rule, with rule_id), this Idempotency-Key was used for a different request (idempotency_key_reused), or the first request is still running (in_progress).See the list
429The key, the account, or the account's rule changes (60 a minute) are over the limit.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 403 and 500, as in common answers.

GET /v1/rules/{id}

One rule.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.

Responses

StatusDescriptionError codes
200One rule.
404No rule with that id belongs to this account.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

PATCH /v1/rules/{id}

Change a rule. A new condition, kind, scope or coin clears its state.

Key scope
rules:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Request body (required)

Fields to change.

NameTypeRequiredDescription
kindstring: price_above, price_below, percent_change, volume_spike, unusual_moveNo
scopestring: symbol, watchlistNoDefault symbol. watchlist is for percent, volume and unusual kinds.
symbolstring or nullNoAn active coin. Required for symbol scope. Absent or null for a watchlist.
conditionobject, see the schemaNoPublic condition names for the rule's kind. Defaults fill optional fields. Read-only extras are refused.
cooldown_secondsinteger: 900, 1800, 3600, 14400, 43200, 86400, 604800NoDefault 3600, or 14400 for unusual_move.
note_modestring: auto, on_request, offNoDefault auto.
destination_idsarray of integer or nullNoNull, the default, sends to every active destination except bot webhooks.
namestringNo

Responses

StatusDescriptionError codes
200Change a rule. A new condition, kind, scope or coin clears its state.
400A field is wrong, or the body is empty.See the list
402The plan's active rules are full, the coin would pass the watchlist limit, or a block of calls cannot be paid.See the list
404No rule with that id belongs to this account.See the list
409duplicate_rule, idempotency_key_reused, in_progress, use_subscription (change the subscription instead), or rule_backs_service (the rule backs a service).See the list
429The key, the account, or the account's rule changes (60 a minute) are over the limit.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 403 and 500, as in common answers.

DELETE /v1/rules/{id}

Delete a rule. Its alerts stay for the record, and leave this account's feed.

Key scope
rules:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Responses

StatusDescriptionError codes
200Delete a rule. Its alerts stay for the record, and leave this account's feed.
404No rule with that id belongs to this account.See the list
409idempotency_key_reused, in_progress, use_subscription, or rule_backs_service.See the list
429The key, the account, or the account's rule changes (60 a minute) are over the limit.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403 and 500, as in common answers.

POST /v1/rules/{id}/pause

Pause a rule. Pausing a paused rule leaves it paused.

Key scope
rules:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Pause a rule. Pausing a paused rule leaves it paused.
404No rule with that id belongs to this account.See the list
409idempotency_key_reused, in_progress, use_subscription, or rule_backs_service.See the list
429The key, the account, or the account's rule changes (60 a minute) are over the limit.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403 and 500, as in common answers.

POST /v1/rules/{id}/resume

Resume a rule. active_since becomes now when it was paused.

Key scope
rules:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Resume a rule. active_since becomes now when it was paused.
402The plan's active rules are full (limit rules), or a block of calls cannot be paid.See the list
404No rule with that id belongs to this account.See the list
409idempotency_key_reused, in_progress, use_subscription, or rule_backs_service.See the list
429The key, the account, or the account's rule changes (60 a minute) are over the limit.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 403 and 500, as in common answers.

POST /v1/rules/preview

How often a condition would have been met over the last 30 days. Nothing is saved.

Key scope
read

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The condition to preview.

NameTypeRequiredDescription
kindstring: price_above, price_below, percent_change, volume_spike, unusual_moveYes
scopestring: symbol, watchlistNoDefault symbol. watchlist is for percent, volume and unusual kinds.
symbolstring or nullNoAn active coin. Required for symbol scope. Absent or null for a watchlist.
conditionobject, see the schemaYesPublic condition names for the rule's kind. Defaults fill optional fields. Read-only extras are refused.
cooldown_secondsinteger: 900, 1800, 3600, 14400, 43200, 86400, 604800NoDefault 3600, or 14400 for unusual_move.

Responses

StatusDescriptionError codes
200How often a condition would have been met over the last 30 days. Nothing is saved.
400A field is wrong, or Idempotency-Key is missing or not printable ASCII.See the list
402The day's previews are used and the charge is refused (credits_required or quota_exceeded), or a block of calls cannot be paid.See the list
409idempotency_key_reused or in_progress. A key that already paid stays used.See the list
429The key, the account, or the preview limit (reason previews, Retry-After 5). The preview queue uses the same reason.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 403 and 500, as in common answers.

GET /v1/rules/{id}/record

What the price did after each alert of one rule.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
limitqueryintegerNoMost alerts in one page.
beforequeryintegerNoAn alert id. The page holds alerts with a lower id.

Responses

StatusDescriptionError codes
200What the price did after each alert of one rule.
400limit must be 1 to 200, and before must be an alert id.See the list
404No rule with that id belongs to this account.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 402, 403, 429 and 500, as in common answers.

Events

Alerts as they are recorded, one alert, and a measured note for a coin.

GET /v1/events

The account's alerts in the order they were recorded.

Key scope
read

Parameters

NameInTypeRequiredDescription
cursorquerystringNoA next_cursor from an earlier answer. Read events after that point.
startquerystring: latest, earliestNoUsed only when cursor is omitted. latest reads alerts recorded from now on. earliest reads from the oldest alert kept, 7 days back.
waitqueryintegerNoSeconds to keep the request open when no event is ready.
limitqueryintegerNoMost events in one answer.
rule_idqueryintegerNoOnly this rule's events. The cursor still moves past the account's other alerts.

Responses

StatusDescriptionError codes
200The account's alerts in the order they were recorded.
400A query parameter is wrong. cursor must be a cursor this API issued.See the list
402The answer had events, and a block of calls cannot be paid. The cursor does not move.See the list
404rule_id is not a rule of this account.See the list
429The key or the account is over its calls per minute, the key has too many open long-polls (reason long_polls), or this process is full (reason server_busy).See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 403 and 500, as in common answers.

GET /v1/alerts/{id}

One alert, including alerts the person's own channels held, inside the plan's history.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.

Responses

StatusDescriptionError codes
200One alert, including alerts the person's own channels held, inside the plan's history.
404No alert with that id belongs to this account, or it is older than the plan's history.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/explain

A measured note for one coin over one window. Facts are returned even when a note cannot be written.

Key scope
read

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The coin and the window.

NameTypeRequiredDescription
symbolstringYesAn active coin.
windowstring: 15m, 1h, 4h, 24hYes

Responses

StatusDescriptionError codes
200A measured note for one coin over one window. Facts are returned even when a note cannot be written.
400symbol or window is wrong, or Idempotency-Key is missing or not printable ASCII.See the list
402A block of calls cannot be paid. The note's own charge never answers 402: the facts come back instead.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 403, 429 and 500, as in common answers.

Destinations

Where alerts are sent, including webhooks your software receives.

GET /v1/destinations

Every destination, oldest first.

Key scope
read

Responses

StatusDescriptionError codes
200Every destination, oldest first.
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/destinations

Add a webhook destination. The signing secret is in this answer only.

Key scope
destinations:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The webhook to add.

NameTypeRequiredDescription
kindwebhookYes
formatstring: terminal, template, presetYes
urlstringNoA public https URL with no credentials. Required for terminal, template, and the cryptohopper preset.
presetstring: 3commas_signal_bot, cryptohopperNoRequired when format is preset.
inputsobject, see the schemaNoValues for the preset fields, or the template input names.
secretsobject, see the schemaNoValues for secret fields. Returned only as names afterwards.
templateobject, see the schemaNo
retriesbooleanNoTemplate only. Default false.
labelstringNo

Responses

StatusDescriptionError codes
201Add a webhook destination. The signing secret is in this answer only.
400A field is wrong, a field belongs to another format, the preset is not released, or Idempotency-Key is missing or not printable ASCII.See the list
402The plan has no webhooks or its webhook count is full (limit webhook_destinations), the account already has 20 destinations (limit destinations), or a block of calls cannot be paid.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed, the private beta does not include the account, or webhooks are switched off (reason feature_off).See the list

Also 401, 403, 429 and 500, as in common answers.

GET /v1/destinations/presets

Bot presets a destination can use.

Key scope
read

Responses

StatusDescriptionError codes
200Bot presets a destination can use.
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

GET /v1/destinations/{id}

One destination.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.

Responses

StatusDescriptionError codes
200One destination.
404No destination with that id belongs to this account.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

PATCH /v1/destinations/{id}

Change the label, pause, or, for a terminal webhook, the URL.

Key scope
destinations:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Request body (required)

Fields a key may change.

NameTypeRequiredDescription
labelstringNoCannot be emptied.
pausedbooleanNoCannot clear unverified. Only a test can.
urlstringNoTerminal format only. Changing it makes the destination unverified again.

Responses

StatusDescriptionError codes
200Change the label, pause, or, for a terminal webhook, the URL.
400A field is wrong, or the label is emptied.See the list
403The key lacks destinations:write, or the field changes only in the signed-in app (required_scope session).See the list
404No destination with that id belongs to this account.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 402, 429 and 500, as in common answers.

DELETE /v1/destinations/{id}

Delete a webhook destination and its delivery log.

Key scope
destinations:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Responses

StatusDescriptionError codes
200Delete a webhook destination and its delivery log.
403The key lacks destinations:write, or the destination is not a webhook (required_scope session).See the list
404No destination with that id belongs to this account.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 400, 401, 402, 429 and 500, as in common answers.

POST /v1/destinations/{id}/test

Queue a test send. The result shows up on last_test.

Key scope
destinations:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty, or no body, for a terminal webhook. confirm true for a template or a preset.

NameTypeRequiredDescription
confirmbooleanNoRequired, and true, for a template or a preset. A test sends the body an alert would send, and a bot may act on it.

Responses

StatusDescriptionError codes
202Queue a test send. The result shows up on last_test.
400confirm is missing for a template or a preset, or Idempotency-Key is missing or not printable ASCII.See the list
402The plan does not include webhooks (limit webhook_destinations), or a block of calls cannot be paid.See the list
404No destination with that id belongs to this account.See the list
409The destination is revoked or paused (reason destination_off), or the Idempotency-Key clashes.See the list
429The key, the account, or test sends (reason tests, 10 a minute) are over the limit.See the list
503The channel is closed for this account, or the private beta does not include the account.See the list

Also 401, 403 and 500, as in common answers.

Exchange

Profiles, services built from rules, subscriptions, records, earnings and sales. Answers 503 (exchange_closed) while the exchange is not open for the account, except reading, ending and reporting a subscription and reading earnings.

GET /v1/profile

Your profile, with handle_locked.

Key scope
read

Responses

StatusDescriptionError codes
200Your profile, with handle_locked.
404The account has no profile yet.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

PUT /v1/profile

Create or change your profile. 201 when it is new.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The profile.

NameTypeRequiredDescription
handlestringYes
namestringYes
biostringNo

Responses

StatusDescriptionError codes
200Create or change your profile. 201 when it is new.
201The profile was created.
400A field is wrong, or the text has a link, a contact or trading words (fields).See the list
409handle_taken, handle_reserved, handle_locked, profile_suspended, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

GET /v1/profiles/{handle}

One profile.

Key scope
read

Parameters

NameInTypeRequiredDescription
handlepathstringYesA profile's handle, such as terminal.

Responses

StatusDescriptionError codes
200One profile.
404No profile with that handle.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

GET /v1/services

The catalogue of listed services.

Key scope
read

Parameters

NameInTypeRequiredDescription
kindquerystring: feed, callNofeed (events) or call (one answer per API request).
symbolquerystringNoOnly services that watch this coin.
sellerquerystringNoOnly this seller's services, by handle.
pricequerystring: free, paidNofree, or paid. Plan-included offers are neither.
max_price_centsqueryintegerNoOnly services with an offer at or below this price per unit.
completequerybooleanNoTrue keeps services whose record status is a complete record: no gap, old enough, enough events, anchored. This is stricter than the record field complete, which only says the numbers have no gap. False or absent applies no filter: it does not select incomplete records. When both this and the deprecated query field are sent, this one decides.
verifiedquerybooleanNoThe query field verified is deprecated. Use complete.
limitqueryintegerNoMost services in one page.
cursorquerystringNoA next_cursor from an earlier page. It keeps the first page's time, so the order holds across pages.

Responses

StatusDescriptionError codes
200The catalogue of listed services.
400A query parameter is wrong, or cursor is not one this API issued.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

POST /v1/services

Create a feed service from your rules. It starts recording.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The service.

NameTypeRequiredDescription
slugstringYes3 to 48 characters: a-z, 0-9 and hyphens. Unique among the profile's services.
namestringYes
descriptionstringNo
rule_idsarray of integerYesYour active one-coin rules, each waiting at least 900 seconds between alerts, not backing another service.
offerobject, see the schemaYes

Responses

StatusDescriptionError codes
201Create a feed service from your rules. It starts recording.
400A field is wrong, or the text has a link, a contact or trading words (fields).See the list
409profile_required, profile_suspended, email_unverified, service_limit, rule_not_eligible (fields names each rule), slug_taken, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

GET /v1/services/{id}

One service. The seller sees rule_ids, fees and reasons too.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.

Responses

StatusDescriptionError codes
200One service. The seller sees rule_ids, fees and reasons too.
404No service with that id, or another seller's service that is recording or was retired before it was listed.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

PATCH /v1/services/{id}

Change the name or the description.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Request body (required)

name, description, or both.

NameTypeRequiredDescription
namestringNo
descriptionstringNo

Responses

StatusDescriptionError codes
200Change the name or the description.
400A field is wrong, or the body is empty.See the list
404No service with that id belongs to this account's profile.See the list
409profile_suspended, service_retired, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

GET /v1/services/{id}/record

A service's numbered events and what the price did after each. This is a price record, not a recommendation.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
limitqueryintegerNoMost alerts in one page.
beforequeryintegerNoA seq. The page holds events with a lower seq.

Responses

StatusDescriptionError codes
200A service's numbered events and what the price did after each. This is a price record, not a recommendation.
400limit must be 1 to 200, and before must be a seq.See the list
404No service with that id, or another seller's service that is recording or was retired before it was listed.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

GET /v1/me/services

Your services in every state, in the seller's view.

Key scope
read

Responses

StatusDescriptionError codes
200Your services in every state, in the seller's view.
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/services/{id}/offer

Replace the offer with a new price. Subscribers keep their price for 30 days when it goes up.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The new offer.

NameTypeRequiredDescription
kindstring: free, per_eventYes
price_centsintegerYes0 for free. 5 to 100 for per_event, in steps of 5.

Responses

StatusDescriptionError codes
200Replace the offer with a new price. Subscribers keep their price for 30 days when it goes up.
400kind or price_cents is wrong.See the list
404No service with that id belongs to this account's profile.See the list
409offer_change_too_soon (retry_after), profile_suspended, service_retired, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

POST /v1/services/{id}/list

Put the service in the catalogue. Charges the listing fee for the current 30 days when it is not paid.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Put the service in the catalogue. Charges the listing fee for the current 30 days when it is not paid.
402The credits do not cover the listing fee (credits_required, with balance_cents, price_cents, and buy_url while credit packs are on sale).See the list
404No service with that id belongs to this account's profile.See the list
409not_listable (missing), profile_suspended, service_retired, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 403, 429 and 500, as in common answers.

POST /v1/services/{id}/unlist

Take the service out of the catalogue. Subscribers keep receiving events.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Take the service out of the catalogue. Subscribers keep receiving events.
404No service with that id belongs to this account's profile.See the list
409service_not_listed, service_retired, profile_suspended, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/services/{id}/retire

Retire the service for good. Subscriptions end. The record stays readable.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Retire the service for good. Subscriptions end. The record stays readable.
404No service with that id belongs to this account's profile.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

GET /v1/subscriptions

Your subscriptions, newest first.

Key scope
read

Parameters

NameInTypeRequiredDescription
statusquerystring: active, paused, paused_unpaid, paused_cap, paused_plan, endedNoOnly subscriptions with this status.

Responses

StatusDescriptionError codes
200Your subscriptions, newest first.
400status is not a subscription status.See the list
503The channel is closed for this account. This route works while the exchange is closed, so you can stop and report what you pay for.See the list

Also 401, 402, 403, 429 and 500, as in common answers.

POST /v1/subscriptions

Subscribe to a listed feed. Nothing is charged now. Each event is charged when it arrives.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The service and the offer you read.

NameTypeRequiredDescription
service_idintegerYes
offer_idintegerYesThe service's active offer, as you read it. Another one answers offer_changed.
monthly_cap_centsintegerNoPaid offers: 100 to 10000 cents a month, a multiple of 100. Default 500. Ignored on a free offer.
destination_idsarray of integer or nullNoNull, or ids of your destinations. A template or preset webhook is refused (preset_not_allowed).
namestringNoThe routing rule's name. Default: the service's name.

Responses

StatusDescriptionError codes
201Subscribe to a listed feed. Nothing is charged now. Each event is charged when it arrives.
400A field is wrong, the service answers one request at a time (service_id), or the offer is not a credits offer (offer_id).See the list
402The plan's active rules are full (limit rules). A subscription counts as one of your alerts.See the list
404No listed service with that id.See the list
409service_not_listed, own_service, already_subscribed, offer_changed (offer), preset_not_allowed, idempotency_key_reused or in_progress.See the list
429The key or the account is over its calls per minute, or the account started 20 subscriptions today (reason subscriptions_limit).See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 403 and 500, as in common answers.

GET /v1/subscriptions/{id}

One subscription.

Key scope
read

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.

Responses

StatusDescriptionError codes
200One subscription.
404No subscription with that id belongs to this account.See the list
503The channel is closed for this account. This route works while the exchange is closed, so you can stop and report what you pay for.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

PATCH /v1/subscriptions/{id}

Change the cap, the destinations or the name. A higher cap resumes a subscription paused at its cap when there is room.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Request body (required)

Fields to change.

NameTypeRequiredDescription
monthly_cap_centsintegerNoPaid offers: 100 to 10000 cents a month, a multiple of 100. Default 500. Ignored on a free offer.
destination_idsarray of integer or nullNoNull, or ids of your destinations. A template or preset webhook is refused (preset_not_allowed).
namestringNo

Responses

StatusDescriptionError codes
200Change the cap, the destinations or the name. A higher cap resumes a subscription paused at its cap when there is room.
400A field is wrong, or the body is empty.See the list
404No subscription with that id belongs to this account.See the list
409ended, preset_not_allowed, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

DELETE /v1/subscriptions/{id}

End a subscription. Ending an ended one keeps its first end_reason.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Responses

StatusDescriptionError codes
200End a subscription. Ending an ended one keeps its first end_reason.
404No subscription with that id belongs to this account.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed for this account. This route works while the exchange is closed, so you can stop and report what you pay for.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/subscriptions/{id}/pause

Pause. Events while paused are not delivered and not charged.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Pause. Events while paused are not delivered and not charged.
404No subscription with that id belongs to this account.See the list
409ended, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/subscriptions/{id}/resume

Resume from paused, paused_unpaid or paused_cap. Delivery starts from the next event.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body

Empty object, or no body.

An empty JSON object.

Responses

StatusDescriptionError codes
200Resume from paused, paused_unpaid or paused_cap. Delivery starts from the next event.
402The credits do not cover one event (credits_required), a cap has no room (quota_exceeded, limit subscription_monthly or exchange_monthly), or the plan's active rules are full (limit rules).See the list
404No subscription with that id belongs to this account.See the list
409ended, paused_plan, service_retired, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 403, 429 and 500, as in common answers.

POST /v1/subscriptions/{id}/accept-offer

Accept the service's new price at once.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The offer you were shown.

NameTypeRequiredDescription
offer_idintegerYespending_offer.id, the offer you were shown.
monthly_cap_centsintegerNoPaid offers: 100 to 10000 cents a month, a multiple of 100. Default 500. Ignored on a free offer.

Responses

StatusDescriptionError codes
200Accept the service's new price at once.
400offer_id or monthly_cap_cents is wrong.See the list
404No subscription with that id belongs to this account.See the list
409offer_changed (offer), ended, service_retired, idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

POST /v1/subscriptions/{id}/report

Report a subscription. It ends, and charges still on hold come back as credits.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
idpathintegerYesA positive integer below 2^31. Anything else, or another account's id, is not found.
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

Why.

NameTypeRequiredDescription
reasonstring: not_as_described, did_not_subscribe, spam, otherYes
notestringNo

Responses

StatusDescriptionError codes
200Report a subscription. It ends, and charges still on hold come back as credits.
400reason is not one of the listed values, or note is too long.See the list
404No subscription with that id belongs to this account.See the list
409already_reported, report_window_passed, idempotency_key_reused or in_progress.See the list
429The key or the account is over its calls per minute, or the account sent 3 reports this month (reason reports_limit).See the list
503The channel is closed for this account. This route works while the exchange is closed, so you can stop and report what you pay for.See the list

Also 401, 402, 403 and 500, as in common answers.

GET /v1/earnings

What you are owed as a seller, with the last 50 rows.

Key scope
read

Responses

StatusDescriptionError codes
200What you are owed as a seller, with the last 50 rows.
503The channel is closed for this account. This route works while the exchange is closed, so you can stop and report what you pay for.See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

POST /v1/earnings/to-credits

Move available earnings into credits, up to the room left under the credit balance cap.

Key scope
services:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesRequired. 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer and does not run the work again.

Request body (required)

The amount.

NameTypeRequiredDescription
centsintegerYesAt least 100, at most available_cents.

Responses

StatusDescriptionError codes
200Move available earnings into credits, up to the room left under the credit balance cap.
400cents is not a whole number, or is below 100, or Idempotency-Key is missing.See the list
409insufficient_earnings (available_cents), balance_cap (cap_cents, balance_cents, room_cents: the balance is at its cap), idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

GET /v1/sales

Your sales as a seller and your purchases as a buyer, newest first.

Key scope
read

Parameters

NameInTypeRequiredDescription
rolequerystring: seller, buyerNoseller for your sales, buyer for your purchases. Omit it for both.
beforequeryintegerNoA sale id. The page holds older sales.
limitqueryintegerNoMost sales in one page.

Responses

StatusDescriptionError codes
200Your sales as a seller and your purchases as a buyer, newest first.
400role, before or limit is wrong.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

GET /v1/me/exchange

The account's monthly cap on all subscriptions, and this month's spend.

Key scope
read

Responses

StatusDescriptionError codes
200The account's monthly cap on all subscriptions, and this month's spend.
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 400, 401, 402, 403, 429 and 500, as in common answers.

PATCH /v1/me/exchange

Change the account's monthly cap.

Key scope
subscriptions:write

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNoOptional. When you send it, 1 to 255 printable ASCII characters. The same value and the same request returns the stored answer.

Request body (required)

The new cap.

NameTypeRequiredDescription
monthly_cap_centsintegerYes

Responses

StatusDescriptionError codes
200Change the account's monthly cap.
400monthly_cap_cents must be 0 to 50000, a multiple of 100.See the list
409idempotency_key_reused or in_progress.See the list
503The channel is closed for this account, or the exchange is not open for it (reason exchange_closed).See the list

Also 401, 402, 403, 429 and 500, as in common answers.

Common answers

Most routes give these answers with the same meaning. A route that means something else by a status lists it in its own table.

StatusDescriptionError codes
400The body is not one JSON object, or a field, a query parameter or a header is wrong. fields names each one.See the list
401No Authorization header, the scheme is not Bearer, or the key is malformed, unknown, revoked, or the account is gone.See the list
402Included calls for the month are used up, and the balance or a spend cap cannot pay for the next block of calls.See the list
403The key does not include the scope in x-scope.See the list
429The key or the account is over its calls per minute. Retry-After is whole seconds, at least 1.See the list
500Terminal failed while handling the request. Sending it again with the same Idempotency-Key is safe.See the list

Error codes

An error answer carries one of these in error.code. Branch on the code, not the message.

  • invalid_key
  • scope_missing
  • terms_required
  • credits_required
  • quota_exceeded
  • payment_required
  • rate_limited
  • not_found
  • conflict
  • validation_failed
  • not_available
  • server_error

Was this page helpful?