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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Request body for "{title}"
Media Type:
application/jsonThe value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as (e.g. for MaxPlayers, for Created, etc.). The value for fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the "o" format specifier: . Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings.
fieldintegerdatetimedatetimereturn dateTime.ToString("o", DateTimeFormatInfo.InvariantInfo);Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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 ).
MaxPlayersAuthorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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", "profile": { "name": "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 ).
MaxPlayersAuthorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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", "profile": { "name": "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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Request body for "{title}"
Media Type:
application/jsonThe value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as (e.g. for MaxPlayers, for Created, etc.). The value for fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the "o" format specifier: . Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings.
fieldintegerdatetimedatetimereturn dateTime.ToString("o", DateTimeFormatInfo.InvariantInfo);Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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 property, etc.
dataAuthorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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 to another player using the Update Lobby API before leaving.
hostIdAuthorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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 property for an individual player to include game-specific metadata. The index data property is not allowed on player data objects at this time.
dataAuthorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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", "profile": { "name": "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 property, to signify that the lobby is not stale.
LastUpdatedAuthorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Get a player's joined lobbies
Get a list of lobby IDs that the player is currently a member of.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Get a player/service's hosted lobbies
Get a list of lobby IDs that are currently hosted by the player/service.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
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
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Code samples for "{title}":
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}