Skip to main content

Write Endpoints

All paths are relative to https://api.clocktower.finance.

All write endpoints use POST. The server returns unsigned transactions — you sign and broadcast from your wallet. The server never relays signed transactions.

Prepare, readiness, and POST /transactions/status accept optional ?chainId= (query string, not JSON body). Simulation and gas estimation run on the selected chain. See Chain selection.

Prepare response format

Full prepare responses include:

FieldDescription
requestIdCorrelation UUID for support (not stored server-side)
instructionsOrdered steps for signing and broadcasting
warningsNon-fatal hints (e.g. remit may need multiple txs)
unsignedTransactionsCalldata: to, data, value, chainId, from
signingModeraw (single tx) or eip5792 (multi-tx batch)
eip5792Batch descriptor when signingMode is eip5792
simulationOn-chain simulation results. Failed simulation returns an error before unsigned transactions are returned
chainIdSelected REST chain (default 8453)
gasEstimatesPer-tx gas budget on the selected chain
gasSummaryAggregated totals; remit backlogs include backlogMultiplier
preflightOperation-specific context

Optional request fields

On prepare endpoints:

  • readinessOnly: true — preflight only; no unsigned transactions or gas estimates
  • simulateFromAddress — address for eth_estimateGas when signing wallet differs from broadcaster
  • infiniteApproval: true — on subscribe, request max ERC-20 allowance instead of amount-scoped approve

Preferred by-id routes

When you already have a subscription id, prefer id-only endpoints (chain is source of truth for amount/token/provider):

EndpointDescription
POST /check_subscribe_readiness_by_idReadiness with from + id
POST /prepare/subscribe_by_idPrepare subscribe with from + id
POST /prepare/cancel_subscription_by_idProvider cancel with from + id
POST /prepare/unsubscribe_by_idSubscriber unsubscribe with from + id
POST /prepare/unsubscribe_by_provider_by_idProvider remove with from + id + subscriber

Endpoints

POST /prepare/* plus POST /check_subscribe_readiness and POST /check_remit_readiness share the write rate bucket (RPM + write daily). REST POST /check_subscribe_readiness_by_id uses the cheap/global bucket; the MCP tool of the same name uses the write/readiness bucket. Defaults:

LaneWrite RPMWrite / prepare daily
Free2/min20/day
Developer5/min100/day
EndpointDescription
POST /check_subscribe_readinessValidate whether an account can subscribe (object form)
POST /check_subscribe_readiness_by_idSame by id (preferred when id known)
POST /prepare/create_subscriptionPrepare a new subscription (amount = human token string, e.g. "10")
POST /prepare/subscribePrepare subscribe (object form; includes ERC-20 approve when needed)
POST /prepare/subscribe_by_idPrepare subscribe by id (preferred)
POST /prepare/cancel_subscriptionProvider cancel
POST /prepare/cancel_subscription_by_idProvider cancel by id (preferred)
POST /prepare/unsubscribeSubscriber unsubscribe
POST /prepare/unsubscribe_by_idSubscriber unsubscribe by id (preferred)
POST /prepare/unsubscribe_by_providerProvider-initiated unsubscribe
POST /prepare/unsubscribe_by_provider_by_idProvider-initiated by id (preferred)
POST /prepare/edit_detailsProvider metadata edit
POST /check_remit_readinessMulti-day scan before remit()
POST /prepare/remitPrepare permissionless remit()
POST /transactions/statusPoll confirmation after broadcast ({ "txHash": "0x…" })

See Rate limits.

Remit flow

check_remit_readiness → prepare_remit → sign → broadcast → repeat until caught up

One remit() clears at most maxRemits payments per transaction. Use get_subscriptions_due for a lightweight single-day read; use check_remit_readiness before preparing remit.

See Remit caller workflow.