SynqDocs
Management APIBrands

Redeem a link code

Says who the person who opened your service's deep link is there, for the link code in it: your bot got `/start <code>` from Telegram's user 987654321, say. The code works once, for 10 minutes, for the provider it was made for (422 `link_code_invalid` otherwise, whichever it is); an account someone has linked there already is 409 `identity_in_use`, and leaves the code unspent. The identity then waits, pending, for the person to confirm it in the app that made the code, for 10 minutes: until then it links nothing, signs nobody in and gets no sign-in link, so tell them to go back to the app. The code goes in the body, never the URL. Only an org API key, from a server: a person's access token, the dashboard's included, or a request with an `Origin` or `Sec-Fetch-Site` header (a browser's) is 403 `server_only`. Limited per org (`app_links.org`). Needs `org.users.identities.edit`. Recorded as `user.identity_pending`.

POST/v1/orgs/{org}/brands/{brand}/link-codes/redeem

Says who the person who opened your service's deep link is there, for the link code in it: your bot got /start <code> from Telegram's user 987654321, say. The code works once, for 10 minutes, for the provider it was made for (422 link_code_invalid otherwise, whichever it is); an account someone has linked there already is 409 identity_in_use, and leaves the code unspent. The identity then waits, pending, for the person to confirm it in the app that made the code, for 10 minutes: until then it links nothing, signs nobody in and gets no sign-in link, so tell them to go back to the app. The code goes in the body, never the URL. Only an org API key, from a server: a person's access token, the dashboard's included, or a request with an Origin or Sec-Fetch-Site header (a browser's) is 403 server_only. Limited per org (app_links.org). Needs org.users.identities.edit. Recorded as user.identity_pending.

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

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

curl -X POST "https://api.synq.build/v1/orgs/org_01h455vb4pex5vsknk084sn02q/brands/brd_01h455vb4pex5vsknk084sn02q/link-codes/redeem" \  -H "Authorization: Bearer $SYNQ_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "code": "q2V0ZXJzLWV4YW1wbGUtY29kZS1vbmx5LTAxMjM0NTY",    "provider": "custom-acme-telegram",    "subject": "987654321",    "handle": "ada",    "name": "Ada Lovelace",    "picture": "string"  }'
{  "identity": "idn_01h455vb4pex5vsknk084sn02q",  "user": "usr_01h455vb4pex5vsknk084sn02q",  "provider": "custom-acme-telegram",  "subject": "987654321",  "expires_at": "2026-10-21T12:00:00.000Z"}