SynqDocs
Management APIApps

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.

POST/v1/orgs/{org}/brands/{brand}/apps/{app}/setup-code

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.

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}$
app*string

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"}