Synq Docs
Management APIToken gates

Change a token gate

Its name, rule, schedule, message, whether it is on, or where it applies. `rule` replaces the whole tree, read from the chain again as on making a gate; `schedule: null` and `refusal_message: null` clear them; `brands` and `apps` each replace their list. The next sign-in or refresh at an app it applies to checks the change. Turning a gate on checks its rule's chains again (400), and needs a chain where the rule reads one (409 `token_gates_unavailable`). Needs `org.tokenGates.edit`. Changing its rule or schedule, turning it on, or naming brands or apps also wants a plan with token gating (403 `plan_feature_unavailable`), so an org that moved to a plan without it can still turn one off, rename it, clear its message, empty its lists or delete it. Recorded as `token_gate.updated`.

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

Its name, rule, schedule, message, whether it is on, or where it applies. rule replaces the whole tree, read from the chain again as on making a gate; schedule: null and refusal_message: null clear them; brands and apps each replace their list. The next sign-in or refresh at an app it applies to checks the change. Turning a gate on checks its rule's chains again (400), and needs a chain where the rule reads one (409 token_gates_unavailable). Needs org.tokenGates.edit. Changing its rule or schedule, turning it on, or naming brands or apps also wants a plan with token gating (403 plan_feature_unavailable), so an org that moved to a plan without it can still turn one off, rename it, clear its message, empty its lists 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
gate*string

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://example.com/v1/orgs/string/token-gates/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "name": "string",  "enabled": true,  "rule": {    "version": 0,    "root": {      "type": "all",      "conditions": [        {          "type": "token",          "chain": "string",          "mint": "string",          "min_amount": "string",          "wallets": "string",          "label": "string",          "display": {            "name": "string",            "symbol": "string",            "decimals": 0,            "image": "string"          }        }      ]    }  },  "schedule": {    "timezone": "string",    "all_day": true,    "starts": "string",    "ends": "string",    "outside": "let_in",    "starts_at": "2019-08-24T14:15:22Z",    "ends_at": "2019-08-24T14:15:22Z",    "state": "string"  },  "refusal_message": "string",  "summary": "string",  "brands": [    "string"  ],  "apps": [    "string"  ],  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}