Create a watchlist entry
https://api.triport.io/v1/sol/watchlistRegister a Solana account (pubkey) to be watched and have changes delivered to a webhook or WebSocket push channel.
A watchlist entry subscribes Triport to on-chain changes for a single Solana
account and forwards every observed change to a delivery target you control.
When the watched account's data changes at the requested commitment level,
Triport pushes an event either to your HTTPS webhook (callback_type: webhook)
or over the live WebSocket channel (callback_type: ws).
Use this endpoint to build account-change notifications without holding an open
subscription yourself — Triport maintains the upstream subscription and the
delivery fan-out on your behalf. Each call creates one entry for one
pubkey; call it repeatedly to watch multiple accounts. The created entry is
scoped to your tenant (derived from the authenticated API key) and is returned
with a server-generated id you use to fetch or delete it later.
Gotchas:
callback_type: telegramis reserved and not yet accepted — sending it returns400 invalid_params.- For
callback_type: ws, thecallback_urlis treated as a client-side identifier (the channel to associate the entry with), not an HTTP destination. Events are delivered over the live WebSocket channel rather than pushed to a URL. commitmentdefaults toconfirmedwhen omitted.
Parameters
This endpoint takes a JSON request body (Content-Type: application/json).
pubkeystring (base58, 32–44 chars)requiredcallback_typestring enum: webhook | wsrequiredtelegram is reserved → 400.callback_urlstring (URI)optionalwebhook; client-side channel identifier for ws. *Required in practice for both delivery types.commitmentstring enum: processed | confirmed | finalizedoptionalconfirmed.Response
201 Created
idstring (UUID)GET/DELETE /v1/sol/watchlist/{id}.tenant_idstringcreated_atstring (date-time)pubkeystringcallback_typestringwebhook or ws).callback_urlstring (URI)commitmentstringconfirmed).Errors
| Code | Meaning | When it happens |
|---|---|---|
400 | invalid_params | Missing/invalid pubkey or callback_type, malformed callback_url, or callback_type: telegram (reserved). |
401 | unauthorized / trial_expired / subscription_expired | Missing, invalid, or expired credentials. |
403 | tier_insufficient / method_unknown | API key tier below Business, or key lacks the sol_watchlist scope. |
429 | rate_limited | Sustained RPS for your tier exceeded (burst is 2× the sustained limit). |
All errors use the shared error envelope (error, message, request_id). See
errors for the full schema, the 403 tier-upgrade fields, and
the 429 Retry-After / X-RateLimit-* headers.
Example 403:
{
"error": "tier_insufficient",
"message": "sol_watchlist requires the business tier",
"request_id": "req_9c1f7a",
"current_tier": "pro",
"required_tier": "business",
"category": "sol_watchlist"
}Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/sol/watchlist", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
pubkey: "So11111111111111111111111111111111111111112",
callback_type: "webhook",
callback_url: "https://hooks.example.com/sol/account-change",
commitment: "confirmed",
}),
});
if (!res.ok) throw new Error(`watchlist create failed: ${res.status}`);
const entry = await res.json();
console.log(entry.id); // 8f1d6c2a-...TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const entry = await client.sol.watchlist.create({
pubkey: "So11111111111111111111111111111111111111112",
callbackType: "webhook",
callbackUrl: "https://hooks.example.com/sol/account-change",
commitment: "confirmed",
});
console.log(entry.id, entry.createdAt);Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
entry = client.sol.watchlist.create(
pubkey="So11111111111111111111111111111111111111112",
callback_type="webhook",
callback_url="https://hooks.example.com/sol/account-change",
commitment="confirmed",
)
print(entry.id, entry.created_at)Notes
- Manage entries: list all of your entries with
GET /v1/sol/watchlist, fetch one withGET /v1/sol/watchlist/{id}, and remove one withDELETE /v1/sol/watchlist/{id}(idempotent — a repeat delete returns404). - Capacity: the Business tier allows up to 10,000 watched pubkeys per tenant. Creating beyond your cap is rejected.
- WebSocket delivery: when
callback_typeisws, connect to the live watchlist push channel to receive events for entries created under your key; the entry'scallback_urlties the entry to your channel. - Commitment trade-off:
processedis fastest but may be rolled back;finalizedis safest but lags.confirmed(the default) balances the two.