ドキュメント

Lobby API

バージョン v1

Lobby API

バージョン 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 "{title}"

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 "{title}"

Media Type:
application/json

count

integer | null
デフォルト: 10
The number of results to return.
format: int32>= 1<= 100
example: 25

skip

integer | null
デフォルト: 0
The number of results to skip before selecting results to return.
format: int32>= 0<= 1000
example: 20

sampleResults

boolean
デフォルト: 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
必須
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
必須
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
必須
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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "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 "{title}"

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 "{title}"

Media Type:
application/json

name

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

maxPlayers

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

isPrivate

boolean | null
デフォルト: 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
デフォルト: 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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "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 "{title}"

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 "{title}"

Media Type:
application/json

lobbyCode

string
必須
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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "lobbyCode": "XYZ123", "player": { "data": { "role": { "visibility": "member", "value": "tank" } } }}' \ "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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

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
Example: {name}
Join with lobby ID
{ "password": "lobby_password", "player": { "id": "player_id", "data": { "role": { "visibility": "member", "value": "tank" } } }}

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "password": "lobby_password", "player": { "id": "player_id", "data": { "role": { "visibility": "member", "value": "tank" } } }}' \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

Media Type:
application/json

name

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

maxPlayers

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

isPrivate

boolean | null
デフォルト: 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
デフォルト: 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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "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/%7B%7BlobbyId%7D%7D/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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

Media Type:
application/json
Schema:
{}

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{}' \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/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 "{title}"

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 "{title}"

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
必須
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
必須
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
必須
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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-none-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D"

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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D"

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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "maxPlayers": 4, "data": { "keyToUpdate": { "visibility": "public", "value": "ctf" }, "keyToGiveNullValue": { "visibility": "public", "value": null }, "keyToRemove": null }}' \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D"

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 "{title}"

lobbyId

string
必須
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
必須
The ID of the player to execute the request against.
example: {{playerId}}

Header parameters for "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/players/%7B%7BplayerId%7D%7D"

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 "{title}"

lobbyId

string
必須
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
必須
The ID of the player to execute the request against.
example: {{playerId}}

Header parameters for "{title}"

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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "connectionInfo": "string", "data": {}, "allocationId": "string"}' \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/players/%7B%7BplayerId%7D%7D"

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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

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
デフォルト: 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 "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "if-match: 42" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{ "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/%7B%7BlobbyId%7D%7D/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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

Media Type:
application/json
Schema:
{}

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '{}' \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}"

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

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ --data-raw '[ { "tokenType": "vivoxJoin" }]' \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -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 "{title}"

lobbyId

string
必須
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 "{title}"

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 "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "service-id: 28081b0e-75b6-48a5-9c85-c11104e84055" \ -H "impersonated-user-id: 4309750e-acb6-abcd-3565-b12201e67044" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://lobby.services.api.unity.com/v1/%7B%7BlobbyId%7D%7D/migrationdatainfo"

Response example

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