SynqDocs
Management APIToken gates

Change a token gate

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

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

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.

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 PATCH "https://api.synq.build/v1/orgs/org_01h455vb4pex5vsknk084sn02q/brands/brd_01h455vb4pex5vsknk084sn02q/token-gates/tkg_01h455vb4pex5vsknk084sn02q" \  -H "Authorization: Bearer $SYNQ_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "Acme",    "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"    },    "refusal_message": "Acme Club is for holders of the Acme pass. Get one at acme.example/pass.",    "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"      }    ]  }'
{  "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"}

List an org's token gates GET

Every gate of every brand of the org, on or off, with its brand and where it applies. 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. Needs `org.tokenGates.view`.

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.