Test a token gate or a draft rule
Checks a gate (`gate`, one of the brand’s), or a rule not saved yet (`rule`, with an optional `schedule`), against wallets (`wallets`, at most 10 addresses) or a user's wallets in a brand (`user` and `brand`, which on this route is the path’s brand and may be left out), as a sign-in would, at `at` (an ISO time, for the window and the end of every activity condition's days; now when left out), with what was read in the last minute unless `fresh`. Answers what each condition came to, how many reads it cost, and the refusal page's words for it, worded by what the gate does (`goal`: its saved targets, or `brands`, `apps`, `discord_roles` and `telegram_groups` as given). A draft is read from the chain as saving it would read it (400 at the path of what isn't what its condition says, 503 when the chain can't say), so it is tested as the gate it would be. Saves nothing. Wants the org's plan to have token gating (`auth.token_gating`, 403 `plan_feature_unavailable` otherwise), since every test may read the chain through Synq's own key. Needs `org.tokenGates.view`, and `org.users.view` to test a user, which is recorded as `user.token_gate_dry_run` (a test against addresses reads only public chain data, and isn't). Limited per org (`token_gate.dry_runs`), and reads the chain from the org's own budget (`token_gate.org_reads`), never a brand's sign-ins'.
/v1/orgs/{org}/brands/{brand}/token-gates/checkChecks a gate (gate, one of the brand’s), or a rule not saved yet (rule, with an optional schedule), against wallets (wallets, at most 10 addresses) or a user's wallets in a brand (user and brand, which on this route is the path’s brand and may be left out), as a sign-in would, at at (an ISO time, for the window and the end of every activity condition's days; now when left out), with what was read in the last minute unless fresh. Answers what each condition came to, how many reads it cost, and the refusal page's words for it, worded by what the gate does (goal: its saved targets, or brands, apps, discord_roles and telegram_groups as given). A draft is read from the chain as saving it would read it (400 at the path of what isn't what its condition says, 503 when the chain can't say), so it is tested as the gate it would be. Saves nothing. Wants the org's plan to have token gating (auth.token_gating, 403 plan_feature_unavailable otherwise), since every test may read the chain through Synq's own key. Needs org.tokenGates.view, and org.users.view to test a user, which is recorded as user.token_gate_dry_run (a test against addresses reads only public chain data, and isn't). Limited per org (token_gate.dry_runs), and reads the chain from the org's own budget (token_gate.org_reads), never a brand's sign-ins'.
Authorization
bearer An org API key (sk_live_…, sk_test_…), or an access token from the Synq issuer (the synq brand, on the accounts host) for this API.
In: header
Path Parameters
The org's id
^org_[0-9a-hjkmnp-tv-z]{26}$The brand's id
^brd_[0-9a-hjkmnp-tv-z]{26}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.synq.build/v1/orgs/org_01h455vb4pex5vsknk084sn02q/brands/brd_01h455vb4pex5vsknk084sn02q/token-gates/check" \ -H "Authorization: Bearer $SYNQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "gate": "string", "rule": { "version": 1, "root": { "type": "all", "conditions": [ { "type": "token", "chain": "solana:mainnet", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "min_amount": "1000", "wallets": "combined", "label": "USDC", "display": { "name": "Acme", "symbol": "string", "decimals": 0, "image": "string" } } ] } }, "schedule": { "timezone": "America/New_York", "all_day": false, "starts": "2026-10-10T09:00", "ends": "2026-10-10T17:00", "outside": "refuse" }, "wallets": [ "string" ], "user": "string", "brand": "string", "at": "2026-10-21T12:00:00.000Z", "fresh": true, "brands": [ "string" ], "apps": [ "string" ], "discord_roles": [ { "server": "dsv_01h455vb4pex5vsknk084sn02q", "role": "1187390245566001234", "grace_seconds": 86400, "recheck_seconds": 21600, "existing_members": "verify" } ], "telegram_groups": [ { "group": "tgg_01h455vb4pex5vsknk084sn02q", "on_lost": "mute", "grace_seconds": 86400, "recheck_seconds": 21600, "existing_members": "verify" } ] }'{ "result": "refused", "schedule_state": "upcoming", "wallets": [ "string" ], "tree": { "type": "all", "path": "root.conditions.1", "status": "met", "checked": true, "conditions": [ { "type": "token", "path": "root.conditions.1", "status": "met", "checked": true, "held": "250.5", "decimals": 0, "count": 1, "until": "2026-11-21T14:03:12.000Z", "capped": true, "owned": true, "listed": true } ], "until": "2026-11-21T14:03:12.000Z" }, "reads": 0, "cached": 0, "goal": "get Holder in the Acme Discord", "explanation": [ "To get Holder in the Acme Discord, you need all of these:", " At least 1,000 USDC - You hold 250 across your wallets" ]}Change a token gate PATCH
Its name, rule, schedule, message, or where it applies in its brand; turning it on or off is `POST …/enable` and `…/disable`. `rule` replaces the whole tree, read from the chain again as on making a gate; `schedule: null` and `refusal_message: null` clear them; `brands`, `apps`, `discord_roles` and `telegram_groups` each replace their list: a role or group kept on the list keeps its people and takes the new settings, and one taken off stops being managed (whoever holds the role or is in the group keeps it). A gate belongs to one brand: `brands` may name only that brand (every app of it), and `apps`, `discord_roles` and `telegram_groups` only its apps and the servers and groups connected to it (400 at the field otherwise, naming both brands). A gate never moves to another brand: make one there instead. The next sign-in or refresh at an app it applies to checks the change. Needs `org.tokenGates.edit`. Changing its rule or schedule, or naming brands, apps, Discord roles or Telegram groups it didn't have, also wants a plan with token gating (403 `plan_feature_unavailable`), so an org that moved to a plan without it can still rename one, clear its message, empty its lists, turn it off or delete it. Recorded as `token_gate.updated`. Kept for callers of the org's own routes from before gates belonged to a brand: `/v1/orgs/{org}/brands/{brand}/token-gates` does the same within one brand.
Disable a token gate POST
Turns a token gate off: sign-ins no longer check it, and its rule, schedule and targets stay as they are. An org whose plan no longer has token gating can still turn one off. Needs `org.tokenGates.edit`. Recorded as `token_gate.updated`.