Documentation

Lobby API

Version: v1

Lobby API

Version: v1

Lobby

The Lobby service is a flexible system for games to enable different styles of multiplayer experiences quickly and easily. A lobby provides a way to browse and join public games, create private games that can be easily joined by others using a code, gather a group together in a party before matchmaking as a group, and more!
Download OpenAPI specification:

Query public lobbies


Query all of the public lobbies for a title and filter them down according to parameters provided by the client.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Header parameters for "Query public lobbies"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Query public lobbies"

Media Type:
application/json

count

integer | null
default: 10
The number of results to return.
format: int32>= 1<= 100
example: 25

skip

integer | null
default: 0
The number of results to skip before selecting results to return.
format: int32>= 0<= 1000
example: 20

sampleResults

boolean
default: false
Whether a random sample of results that match the search filter should be returned.

filter

array[object]
A list of filters which can be used to narrow down which lobbies to return.

field

string
required
The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name.
enum: "MaxPlayers", "AvailableSlots", "Name", "Created", "LastUpdated", "S1", "S2", "S3", "S4", "S5"

value

string
required
The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as
field
(e.g.
integer
for MaxPlayers,
datetime
for Created, etc.). The value for
datetime
fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the "o" format specifier:
return dateTime.ToString("o", DateTimeFormatInfo.InvariantInfo);
. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings.

op

string
required
The operator used to compare the field to the filter value. Supports
CONTAINS
(only on the
Name
field),
EQ
(Equal),
NE
(Not Equal),
LT
(Less Than),
LE
(Less Than or Equal),
GT
(Greater Than), and
GE
(Greater Than or Equal).
enum: "CONTAINS", "EQ", "NE", "LT", "LE", "GT", "GE"

order

array[object]
A list of orders which define how the results should be ordered in the response.
example: {"order":[{"field":"MaxPlayers","asc":true},{"field":"Name","asc":false}]}

asc

boolean
Whether to sort in ascending or descending order.
example: true

field

string
The name of the field to order on.
enum: "Name", "MaxPlayers", "AvailableSlots", "Created", "LastUpdated", "ID", "S1", "S2", "S3", "S4"
example: MaxPlayers

continuationToken

string | null
A continuation token that can be passed to subsequent query requests to fetch the next page of results.

HTTP response status codes for "Query public lobbies":

Code samples for "Query public lobbies":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "filter": [ { "field": "s1", "op": "EQ", "value": "rim_world" }, { "field": "maxPlayers", "op": "GT", "value": "5" }, { "field": "name", "op": "CONTAINS", "value": "steve's game" } ], "order": [ { "field": "MaxPlayers", "asc": true }, { "field": "Name", "asc": false } ]}' \ "https://lobby.services.api.unity.com/v1/query"

Response example

