Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.offthehook.dev/llms.txt

Use this file to discover all available pages before exploring further.

PATCH is the recommended way to modify specific addresses without touching the rest of the subscription’s filter list. You can add and remove addresses in a single atomic request — if the operation fails, no partial changes are applied. The response includes a per-item breakdown so you know exactly what happened to each address you submitted.

Request

PATCH /v1/subscriptions/:id/filters/addresses

Path parameters

id
string
required
The subscription ID (e.g. sub_2QkP9aB7xN...).

Body

add
array
Address objects to add to the subscription’s filter list. Each object must include chainId and address. At least one of add or remove should be non-empty.
remove
array
Address objects to remove from the subscription’s filter list. Same shape as add. Items that are not currently in the subscription are returned in results.skipped with reason: "not_found".
curl -X PATCH https://api.offthehook.dev/v1/subscriptions/sub_2QkP9aB7xN.../filters/addresses \
  -H "Authorization: Bearer oth_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "add": [
      { "chainId": "tron:mainnet", "address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy" },
      { "chainId": "tron:nile", "address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy" }
    ],
    "remove": [
      { "chainId": "tron:mainnet", "address": "TOldAddress..." }
    ]
  }'

Response

200 OKPatchAddressesResponse containing the updated subscription and a per-item result breakdown.
{
  "subscription": {
    "id": "sub_2QkP9aB7xN...",
    "filters": {
      "addresses": [
        { "chainId": "tron:mainnet", "address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy" }
      ]
    }
  },
  "results": {
    "added": [
      { "chainId": "tron:mainnet", "address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy" }
    ],
    "removed": [],
    "skipped": [
      {
        "input": { "chainId": "tron:mainnet", "address": "TOldAddress..." },
        "reason": "not_found",
        "detail": "address not in subscription"
      }
    ]
  }
}
subscription
object
The full updated subscription resource, reflecting the state after the patch has been applied.
results.added
array
Address objects that were successfully added.
results.removed
array
Address objects that were successfully removed.
results.skipped
array
Address objects that could not be processed. Each skipped item includes the original input, a reason code (not_found, invalid_address, invalid_chain, chain_not_enabled), and an optional detail string with a human-readable explanation.

Errors

CodeHTTPDescription
not_found404The subscription ID does not exist or belongs to a different API key.
invalid_address400One or more addresses failed base58check validation.
invalid_chain400One or more chainId values are not recognized.
chain_not_enabled400The chainId is valid but not currently enabled on this account.
addresses_limit_exceeded400The add or remove array exceeds the per-request size limit.
unauthorized401The Authorization header is missing or the key is invalid.