Make a setup code for npx synqauth init
A code, shown once, that `npx synqauth init --code <code>` sets a Next.js project up with: it adds the project's https loopback addresses to this app and takes a new secret for it, once, within 60 minutes (`POST /v1/setup-codes/redeem`). It is what the dashboard's "Make your Next.js app" shows after onboarding, so init uses the app onboarding made instead of a claimable org. A new code takes the place of the app's last one. For the brand's own web apps that keep a secret and are on (`conflict` otherwise, saying why). Needs `org.apps.edit`, as rotating its secret does, and the same fresh sign-in: A person needs a sign-in at Synq from the last 5 minutes whose time Synq proved (send them to sign in with `max_age=300`), else 403 `fresh_sign_in_required`; an API key never does. The one exception is the app's first new secret, from the sign-in that made it, as onboarding's. Making one changes nothing until it's used, so it records nothing; using it records `app.updated` and `app.secret_rotated` as the person who made it.
/v1/orgs/{org}/brands/{brand}/apps/{app}/setup-codeA code, shown once, that npx synqauth init --code <code> sets a Next.js project up with: it adds the project's https loopback addresses to this app and takes a new secret for it, once, within 60 minutes (POST /v1/setup-codes/redeem). It is what the dashboard's "Make your Next.js app" shows after onboarding, so init uses the app onboarding made instead of a claimable org. A new code takes the place of the app's last one.
For the brand's own web apps that keep a secret and are on (conflict otherwise, saying why). Needs org.apps.edit, as rotating its secret does, and the same fresh sign-in: A person needs a sign-in at Synq from the last 5 minutes whose time Synq proved (send them to sign in with max_age=300), else 403 fresh_sign_in_required; an API key never does. The one exception is the app's first new secret, from the sign-in that made it, as onboarding's. Making one changes nothing until it's used, so it records nothing; using it records app.updated and app.secret_rotated as the person who made it.
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 brand's id
^brd_[0-9a-hjkmnp-tv-z]{26}$The app's client_id: an app_… id, or the URL of the metadata document an app registered itself with
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
curl -X POST "https://api.synq.build/v1/orgs/org_01h455vb4pex5vsknk084sn02q/brands/brd_01h455vb4pex5vsknk084sn02q/apps/app_01h455vb4pex5vsknk084sn02q/setup-code" \ -H "Authorization: Bearer $SYNQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'{ "code": "synq_setup_…", "expires_at": "2026-10-21T12:00:00.000Z"}Rotate an app's secret POST
A new secret, in the response this once. The current one keeps working for `overlap_seconds`, so the app can be redeployed with the new one first. Needs `org.apps.edit`. A person needs a sign-in at Synq from the last 5 minutes whose time Synq proved (send them to sign in with `max_age=300`), else 403 `fresh_sign_in_required`; an API key never does. The one exception is the first new secret of an app the person made since they signed in, which that sign-in was already handed a secret for: onboarding makes the app and shows its secret later. Recorded as `app.secret_rotated`.
Email yourself an app's setup POST
Emails the calling person's own verified address a link to the app's setup on Synq's dashboard, to open on the computer where the app's code is: what the dashboard's "Email me the setup" does on a phone. The email holds the link alone, never a key or a secret: the dashboard shows those after the person signs in. A person only, since an API key has no address. At most 5 an hour for each person. Needs `org.apps.view`.