{ "results": [ { "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } } } ], "continuationToken": "string"}

Create a lobby


Create a new lobby and return the lobby metadata.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Header parameters for "Create a lobby"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Create a lobby"

Media Type:
application/json

name

string
required
The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.
minLength: 1maxLength: 256

maxPlayers

integer
required
The maximum number of players that can be members of the lobby.
format: int32>= 1<= 150

isPrivate

boolean | null
default: false
Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the
lobbyCode
with other users who can use it to join this lobby.

isLocked

boolean | null
default: false
Whether or not the lobby is locked. If true, new players will not be able to join.

player

object
Information about a specific player creating, joining, or already in a lobby.

id

string | null
The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

profile

object | null
readOnly
The profile information for the player from the Social Profile service. This field will only be present if the feature is enabled and profile information is available at the time of response. A prior response with profile information does not guarantee profile information will be included in subsequent responses.

name

string
The player's name.

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties that apply to an individual player (e.g.
role
or
skill
).
maxProperties: 10

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

joined

string
The time at which the player joined the lobby.
format: date-time

lastUpdated

string
The last time the metadata for this player was updated.
format: date-time

password

string | null
The password for this lobby. If specified, the lobby will be created with HasPassword set to true. All joins will be rejected unless provided password matches.
minLength: 8maxLength: 64

data

object | null
Custom game-specific properties that apply to the lobby (e.g.
mapName
or
gameType
).
maxProperties: 20

HTTP response status codes for "Create a lobby":

Code samples for "Create a lobby":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "Example Lobby", "maxPlayers": 4, "isPrivate": false, "data": { "gameType": { "value": "KingOfTheHill", "index": "S1" }, "targetPoints": { "value": "500", "index": "N1" }, "mapTheme": { "value": "SummerHoliday", "visibility": "public" }, "region": { "value": "USWest", "visibility": "private" } }, "player": { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "data": { "preferredRole": { "value": "Support", "visibility": "member" }, "preferredSkin": { "value": "BlueWhale", "visibility": "private" } } }}' \ "https://lobby.services.api.unity.com/v1/create"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Join a lobby with lobby code


Join an existing lobby using the lobby code if there is space available (i.e. total number of players is less than the value of
MaxPlayers
).
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Header parameters for "Join a lobby with lobby code"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Join a lobby with lobby code"

Media Type:
application/json

lobbyCode

string
required
The lobby code of the lobby to join. Mutually exclusive with
id
. This is used to join a private lobby where the lobby code was shared to other users manually.
minLength: 1pattern: \w+

password

string | null
The password to the target lobby. If target lobby HasPassword is true, this password must match or the request is denied.
minLength: 8maxLength: 64

player

object
Information about a specific player creating, joining, or already in a lobby.

id

string | null
The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

profile

object | null
readOnly
The profile information for the player from the Social Profile service. This field will only be present if the feature is enabled and profile information is available at the time of response. A prior response with profile information does not guarantee profile information will be included in subsequent responses.

name

string
The player's name.

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties that apply to an individual player (e.g.
role
or
skill
).
maxProperties: 10

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

joined

string
The time at which the player joined the lobby.
format: date-time

lastUpdated

string
The last time the metadata for this player was updated.
format: date-time

HTTP response status codes for "Join a lobby with lobby code":

Code samples for "Join a lobby with lobby code":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "lobbyCode": "string", "password": "string", "player": { "id": "string", "connectionInfo": "string", "data": {}, "allocationId": "string", "joined": "2024-01-01T00:00:00Z", "lastUpdated": "2024-01-01T00:00:00Z" }}' \ "https://lobby.services.api.unity.com/v1/joinbycode"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Join a lobby with lobby ID


Join an existing lobby using the lobby ID if there is space available (i.e. total number of players is less than the value of
MaxPlayers
).
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Join a lobby with lobby ID"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Join a lobby with lobby ID"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version matches the provided value.
example: 42

Request body for "Join a lobby with lobby ID"

Media Type:
application/json

password

string | null
The password to the target lobby. If target lobby HasPassword is true, this password must match or the request is denied.
minLength: 8maxLength: 64

player

object
Information about a specific player creating, joining, or already in a lobby.

id

string | null
The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

profile

object | null
readOnly
The profile information for the player from the Social Profile service. This field will only be present if the feature is enabled and profile information is available at the time of response. A prior response with profile information does not guarantee profile information will be included in subsequent responses.

name

string
The player's name.

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties that apply to an individual player (e.g.
role
or
skill
).
maxProperties: 10

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

joined

string
The time at which the player joined the lobby.
format: date-time

lastUpdated

string
The last time the metadata for this player was updated.
format: date-time

HTTP response status codes for "Join a lobby with lobby ID":

Code samples for "Join a lobby with lobby ID":

Request example

curl -X POST \ -H "if-match: <if-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "password": "string", "player": { "id": "string", "connectionInfo": "string", "data": {}, "allocationId": "string", "joined": "2024-01-01T00:00:00Z", "lastUpdated": "2024-01-01T00:00:00Z" }}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/join"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Create or join a lobby with lobby ID


CreateOrJoin will attempt to create a lobby with a specific ID. If a Lobby with that ID already exists, we will attempt to join the Lobby. Joining the Lobby may fail the same way as the regular Join Lobby call (e.g. lobby is full, lobby is password protected) and may even fail with Not Found if the Lobby happens to get deleted part way through the request. You should handle these failures the same way you would handle any Lobby join failure.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Create or join a lobby with lobby ID"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Create or join a lobby with lobby ID"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Create or join a lobby with lobby ID"

Media Type:
application/json

name

string
required
The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.
minLength: 1maxLength: 256

maxPlayers

integer
required
The maximum number of players that can be members of the lobby.
format: int32>= 1<= 150

isPrivate

boolean | null
default: false
Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the
lobbyCode
with other users who can use it to join this lobby.

isLocked

boolean | null
default: false
Whether or not the lobby is locked. If true, new players will not be able to join.

player

object
Information about a specific player creating, joining, or already in a lobby.

id

string | null
The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

profile

object | null
readOnly
The profile information for the player from the Social Profile service. This field will only be present if the feature is enabled and profile information is available at the time of response. A prior response with profile information does not guarantee profile information will be included in subsequent responses.

name

string
The player's name.

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties that apply to an individual player (e.g.
role
or
skill
).
maxProperties: 10

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

joined

string
The time at which the player joined the lobby.
format: date-time

lastUpdated

string
The last time the metadata for this player was updated.
format: date-time

password

string | null
The password for this lobby. If specified, the lobby will be created with HasPassword set to true. All joins will be rejected unless provided password matches.
minLength: 8maxLength: 64

data

object | null
Custom game-specific properties that apply to the lobby (e.g.
mapName
or
gameType
).
maxProperties: 20

HTTP response status codes for "Create or join a lobby with lobby ID":

Code samples for "Create or join a lobby with lobby ID":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "Example Lobby", "maxPlayers": 4, "isPrivate": false, "data": { "gameType": { "value": "KingOfTheHill", "index": "S1" }, "targetPoints": { "value": "500", "index": "N1" }, "mapTheme": { "value": "SummerHoliday", "visibility": "public" }, "region": { "value": "USWest", "visibility": "private" } }, "player": { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "data": { "preferredRole": { "value": "Support", "visibility": "member" }, "preferredSkin": { "value": "BlueWhale", "visibility": "private" } } }}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/createorjoin"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Reconnect to a lobby after disconnecting


