Set up a Discord role's window
Saves what is sent and keeps the rest: before announcing, any setting; after, only quiet hours, `name_unverified` and `headline` (409 for the rest: the deadline moves only later, with extend). What its messages call the brand’s members is the brand’s, `members_called` on `PATCH /v1/orgs/{org}/brands/{brand}/community-messages`. Answers the window with its schedule for these settings. A gate must give the role with `existing_members: verify` (409 otherwise, with the fix). Needs `org.integrations.edit`. A change after announcing is recorded as `discord_role.window_updated`.
/v1/orgs/{org}/discord-servers/{server}/roles/{role}/windowSaves what is sent and keeps the rest: before announcing, any setting; after, only quiet hours, name_unverified and headline (409 for the rest: the deadline moves only later, with extend). What its messages call the brand’s members is the brand’s, members_called on PATCH /v1/orgs/{org}/brands/{brand}/community-messages. Answers the window with its schedule for these settings. A gate must give the role with existing_members: verify (409 otherwise, with the fix). Needs org.integrations.edit. A change after announcing is recorded as discord_role.window_updated.
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 Discord server's id
^dsv_[0-9a-hjkmnp-tv-z]{26}$The gated role's Discord id
^[1-9][0-9]{16,19}$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
curl -X PUT "https://api.synq.build/v1/orgs/org_01h455vb4pex5vsknk084sn02q/discord-servers/dsv_01h455vb4pex5vsknk084sn02q/roles/1187390245566009876/window" \ -H "Authorization: Bearer $SYNQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "notice_days": 365, "deadline_time": "18:00", "time_zone": "America/New_York", "quiet_hours": { "from": "22:00", "to": "09:00" }, "name_unverified": true, "headline": "Token gate: ROD.AI is becoming a home for holders and users of our products." }'{ "server": "string", "role": "string", "role_name": "string", "state": "draft", "notice_days": 0, "deadline_time": "string", "time_zone": "string", "quiet_hours": { "from": "string", "to": "string" }, "name_unverified": true, "headline": "string", "verify_channel": "string", "listing": true, "starts_at": "2026-10-21T12:00:00.000Z", "ends_at": "2026-10-21T12:00:00.000Z", "paused_at": "2026-10-21T12:00:00.000Z", "extended_at": "2026-10-21T12:00:00.000Z", "closed_at": "2026-10-21T12:00:00.000Z", "schedule": [ { "reminder": "m1", "kind": "monthly", "at": "2026-10-21T12:00:00.000Z", "names": true, "done": true } ], "counts": { "holders": 0, "verified": 0, "to_verify": 0, "settled": 0 }, "problem": "members_unknown", "problem_detail": "string", "announce_queued_at": "2026-10-21T12:00:00.000Z", "announce_failure": "string"}Make a role POST
Any subset of the permission catalog, at most the caller's own. Needs `org.members.edit`. Recorded as `role.created`.
Set a project up with a setup code POST
What `npx synqauth init --code <code>` calls, with no credential but the code (`POST …/apps/{app}/setup-code` made it): the app gets the project's https loopback redirect and post-logout URIs it lacks (`app.updated`), up to the 20 an app holds, and a new secret (`app.secret_rotated`), both recorded as the person who made the code. The secret it had keeps working for a day, as a rotation's does. The answer is the brand's issuer and the app's keys, for the project's `.env.local`, this once. The code works once, within 60 minutes, and only while whoever made it may still change the app: a used, expired or unknown one, one whose app, brand or org is gone or disabled, or one whose maker left the org, was removed, lost `org.apps.edit` or had their sessions there ended (an API key: was revoked or expired) is `not_found`. An app that can't be set up now (not a web app with a secret, not the brand's own, turned off) is `conflict`, and the code stays unused.