Set a project up with a setup code
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.
/v1/setup-codes/redeemWhat 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.
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
curl -X POST "https://api.synq.build/v1/setup-codes/redeem" \ -H "Authorization: Bearer $SYNQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "code": "synq_setup_…", "redirect_uris": [ "https://localhost:3000/api/auth/callback" ], "post_logout_redirect_uris": [] }'{ "org": { "id": "org_01h455vb4pex5vsknk084sn02q", "slug": "acme", "name": "Acme" }, "brand": { "id": "string", "name": "Acme" }, "issuer": "https://acme.auth.synq.build", "app": { "client_id": "app_01h455vb4pex5vsknk084sn02q", "client_secret": "string", "name": "Acme", "redirect_uris": [ "https://app.acme.example" ] }}Set up a Discord role's window PUT
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`.
Forget a brand’s own app at a sign-in provider DELETE
The brand signs in through the org’s app, else Synq’s. Recorded as `org.updated` (or `brand.updated`). Needs `org.connections.edit`.