Reconnect a disconnected player to a lobby using the lobby ID. A disconnected player remains in the lobby but must reconnect in order to avoid being automatically removed after a configurable period of time. The duration can be set by the developer in the Lobby service configuration.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Reconnect to a lobby after disconnecting"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Reconnect to a lobby after disconnecting"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Reconnect to a lobby after disconnecting"

Media Type:
application/json
Schema:
{}

HTTP response status codes for "Reconnect to a lobby after disconnecting":

Code samples for "Reconnect to a lobby after disconnecting":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/reconnect"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Query available lobbies and join a random one


Query all of the available lobbies for a title and filter them down according to parameters provided by the client. If possible, join one and return its information.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Header parameters for "Query available lobbies and join a random one"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Query available lobbies and join a random one"

Media Type:
application/json

filter

array[object]
A list of filters which can be used to narrow down which lobbies to attempt to join.

field

string
required
The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name.
enum: "MaxPlayers", "AvailableSlots", "Name", "Created", "LastUpdated", "S1", "S2", "S3", "S4", "S5"

value

string
required
The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as
field
(e.g.
integer
for MaxPlayers,
datetime
for Created, etc.). The value for
datetime
fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the "o" format specifier:
return dateTime.ToString("o", DateTimeFormatInfo.InvariantInfo);
. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings.

op

string
required
The operator used to compare the field to the filter value. Supports
CONTAINS
(only on the
Name
field),
EQ
(Equal),
NE
(Not Equal),
LT
(Less Than),
LE
(Less Than or Equal),
GT
(Greater Than), and
GE
(Greater Than or Equal).
enum: "CONTAINS", "EQ", "NE", "LT", "LE", "GT", "GE"

player

object
Information about a specific player creating, joining, or already in a lobby.

id

string | null
The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

profile

