Create a launch code

Mint a one-time launch code for one of your users from your backend, for apps whose backend can't sign diner tokens.

POST/api/v1/sdk/launch-codesServer API · secret key

For a backend that can't sign diner tokens: ask Tamr for a one-time code for one of your users, and your app returns it from its identity provider as a code. A code lasts 5 minutes and works once. branch and locale are hints; an unknown branch is refused.

Authentication

Server API. Send a secret API key with the Diner sessions (SDK) permission (diner:sdk) as Authorization: Bearer <key>. Secret keys are made in Settings > API keys by an owner or admin. Keep them on your server: no browser can call this route.

Request body

FieldTypeRequiredDescription
externalUserIdstringYes1 to 200 characters.
branchstringNoAn address: lower-case letters, digits and dashes.
localestringNoA language tag, such as ar or en-GB.

Response

FieldTypeDescription
codestring1 to 200 characters.
expiresAtstring (date-time)

Example

curl https://tamr.link/api/v1/sdk/launch-codes \
  -H "Authorization: Bearer $TAMR_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{
  "externalUserId": "user-88213",
  "branch": "achrafieh"
}'

Example response

{
  "code": "lc_9f2c1b7a4e",
  "expiresAt": "2026-10-23T12:05:00Z"
}

Errors

Every error has the same body; switch on data.code. See Errors and rate limits.

data.codeStatusWhat to do
other401No secret key, or one Tamr doesn't accept: wrong, revoked, or made by someone who is no longer an owner or admin.
other403The key doesn't have the diner:sdk permission.
invalid_request400A field doesn't match the spec. The message says which.
rate_limited429Wait retryAfter seconds (also in the Retry-After header), then try again.
sdk_disabled403The SDK isn't switched on for this restaurant. Ask Tamr.