Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Nakama Realtime Socket API

Persistent WebSocket connection carrying realtime features - status presence, realtime chat channels, relayed and authoritative multiplayer matches, matchmaking, parties, and realtime notification delivery - as envelope messages authenticated with a session token supplied as a query parameter on connect.

Nakama Realtime Socket API is one of 11 APIs that Nakama publishes on the APIs.io network, described by an AsyncAPI event-driven specification.

Tagged areas include Realtime, WebSocket, Multiplayer, Matchmaking, and Chat. The published artifact set on APIs.io includes API documentation and an AsyncAPI specification.

This event API exposes 2 operations across 1 channel, and defines 31 schemas. It is described by AsyncAPI 2.6.0, at version 1.0.0.

The API connects through a single server, 127.0.0.1:7350 (ws).

2 operations 1 channels 31 schemas

Metadata

The identity and technical contract details declared by the specification.

Specification
AsyncAPI 2.6.0
API Version
1.0.0
Base URL
ws://127.0.0.1:7350/ws
License
Resource Areas
1

Channels & Operations 2

Across 1 channel, the API surfaces 2 operations. Each is listed below with its action, channel, parameters, and response codes.

Channels 2
SUB
/ws
Server-to-client realtime messages.
receiveEnvelope body
PUB
/ws
Client-to-server realtime messages.
sendEnvelope body

Messages & Schemas 31

The contract defines 31 schemas that model the data carried by its messages. The most detailed are Presence (5 properties), EnvelopeMatch (2 properties), EnvelopeChannel (2 properties), EnvelopeStatusUpdate (2 properties). Each schema is shown below with its type and property counts.

ChannelJoin
message
Client request to join a chat channel (room, direct message, or group).
ChannelMessageSend
message
Client request to send a message to a joined channel.
MatchCreate
message
Client request to create a new client-relayed multiplayer match.
MatchJoin
message
Client request to join a match by id or by matchmaker token.
MatchDataSend
message
Client sends an opcode-tagged data frame to all or some match participants.
MatchmakerAdd
message
Client request to enter the matchmaking pool with a query and constraints.
StatusUpdate
message
Client updates its presence status string.
Channel
message
Server reply describing a joined chat channel.
ChannelMessage
message
Server-initiated delivery of a message on a joined channel.
Match
message
Server reply describing a created or joined match, including presences.
MatchData
message
Server-initiated delivery of an opcode-tagged data frame from a match participant.
MatchmakerMatched
message
Server-initiated notification that a suitable set of opponents was found.
StatusPresenceEvent
message
Server-initiated event describing users who came online or went offline.
Notifications
message
Server-initiated delivery of one or more in-app notifications.
Error
message
Server error envelope, echoing the cid of the failed request when applicable.
Presence
object
A realtime presence for a user in a match, channel, or status feed.
5 properties
EnvelopeChannelJoin
object
2 properties
EnvelopeChannelMessageSend
object
2 properties
EnvelopeMatchCreate
object
2 properties
EnvelopeMatchJoin
object
2 properties
EnvelopeMatchDataSend
object
1 property
EnvelopeMatchmakerAdd
object
2 properties
EnvelopeStatusUpdate
object
2 properties
EnvelopeChannel
object
2 properties
EnvelopeChannelMessage
object
1 property
EnvelopeMatch
object
2 properties
EnvelopeMatchData
object
1 property
EnvelopeMatchmakerMatched
object
1 property
EnvelopeStatusPresenceEvent
object
1 property
EnvelopeNotifications
object
1 property
EnvelopeError
object
2 properties

Specification

The full machine-readable AsyncAPI contract behind this narrative.

Source

nakama-asyncapi.yml Raw ↑

Other APIs Nakama publishes across the network.

Nakama Console API
Nakama Account API
Nakama Authentication API
Nakama Friends API
Nakama Groups API
Nakama Leaderboards API
Nakama Notifications API
Nakama RPC API
Nakama Storage API
Nakama Tournaments API