Link a player to their Lingara account
API version 2026-10-virile-dragon
Links one of your players to the Lingara account that just granted your app access. Call it with the delegated token your server received for that account, never with your client's own token. From then on the player's tokens act as the account, as far as the grant allows: ask for events:read or you hear nothing about the player after the link. Settled plans move to the account; a plan still being written stays until you call again. Safe to repeat: a repeat answers existing and moves what could not move before. Linking costs you nothing.
Scopes embed:play
Parameters
Lingara-Versionheaderstringoptional- The API version to answer this request under. Without it, an access token gets the version its client is pinned to, and a request with no token gets the current version. The version still in development is reached only by naming it here. An unknown version answers
400with codeapi_version_unknown.GET /v1/versionslists the versions. player_refpathstringrequired- The
player_refyou minted the player's tokens with, percent-encoded:guild/42isguild%2F42.
Responses
200 The player's link
statusLinkStatusrequiredsubjectstringrequiredThe account's
lgr_sub_: what this player's events carry from now on.previous_subjectstringrequiredThe guest's
lgr_sub_: what the player's earlier events keep. Route both to the sameplayer_ref.linked_atstringrequiredWhen the link was made. On an
existinganswer, the first call's time.scopesarray of stringrequiredThe most a token for this player can now hold: what the account granted, of the scopes a player's token can carry.
carriedobjectrequiredRows this call moved to the account, per table. Only tables with a count appear.
keptobjectrequiredRows this call left with the guest, per table: a plan still being written, or a row the account already had. Call again once
lesson_planshere has a plan that has finished.
Errors
402application/json- A metered client's call was refused before it spent anything.
spend_cap_reached: the client or its account has reached its monthly spending limit; raise the limit on the Integrations page.metered_billing_inactive: usage billing is not active for this account; set it up, or update the payment method, on the Integrations page. 410application/json- The API version this request is answered under has been discontinued. Send a supported version in
Lingara-Version, or re-pin the client. 4XXapplication/json- The request was refused.
codesays why, anderrorsays it in words. 503application/json · text/plain- The service is temporarily unavailable; retry after the number of seconds in
Retry-After. During maintenance the body is plain text rather than the error envelope. 5XXapplication/json- The request was refused.
codesays why, anderrorsays it in words.
codestringrequiredWhy the request was refused, as a stable code to branch on: for example
insufficient_scope(403),rate_limited(429) and, for a metered client,spend_cap_reached(402) andmetered_billing_inactive(402).errorstringrequired
Example
curl -X PUT "https://api.getlingara.com/v1/embed/players/$PLAYER_REF/link" \
-H "Authorization: Bearer $LINGARA_TOKEN"