object | null
readOnly
The profile information for the player from the Social Profile service. This field will only be present if the feature is enabled and profile information is available at the time of response. A prior response with profile information does not guarantee profile information will be included in subsequent responses.

name

string
The player's name.

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties that apply to an individual player (e.g.
role
or
skill
).
maxProperties: 10

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

joined

string
The time at which the player joined the lobby.
format: date-time

lastUpdated

string
The last time the metadata for this player was updated.
format: date-time

HTTP response status codes for "Query available lobbies and join a random one":

Code samples for "Query available lobbies and join a random one":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "filter": [ { "field": "s1", "op": "EQ", "value": "rim_world" }, { "field": "maxPlayers", "op": "GT", "value": "5" }, { "field": "name", "op": "CONTAINS", "value": "steve's game" } ], "player": { "id": "ExamplePlayerId" }}' \ "https://lobby.services.api.unity.com/v1/quickjoin"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Get lobby details


Get the full details for a lobby including the game-specific metadata and player details.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Get lobby details"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Get lobby details"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-none-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version does not match the provided value.
example: 42

HTTP response status codes for "Get lobby details":

Code samples for "Get lobby details":

Request example

curl -X GET \ -H "if-none-match: <if-none-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/{lobbyId}"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Delete a lobby


Delete a lobby so it's no longer discoverable/joinable.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Delete a lobby"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Delete a lobby"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version matches the provided value.
example: 42

HTTP response status codes for "Delete a lobby":

Code samples for "Delete a lobby":

Request example

curl -X DELETE \ -H "if-match: <if-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/{lobbyId}"

Response example

{ "status": 400, "title": "Invalid Lobby Object", "details": [ { "errorType": "InvalidLobbyId", "message": "Lobby ID is invalid" }, { "errorType": "InvalidLobbyPlayers", "message": "One or more of the players is invalid" } ]}

Update lobby data


Update the properties of a lobby. This could include the lobby name, number of max players, the lobby's
data
property, etc.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Update lobby data"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Update lobby data"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version matches the provided value.
example: 42

Request body for "Update lobby data"

Media Type:
application/json

name

string | null
The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.
minLength: 1maxLength: 256

maxPlayers

integer | null
The maximum number of players that can be members of the lobby. Must be greater than or equal to the current number of players in the lobby.
format: int32>= 1<= 150

isPrivate

boolean | null
Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the
lobbyCode
with other users who can use it to join this lobby.

isLocked

boolean | null
Whether or not the lobby is locked. If true, new players will not be able to join.

password

string | null
Updates the password for this lobby. If previously unspecified, HasPassword set to true. If becoming null, HasPassword will be set to false. All future joins will be rejected unless provided password matches.
minLength: 8maxLength: 64

data

object | null
Custom game-specific properties to add, update, or remove from the lobby (e.g.
mapName
or
gameType
). To remove an existing property, include it in
data
but set the property object to
null
. To update the value to
null
, set the
value
property of the object to
null
.

hostId

string | null
The ID of the player to make the host of the lobby. As soon as this is updated, the current host will no longer have permission to modify the lobby.

HTTP response status codes for "Update lobby data":

Code samples for "Update lobby data":

Request example

curl -X POST \ -H "if-match: <if-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "maxPlayers": 4, "data": { "keyToUpdate": { "visibility": "public", "value": "ctf" }, "keyToGiveNullValue": { "visibility": "public", "value": null }, "keyToRemove": null }}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Remove a player


Remove an individual player from a lobby. If the player being removed is the host, a random player is chosen as the new host. Hosts can avoid this by changing the
hostId
to another player using the Update Lobby API before leaving.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Remove a player"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

playerId

string
required
The ID of the player to execute the request against.
example: {{playerId}}

Header parameters for "Remove a player"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version matches the provided value.
example: 42

HTTP response status codes for "Remove a player":

Code samples for "Remove a player":

Request example

curl -X DELETE \ -H "if-match: <if-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/{lobbyId}/players/{playerId}"

Response example

