文档

​
​

Development

User Acquisition

Monetization

工业

Lobby API

v1

受支持
​

Lobby API

v1

受支持
​

此页面不支持所选语言。
Unity Services Web APIs
​
​
mdx:openapi:endpoints
  • Lobby

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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

Request body for "{title}"

Media Type:
application/json

count

integer
example: 25
The number of results to return.

skip

integer
example: 20
The number of results to skip before selecting results to return.

sampleResults

boolean
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.

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).

order

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

asc

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

field

string
example: MaxPlayers
The name of the field to order on.

continuationToken

string
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 "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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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.

maxPlayers

integer
必填
The maximum number of players that can be members of the lobby.

isPrivate

boolean
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
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
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
A player's profile data from the Social Profile service.

name

string
The player's name.

connectionInfo

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

data

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

allocationId

string
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.

lastUpdated

string
The last time the metadata for this player was updated.

password

string
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.

data

object
Custom game-specific properties that apply to the lobby (e.g.
mapName
or
gameType
).

HTTP response status codes for "{title}":

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
MaxPlayers
).
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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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.

password

string
The password to the target lobby. If target lobby HasPassword is true, this password must match or the request is denied.

player

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

id

string
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
A player's profile data from the Social Profile service.

name

string
The player's name.

connectionInfo

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

data

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

allocationId

string
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.

lastUpdated

string
The last time the metadata for this player was updated.

HTTP response status codes for "{title}":

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
MaxPlayers
).
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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-match

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

Request body for "{title}"

Media Type:
application/json

password

string
The password to the target lobby. If target lobby HasPassword is true, this password must match or the request is denied.

player

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

id

string
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
A player's profile data from the Social Profile service.

name

string
The player's name.

connectionInfo

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

data

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

allocationId

string
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.

lastUpdated

string
The last time the metadata for this player was updated.

HTTP response status codes for "{title}":

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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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.

maxPlayers

integer
必填
The maximum number of players that can be members of the lobby.

isPrivate

boolean
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
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
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
A player's profile data from the Social Profile service.

name

string
The player's name.

connectionInfo

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

data

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

allocationId

string
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.

lastUpdated

string
The last time the metadata for this player was updated.

password

string
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.

data

object
Custom game-specific properties that apply to the lobby (e.g.
mapName
or
gameType
).

HTTP response status codes for "{title}":

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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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 "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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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.

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).

player

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

id

string
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
A player's profile data from the Social Profile service.

name

string
The player's name.

connectionInfo

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

data

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

allocationId

string
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.

lastUpdated

string
The last time the metadata for this player was updated.

HTTP response status codes for "{title}":

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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-none-match

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

HTTP response status codes for "{title}":

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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-match

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

HTTP response status codes for "{title}":

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
data
property, etc.
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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-match

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

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.

maxPlayers

integer
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.

isPrivate

boolean
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
Whether or not the lobby is locked. If true, new players will not be able to join.

password

string
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.

data

object
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
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 "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
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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

playerId

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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-match

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

HTTP response status codes for "{title}":

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
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
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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

playerId

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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-match

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

Request body for "{title}"

Media Type:
application/json

connectionInfo

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

data

object
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
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 "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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

if-match

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

Request body for "{title}"

Media Type:
application/json

lobbyUpdate

object
example: {"maxPlayers":4,"data":{"keyToUpdate":{"visibility":"public","value":"ctf"},"keyToGiveNullValue":{"visibility":"public","value":null},"keyToRemove":null}}
The body of an Update Lobby request.

name

string
The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.

maxPlayers

integer
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.

isPrivate

boolean
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
Whether or not the lobby is locked. If true, new players will not be able to join.

password

string
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.

data

object
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
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
A mapping from player IDs to player update requests.

playersToAdd

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

id

string
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
A player's profile data from the Social Profile service.

name

string
The player's name.

connectionInfo

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

data

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

allocationId

string
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.

lastUpdated

string
The last time the metadata for this player was updated.

playersToRemove

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

ignoreIneffectualUpdates

boolean
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 "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
LastUpdated
property, to signify that the lobby is not stale.
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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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 "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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

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 "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
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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

HTTP response status codes for "{title}":

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/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
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

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

HTTP response status codes for "{title}":

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/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
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

Path parameters for "{title}"

lobbyId

string
必填
example: {{lobbyId}}
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.

Header parameters for "{title}"

service-id

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

impersonated-user-id

string
example: 4309750e-acb6-abcd-3565-b12201e67044
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.

HTTP response status codes for "{title}":

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}

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。