Claim a claimable org into an org you have, as a brand
The other way to claim what `npx synqauth init` made: instead of becoming an org of its own, its brand joins `org`, an org the caller owns or is an admin of, as a new brand, with its apps, keys and users. Its id, issuer, client ids, secrets and signing keys stay the same, so the app's `.env.local` keeps working and its users stay signed in; its development limits go, and the org's plan's apply. The development org, left with no brand, closes: deleted, and purged 30 days on. `POST /v1/claimable-orgs/lookup` lists the orgs it can join (`into_orgs`). A person only, the org's owner or an admin (`forbidden` otherwise; an org they aren't a member of is `not_found`), with the claim token, and with room under the org's plan for another brand (`plan_quota_exceeded`, naming the org, its plan and the one with room). 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 token works once: a used or expired one is `not_found`. Recorded in the org's log as `brand.claimed` (from `npx synqauth init`), also the event of its All brands endpoints, and in the development org's as `org.deleted` (`reason: claimed_into_org`).
/v1/claimable-orgs/claim-intoThe other way to claim what npx synqauth init made: instead of becoming an org of its own, its brand joins org, an org the caller owns or is an admin of, as a new brand, with its apps, keys and users. Its id, issuer, client ids, secrets and signing keys stay the same, so the app's .env.local keeps working and its users stay signed in; its development limits go, and the org's plan's apply. The development org, left with no brand, closes: deleted, and purged 30 days on. POST /v1/claimable-orgs/lookup lists the orgs it can join (into_orgs).
A person only, the org's owner or an admin (forbidden otherwise; an org they aren't a member of is not_found), with the claim token, and with room under the org's plan for another brand (plan_quota_exceeded, naming the org, its plan and the one with room). 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 token works once: a used or expired one is not_found. Recorded in the org's log as brand.claimed (from npx synqauth init), also the event of its All brands endpoints, and in the development org's as org.deleted (reason: claimed_into_org).
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
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
application/problem+json
curl -X POST "https://api.synq.build/v1/claimable-orgs/claim-into" \ -H "Authorization: Bearer $SYNQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "claim_token": "synq_claim_…", "org": "org_01h455vb4pex5vsknk084sn02q" }'{ "org": { "id": "org_01h455vb4pex5vsknk084sn02q", "slug": "acme", "name": "Acme" }, "brand": { "id": "brd_01h455vb4pex5vsknk084sn02q", "name": "acme-web", "issuer_slug": "dev-k3v9q2m7xa", "issuer": "https://dev-k3v9q2m7xa.auth.synq.build", "is_default": false }, "development_org": { "id": "org_01h455vb4pex5vsknk084sn02r", "slug": "dev-k3v9q2m7xa" }}Make a brand POST
A new user pool with its own issuer. The org's own apps at sign-in providers sign it in too, so each must register its callback: `warnings` says so (`org_provider_apps_need_redirect_uri`), naming each. Needs `org.brands.edit`, and room under the org's plan (403 `plan_quota_exceeded`, naming the plan that has room in `required_plan`). A brand deleted in the last 30 days still takes its place: its issuer slug is held until it's purged. Recorded as `brand.created`.
Claim a claimable org POST
Makes the caller the owner of the org a claim token names: from then on it is an org like any other, on its plan's limits, and its sign-in pages no longer say it is unclaimed. Like making an org, it wants a person with a verified email address (`email_unverified`), where Synq takes tenants from them (`org_creation_closed`), owning fewer free orgs than one person may (`org_quota_exceeded`; orgs on a paid plan don't count). The token works once. Recorded as `org.claimed`. To add it to an org the caller has instead, as a brand, `POST /v1/claimable-orgs/claim-into`.