{ "status": 400, "title": "Invalid Lobby Object", "details": [ { "errorType": "InvalidLobbyId", "message": "Lobby ID is invalid" }, { "errorType": "InvalidLobbyPlayers", "message": "One or more of the players is invalid" } ]}

Update player data


Update the properties of a player. Only the player matching the player ID can perform this action. This could include updating the
data
property for an individual player to include game-specific metadata. The index data property is not allowed on player data objects at this time.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Update player data"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

playerId

string
required
The ID of the player to execute the request against.
example: {{playerId}}

Header parameters for "Update player data"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version matches the provided value.
example: 42

Request body for "Update player data"

Media Type:
application/json

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties to add, update, or remove from the player (e.g.
role
or
skill
). To remove an existing property, include it in
data
but set the property object to
null
. To update the value to
null
, set the
value
property of the object to
null
.

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

HTTP response status codes for "Update player data":

Code samples for "Update player data":

Request example

curl -X POST \ -H "if-match: <if-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "connectionInfo": "string", "data": {}, "allocationId": "string"}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/players/{playerId}"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Bulk update


Apply a bulk update to a lobby. This can modify the lobby's metadata, add players, update players, and remove players. This operation is only allowed for service accounts.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Bulk update"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Bulk update"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

if-match

string
The etag of the record being requested. Results/actions are only returned/executed when the current record version matches the provided value.
example: 42

Request body for "Bulk update"

Media Type:
application/json

lobbyUpdate

object | null
The update request for the lobby metadata.
example: {"maxPlayers":4,"data":{"keyToUpdate":{"visibility":"public","value":"ctf"},"keyToGiveNullValue":{"visibility":"public","value":null},"keyToRemove":null}}

name

string | null
The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.
minLength: 1maxLength: 256

maxPlayers

integer | null
The maximum number of players that can be members of the lobby. Must be greater than or equal to the current number of players in the lobby.
format: int32>= 1<= 150

isPrivate

boolean | null
Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the
lobbyCode
with other users who can use it to join this lobby.

isLocked

boolean | null
Whether or not the lobby is locked. If true, new players will not be able to join.

password

string | null
Updates the password for this lobby. If previously unspecified, HasPassword set to true. If becoming null, HasPassword will be set to false. All future joins will be rejected unless provided password matches.
minLength: 8maxLength: 64

data

object | null
Custom game-specific properties to add, update, or remove from the lobby (e.g.
mapName
or
gameType
). To remove an existing property, include it in
data
but set the property object to
null
. To update the value to
null
, set the
value
property of the object to
null
.

hostId

string | null
The ID of the player to make the host of the lobby. As soon as this is updated, the current host will no longer have permission to modify the lobby.

playerUpdates

object | null
A mapping from player IDs to player update requests.

playersToAdd

array[object] | null
An array of players to add to the lobby.

id

string | null
The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

profile

object | null
readOnly
The profile information for the player from the Social Profile service. This field will only be present if the feature is enabled and profile information is available at the time of response. A prior response with profile information does not guarantee profile information will be included in subsequent responses.

name

string
The player's name.

connectionInfo

string | null
deprecated
Connection information for connecting to a relay with this player.

data

object | null
Custom game-specific properties that apply to an individual player (e.g.
role
or
skill
).
maxProperties: 10

allocationId

string | null
The
allocationId
from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

joined

string
The time at which the player joined the lobby.
format: date-time

lastUpdated

string
The last time the metadata for this player was updated.
format: date-time

playersToRemove

array[string] | null
An array of player IDs to remove from the lobby.

ignoreIneffectualUpdates

boolean | null
default: false
Whether or not to silently ignore ineffectual updates (i.e. removing or updating players who are not in the lobby) instead of failing.

HTTP response status codes for "Bulk update":

Code samples for "Bulk update":

Request example

curl -X POST \ -H "if-match: <if-match>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "lobbyUpdate": { "maxPlayers": 4, "data": { "keyToUpdate": { "visibility": "public", "value": "ctf" }, "keyToGiveNullValue": { "visibility": "public", "value": null }, "keyToRemove": null } }, "playerUpdates": {}, "playersToAdd": [ { "id": "string", "connectionInfo": "string", "data": {}, "allocationId": "string", "joined": "2024-01-01T00:00:00Z", "lastUpdated": "2024-01-01T00:00:00Z" } ], "playersToRemove": [ "string" ], "ignoreIneffectualUpdates": false}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/bulkupdate"

