apiTON
HomeExplorerBlog
HomeExplorerBlog
Contact
  1. v2.Watch
  • api:TON Documentation
  • v2.Nft
    • Username
      POST
    • Number
      POST
    • Domain
      POST
    • Gift
      POST
    • Item
      POST
    • Items
      POST
  • v2.Rate
    • Fiat rate
      POST
    • Crypto rate
      POST
    • Exchanges rate
      POST
    • Jetton prices
      POST
  • v2.Auth
    • Do
      POST
    • List
      POST
    • Import
      POST
    • Backup
      POST
    • Delete
      POST
    • New
      POST
  • v2.Wallet
    • Send TON
      POST
    • Send Jetton
      POST
    • Send Nft
      POST
  • v2.Address
    • Transactions
    • Details
    • Jettons
    • NFTs
    • Wallets
    • Collections
  • v2.NftContract
    • Mint Nft Collection
    • Mint NFT
  • v2.JettonContract
    • Mint
    • Burn
    • Change owner
    • Close Mint
  • v2.Watch
    • Create watch
      POST
    • List watches
      POST
    • Delete watch
      POST
    • Poll events
      POST
    • Test watch
      POST
  • Schemas
    • Schemas
      • Connect Error
      • google.protobuf.Any
      • ListValue
      • NullValue
      • Struct
      • FieldsEntry
      • google.protobuf.Timestamp
      • google.protobuf.Value
      • BlockID
      • BurnRequest
      • BurnResponse
      • ChangeAdminRequest
      • ChangeAdminResponse
      • CloseMintRequest
      • CloseMintResponse
      • DetailsAddress
      • DetailsRequest
      • DetailsResponse
      • DomainRequest
      • DomainResponse
      • ItemRequest
      • ItemResponse
      • Jetton
      • JettonDetails
      • JettonsRequest
      • JettonsResponse
      • Message
      • MintCollectionRequest
      • MintCollectionResponse
      • MintNftRequest
      • MintNftResponse
      • MintRequest
      • MintResponse
      • NftItem
      • NftsRequest
      • NftsResponse
      • NumberRequest
      • NumberResponse
      • RateCryptoRequest
      • RateCryptoResponse
      • ResultEntry
      • RateExchangesRequest
      • RateExchangesResponse
      • ResultEntry
      • RateFiatRequest
      • RateFiatResponse
      • ResultEntry
      • SendJettonRequest
      • SendJettonResponse
      • SendNftRequest
      • SendNftResponse
      • SendRequest
      • SendResponse
      • TeleAuction
      • TeleAuctionConfig
      • TeleAuctionLastBid
      • TeleSale
      • Transaction
      • TransactionsRequest
      • TransactionsResponse
      • UsernameRequest
      • UsernameResponse
      • Version
      • WalletAuth
      • WalletAuth4
      • WalletDetails
      • WalletNewRequest
      • WalletNewResponse
      • WalletsRequest
      • WalletsResponse
      • AddressCollection
      • AddressCollectionsRequest
      • AddressCollectionsResponse
      • AuthBackupRequest
      • AuthDeleteRequest
      • AuthDeleteResponse
      • AuthDoRequest
      • AuthImportRequest
      • AuthJwtResponse
      • AuthListRequest
      • AuthListResponse
      • AuthNewRequest
      • BlockID
      • BurnRequest
      • BurnResponse
      • ChangeAdminRequest
      • ChangeAdminResponse
      • CloseMintRequest
      • CloseMintResponse
      • DetailsAddress
      • DetailsRequest
      • DetailsResponse
      • DomainRequest
      • DomainResponse
      • GiftAttribute
      • GiftRequest
      • GiftResponse
      • ItemRequest
      • ItemResponse
      • Jetton
      • JettonDetails
      • JettonsRequest
      • JettonsResponse
      • Message
      • MintCollectionRequest
      • MintCollectionResponse
      • MintNftRequest
      • MintNftResponse
      • MintRequest
      • MintResponse
      • NftDomainSite
      • NftItem
      • NftItemsRequest
      • NftsRequest
      • NftsResponse
      • NumberRequest
      • NumberResponse
      • RateCryptoRequest
      • RateCryptoResponse
      • RateExchangesRequest
      • RateExchangesResponse
      • RateFiatRequest
      • RateFiatResponse
      • RateJettonPricesRequest
      • RateJettonPricesResponse
      • SendJettonRequest
      • SendJettonResponse
      • SendNftRequest
      • SendNftResponse
      • SendRequest
      • SendResponse
      • TeleAuction
      • TeleAuctionConfig
      • TeleAuctionLastBid
      • TeleSale
      • Transaction
      • TransactionsRequest
      • TransactionsResponse
      • UsernameRequest
      • UsernameResponse
      • Version
      • WalletAuth
      • WalletDetails
      • WalletInfo
      • WalletsRequest
      • WalletsResponse
    • WatchCreateRequest
    • WatchCreateResponse
    • WatchDeleteRequest
    • WatchDeleteResponse
    • WatchEvent
    • WatchLimits
    • WatchListRequest
    • WatchListResponse
    • WatchPollRequest
    • WatchPollResponse
    • WatchSubscription
    • WatchTestRequest
    • WatchTestResponse
    • WatchTx
    • WatchWebhook
  1. v2.Watch

Create watch

