Skip to main content
POST
Link a Steam account
The game links the Steam account that runs the game to the player’s game install. The player does not sign in. Call it on https://api.manalens.dev; events.manalens.dev serves only POST /v0/events. The project needs a Steam Web API key and an App ID on the Connect Steam card. Manalens checks the ticket with Steam (ISteamUserAuth/AuthenticateUserTicket) and the project’s key, for the project’s App ID and the identity manalens. The identity is fixed: a ticket made for another service is refused. Then it reads once which of your apps the account owns (ISteamUser/GetPublisherAppOwnership). See Steam ownership.

Authentication

Send the project’s publishable key in X-Publishable-Key, as for events. A game server can send the secret key in Authorization: Bearer mana_sk_... instead. The publishable key checks apply: a web build must run on the project domain or an allowed origin. A game sends no origin.

Body

Other fields are ignored. The ticket must come from GetAuthTicketForWebApi("manalens"). A verified link binds the Steam account to the game install that made the ticket. It does not make the player identified: the player’s user ID comes from identify, as before.

Responses

Errors use the error format: { "error": { "code": "...", "message": "..." } }. When Steam accepts the ticket but the ownership read fails, the link is saved and the call still returns 200. Ownership is read at the next link.

SDK call

Each SDK has the call. The SDK sends the ticket as hex with the anonymous ID, after consent. It does not send a refused ticket again, and tries once more only after a 429 with Retry-After. Call it once after Steam starts, for example on the main menu. A new ticket for each call is fine. Do not send a SteamID that the game reads by itself: only a ticket proves the account. Without an SDK, send the request yourself:

Authorizations

X-Publishable-Key
string
header
required

The publishable key (mana_pk_...). It sends web and app events and links Steam accounts.

Body

application/json

Fields that are not in this list are ignored.

provider
string
required

The store. Only steam today.

Allowed value: "steam"
ticket
string
required

The bytes of the Steam ticket from GetAuthTicketForWebApi("manalens"), as a hex string: 32 to 4096 hex characters, an even number

Pattern: ^(?:[0-9a-fA-F]{2}){16,2048}$
anonymous_id
string
required

The SDK anonymous ID of this game install (a UUID)

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
user_id
string

Secret key only (a game server): the user ID to store with the link. With the publishable key it is checked but not stored. A stored user ID is never replaced.

Required string length: 1 - 255
Pattern: ^[^\u0000-\u001f]+$

Response

Steam accepted the ticket and the link is saved

linked
boolean
required
provider
string
required
Allowed value: "steam"