Response example

{ "id": "ABC123", "upid": "00000000-0000-0000-0000-000000000000", "environmentId": "00000000-0000-0000-0000-000000000000", "hostId": "VrFPilrfaCNovALjrjOXxS7luGxN", "name": "Noobs Only", "maxPlayers": 8, "availableSlots": 7, "isPrivate": false, "created": "2021-06-10T20:48:25.433Z", "lastUpdated": "2021-06-10T20:48:25.433Z", "version": 2, "players": [ { "id": "VrFPilrfaCNovALjrjOXxS7luGxN", "profile": { "name": "ColorfulFlickeringHat#9" }, "data": { "skin": { "value": "Lance", "visibility": "member" }, "role": { "value": "Gunner", "visibility": "public" }, "preferedLane": { "value": "Mid", "visibility": "public" } } } ], "data": { "mydata": { "visibility": "public", "value": "{somejson}" }, "mydata2": { "visibility": "private", "value": "{somejson}" }, "gameMode": { "visibility": "public", "value": "CTF", "index": "S1" }, "indexedfield": { "visibility": "public", "value": "{somejson}", "index": "S2" }, "trackLength": { "visibility": "public", "value": "32", "index": "N1" } }}

Heartbeat a lobby


Heartbeat a lobby, updating its
LastUpdated
property, to signify that the lobby is not stale.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Heartbeat a lobby"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Heartbeat a lobby"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Heartbeat a lobby"

Media Type:
application/json
Schema:
{}

HTTP response status codes for "Heartbeat a lobby":

Code samples for "Heartbeat a lobby":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{}' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/heartbeat"

Response example

{ "status": 400, "title": "Invalid Lobby Object", "details": [ { "errorType": "InvalidLobbyId", "message": "Lobby ID is invalid" }, { "errorType": "InvalidLobbyPlayers", "message": "One or more of the players is invalid" } ]}

Authentication token request


Request authentication tokens for use with other services that interact with Lobby.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Authentication token request"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Authentication token request"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

Request body for "Authentication token request"

Media Type:
application/json
Array Type:
[ { "tokenType": "vivoxJoin" }]

HTTP response status codes for "Authentication token request":

Code samples for "Authentication token request":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '[ { "tokenType": "vivoxJoin" }]' \ "https://lobby.services.api.unity.com/v1/{lobbyId}/tokens"

Response example

{}

Get a player's joined lobbies


Get a list of lobby IDs that the player is currently a member of.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Header parameters for "Get a player's joined lobbies"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

HTTP response status codes for "Get a player's joined lobbies":

Code samples for "Get a player's joined lobbies":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/joined"

Response example

[ "string"]

Get a player/service's hosted lobbies


Get a list of lobby IDs that are currently hosted by the player/service.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Header parameters for "Get a player/service's hosted lobbies"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

HTTP response status codes for "Get a player/service's hosted lobbies":

Code samples for "Get a player/service's hosted lobbies":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/hosted"

Response example

[ "string"]

Get migration data information for a host's lobby


Get the migration data information of a lobby that the player is the current host.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Get migration data information for a host's lobby"

lobbyId

string
required
The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters.
example: {{lobbyId}}

Header parameters for "Get migration data information for a host's lobby"

service-id

string
When service authentication is used, this provides a logical identity for the service
example: 28081b0e-75b6-48a5-9c85-c11104e84055

impersonated-user-id

string
When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player.
example: 4309750e-acb6-abcd-3565-b12201e67044

HTTP response status codes for "Get migration data information for a host's lobby":

Code samples for "Get migration data information for a host's lobby":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/{lobbyId}/migrationdatainfo"

Response example

{ "write": "string", "read": "string", "expires": "2024-01-01T00:00:00Z", "maxSize": 0}