POST
/v2.Watch/Create
Tells you when something happens to an address, so you do not have to poll the chain. A watch is
one address; apiton reads it and stores an event for every change. An NFT item (username,
number, .ton domain, gift, any NFT) is watched for its sale and auction, any other address for
its transactions: the server decides which from what is on the chain.
Two ways to receive events, and you can use both:
Poll: read them with a cursor. No server needed. Every event is there for 7 days.
Webhook: give a webhook_url and apiton POSTs each event to your HTTPS endpoint, signed.
Every RPC needs a key: Authorization: Bearer <tg_id>:<secret>. Without one the answer is
unauthenticated. Each RPC costs one request of your plan; webhook deliveries cost none.
A watch of another key answers not_found. While the service is off on the server, every RPC
answers unavailable.
PlanWatchesEach address read everyWebhook pushes per hour
free, premium3180 s10
builder, pro3030 s100
An address is read at the fastest interval among all keys watching it, and one read serves them
all. Premium has free's numbers here, as everywhere in the API; the bot's own Premium limits are
separate. Poll and the hourly cap are per key; the cap is per clock hour (UTC) and applies to
webhook pushes only: events above it are stored all the same, with delivery capped.
When a plan lapses nothing is deleted. The key falls back to free's limits: its oldest 3
watches keep running at 180 s, the others are paused (paused: true in List): they are not
read for you and raise no events until the plan returns or you delete some. A paid plan takes
effect within about two minutes. A paused watch that resumes starts from the state it finds, and
does not report what happened while it was paused. Delete frees a place at once.

Create#

FieldTypeNotes
addressstringany form (raw 0:…, EQ…, UQ…); mainnet only; no .ton names
webhook_urlstringoptional; see the rules below
min_amountnumberoptional, wallet watches, ≥ 0; default 1
curl -X POST https://app.apiton.org/v2.Watch/Create \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 123456789:aB3dE…' \
  -d '{"address":"UQCdqXGvONLwOr3zCNX5FjapflorB6ZsOdcdfLrjsDLt3AF4","webhook_url":"https://example.com/apiton","min_amount":1}'
# {"watch":{"id":"41","address":"UQCdqX…","kind":"wallet","name":"UQCdqX…3AF4","min_amount":1,
#  "poll_interval_seconds":180,"created_at":"2026-11-02T12:00:00Z",
#  "webhook":{"url":"https://example.com/apiton","state":"active"}},
#  "webhook_secret":"whsec_9f2c…","created":true}
webhook_secret is shown once, in this answer. Keep it: it signs your deliveries. It belongs
to this watch and is not your API key.
Watching what the key already watches changes nothing: the answer is the existing watch,
created: false, no secret. To change a webhook_url or min_amount, Delete and Create
again (a new id, a new secret).
History before Create raises nothing: the watch starts from the state it finds.
webhook_url must be https, on port 443 or 8443, on a public host, without user:password, up
to 2048 characters. It is checked at Create and again at every delivery, and the connection goes
only to public addresses resolved at that moment, so a name that later points at a private address
is refused. Redirects are not followed: a 3xx is a failed delivery.
Errors: unauthenticated no key · invalid_argument bad address, testnet address, or a refused
webhook_url (the message says why) · resource_exhausted the plan's watch limit, with what the
next plan gives · failed_precondition a field out of its bounds, or the item was taken down ·
unavailable the chain read failed or the service is off: retry.

Webhook delivery#

A POST with Content-Type: application/json and:
HeaderValue
X-Apiton-Signaturesha256= + hex HMAC-SHA256 of <timestamp>.<body>, keyed with webhook_secret
X-Apiton-TimestampUnix seconds of this attempt
X-Apiton-Event-Idthe event's id
Delivery is at least once. Any 2xx within 5 seconds counts as delivered; the response body is
ignored. If apiton restarts during a delivery, or your 2xx is lost, the event comes again with the
same id: remember the ids you have processed and drop a repeat. Events of one watch go out in
order, and a failure holds back the ones behind it.
Do your work after answering: an endpoint that takes over 5 seconds counts as failed, however the
work ended.
A failed attempt is retried after 1, 5 and 30 minutes, then every 30 minutes. The retries
belong to the webhook, not to the event: while it fails, its other events wait. After about 24
hours
of failures it is paused: its queue is dropped, new events go to Poll only, and nothing
is pushed until a delivered Test. What it missed is in Poll, from your last cursor, for 7 days.
Status and last error are in List.
Verify the signature over the raw request body, as received. Do not parse and re-serialise it:
the JSON's spacing is not stable. Refuse a timestamp far from your clock, so that a captured
request cannot be replayed.
# body.json: the raw body; $TS: X-Apiton-Timestamp; $SECRET: webhook_secret
printf '%s.' "$TS" | cat - body.json | openssl dgst -sha256 -hmac "$SECRET"
# SHA2-256(stdin)= 43a1ae1376fc…  must equal X-Apiton-Signature after "sha256="

Request

Body Params application/jsonRequired

Example
{
    "address": "string",
    "webhook_url": "string",
    "min_amount": "string"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://app.apiton.org/v2.Watch/Create' \
--header 'Content-Type: application/json' \
--data '{
    "address": "string",
    "webhook_url": "string",
    "min_amount": "string"
}'

Responses

🟢200OK
application/json
Bodyapplication/json

Example
{
    "watch": {
        "id": "string",
        "address": "string",
        "kind": "string",
        "name": "string",
        "status": "string",
        "min_amount": "string",
        "paused": true,
        "poll_interval_seconds": 0,
        "created_at": "2019-08-24T14:15:22.123Z",
        "last_polled_at": "2019-08-24T14:15:22.123Z",
        "webhook": {
            "url": "string",
            "state": "string",
            "last_error": "string",
            "pending": 0,
            "last_attempt_at": "2019-08-24T14:15:22.123Z",
            "last_success_at": "2019-08-24T14:15:22.123Z",
            "failing_since": "2019-08-24T14:15:22.123Z",
            "next_attempt_at": "2019-08-24T14:15:22.123Z"
        }
    },
    "webhook_secret": "string",
    "created": true
}
🔴500Server Error
Previous
Close Mint
Next
List watches
Built with