SynqDocs
Management APIToken gates

Disable a token gate

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`.

POST/v1/orgs/{org}/brands/{brand}/token-gates/{gate}/disable

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.

Authorization

bearer
AuthorizationBearer <token>

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

org*string

The org's id

Match^org_[0-9a-hjkmnp-tv-z]{26}$
brand*string

The brand's id

Match^brd_[0-9a-hjkmnp-tv-z]{26}$
gate*string

The token gate's id

Match^tkg_[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/tkg_01h455vb4pex5vsknk084sn02q/disable" \  -H "Authorization: Bearer $SYNQ_API_KEY" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "tkg_01h455vb4pex5vsknk084sn02q",  "brand": "brd_01h455vb4pex5vsknk084sn02q",  "name": "Acme holders",  "enabled": true,  "rule": {    "version": 1,    "root": {      "type": "all",      "conditions": [        {          "type": "token",          "chain": "solana:mainnet",          "mint": "string",          "min_amount": "string",          "wallets": "combined",          "label": "USDC",          "display": {            "name": "Acme",            "symbol": "string",            "decimals": 0,            "image": "string"          }        }      ]    }  },  "schedule": {    "timezone": "string",    "all_day": true,    "starts": "string",    "ends": "string",    "outside": "let_in",    "starts_at": "2026-10-21T12:00:00.000Z",    "ends_at": "2026-10-21T12:00:00.000Z",    "state": "in_effect"  },  "refusal_message": "string",  "summary": "All of: At least 1,000 USDC; One of (At least 3 NFTs from Mad Lads; The NFT Mad Lad #42)",  "brands": [    "brd_01h455vb4pex5vsknk084sn02q"  ],  "apps": [    "app_01h455vb4pex5vsknk084sn02q"  ],  "discord_roles": [    {      "server": "string",      "server_name": "Mollyverse",      "role": "string",      "role_name": "MDP Holder",      "grace_seconds": 0,      "recheck_seconds": 0,      "existing_members": "verify",      "adopt_by": "2026-10-21T12:00:00.000Z",      "adoption": {        "state": "none",        "verify_by": "2026-10-21T12:00:00.000Z",        "counted": 0,        "unverified": 0,        "member_listing": "full",        "problem": "members_intent",        "problem_detail": "string"      }    }  ],  "telegram_groups": [    {      "group": "string",      "title": "RODAI Holders",      "on_lost": "mute",      "grace_seconds": 0,      "recheck_seconds": 0,      "existing_members": "verify",      "adopt_by": "2026-10-21T12:00:00.000Z",      "adoption": {        "state": "none",        "verify_by": "2026-10-21T12:00:00.000Z",        "counted": 0,        "unverified": 0,        "member_listing": "full",        "problem": "members_intent",        "problem_detail": "string"      }    }  ],  "created_at": "2026-10-21T12:00:00.000Z",  "updated_at": "2026-10-21T12:00:00.000Z"}

Test a token gate or a draft rule POST

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'.

Enable a token gate POST

Turns a token gate on, with its rule, schedule and targets as they are: the next sign-in or refresh at an app it applies to checks it. Its rule's chains are checked again (400), and a rule that reads a chain needs an API that reads one (409 `token_gates_unavailable`). Needs `org.tokenGates.edit` and a plan with token gating (403 `plan_feature_unavailable`). Recorded as `token_gate.updated`.