Nakama Authentication API

Authenticate users and issue or refresh session tokens.

Operations 4

POST /v2/account/authenticate/device Authenticate a user with a device id against the server #
POST /v2/account/authenticate/email Authenticate a user with an email and password against the server #
POST /v2/account/authenticate/custom Authenticate a user with a custom id against the server #
POST /v2/account/session/refresh Refresh a user's session using a refresh token retrieved from a previous… #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nakama-authentication-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nakama-authentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nakama Authentication API
  description: Representative OpenAPI description of the core REST API for Nakama, the open-source game and app backend server by Heroic Labs.
  termsOfService: https://heroiclabs.com/terms/
  contact:
    name: Heroic Labs
    url: https://heroiclabs.com/
    email: support@heroiclabs.com
  license:
    name: Apache 2.0
    url: https://github.com/heroiclabs/nakama/blob/master/LICENSE
  version: '2.0'
servers:
- url: http://127.0.0.1:7350
  description: Default self-hosted Nakama server. Replace host/port with your Heroic Cloud project URL in production.
security:
- BearerAuth: []
tags:
- name: Authentication
  description: Authenticate users and issue or refresh session tokens.
paths:
  /v2/account/authenticate/device:
    post:
      operationId: authenticateDevice
      tags:
      - Authentication
      summary: Authenticate a user with a device id against the server
      security:
      - BasicAuth: []
      parameters:
      - in: query
        name: create
        schema:
          type: boolean
        description: Register the account if the user does not already exist.
      - in: query
        name: username
        schema:
          type: string
        description: Set the username on the account at register. Ignored if the account exists.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticateDeviceRequest'
      responses:
        '200':
          description: A session with the current session token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
  /v2/account/authenticate/email:
    post:
      operationId: authenticateEmail
      tags:
      - Authentication
      summary: Authenticate a user with an email and password against the server
      security:
      - BasicAuth: []
      parameters:
      - in: query
        name: create
        schema:
          type: boolean
      - in: query
        name: username
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticateEmailRequest'
      responses:
        '200':
          description: A session with the current session token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
  /v2/account/authenticate/custom:
    post:
      operationId: authenticateCustom
      tags:
      - Authentication
      summary: Authenticate a user with a custom id against the server
      security:
      - BasicAuth: []
      parameters:
      - in: query
        name: create
        schema:
          type: boolean
      - in: query
        name: username
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticateCustomRequest'
      responses:
        '200':
          description: A session with the current session token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
  /v2/account/session/refresh:
    post:
      operationId: sessionRefresh
      tags:
      - Authentication
      summary: Refresh a user's session using a refresh token retrieved from a previous…
      security:
      - BasicAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionRefreshRequest'
      responses:
        '200':
          description: A session with a new session token and refresh token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
components:
  schemas:
    SessionRefreshRequest:
      type: object
      properties:
        token:
          type: string
          description: Refresh token.
        vars:
          type: object
          additionalProperties:
            type: string
          description: Extra information passed to the identity providers.
    AccountDevice:
      type: object
      description: Send a device to the server. Used with authenticate/link/unlink and register.
      required:
      - id
      properties:
        id:
          type: string
          description: A device identifier. Must be between 10 and 128 bytes.
        vars:
          type: object
          additionalProperties:
            type: string
          description: Extra information stored on the session.
    AuthenticateEmailRequest:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/AccountEmail'
        create:
          type: boolean
        username:
          type: string
    AccountCustom:
      type: object
      description: Send a custom id to the server.
      required:
      - id
      properties:
        id:
          type: string
          description: A custom identifier. Must be between 6 and 128 bytes.
        vars:
          type: object
          additionalProperties:
            type: string
    AccountEmail:
      type: object
      description: Send an email with password to the server.
      required:
      - email
      - password
      properties:
        email:
          type: string
          description: A valid RFC-5322 email address.
        password:
          type: string
          description: A password, at least 8 characters long.
        vars:
          type: object
          additionalProperties:
            type: string
    Session:
      type: object
      description: A user's session used to authenticate messages.
      properties:
        created:
          type: boolean
          description: True if the corresponding account was just created, false otherwise.
        token:
          type: string
          description: Authentication credentials (JWT session token).
        refresh_token:
          type: string
          description: Refresh token that can be used to renew a session.
    AuthenticateCustomRequest:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/AccountCustom'
        create:
          type: boolean
        username:
          type: string
    AuthenticateDeviceRequest:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/AccountDevice'
        create:
          type: boolean
        username:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth using the server key as the username and an empty password. Guards the authenticate endpoints.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'The JWT session token returned by an authenticate call, sent as `Authorization: Bearer <session_token>`.'
externalDocs:
  description: Nakama documentation
  url: https://heroiclabs.com/docs/nakama/