Player Authentication Admin API
Introduction
This is the Admin API specification for the Unity Authentication service that allows player authentication.
To use this API, you must first enable it through the Unity Gaming Services dashboard.
For more information about how to set up Service Account Authentication, please read here: https://services.docs.unity.com/docs/service-account-auth
Rate Limits
The API has rate limiting in place. Request are limited to 10 requests per second, and 500 requests per 30 minute period.
The API responds with a HTTP status code if the rate limit is
exceeded.
429It will also respond with a header to be used in conjunction with a client's retry logic.
The value is the number of seconds until a request for the given player will be accepted.
Retry-AfterDownload OpenAPI specification:
List Players
Return a list of the project's players and their information.
Authorizations
Admin (player_auth.users.list)
HTTP: Admin
HTTP Authorization Scheme: basic
Required scopes: player_auth.users.list
Code samples for "{title}":
Request example
curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/player-identity/v1/projects/{projectId}/users"
Response example
{ "next": "xxxxxxxx", "results": [ { "id": "eyJhbGciOiJIUzI1N", "disabled": false, "externalIds": [ { "providerId": "provider-id" } ], "createdAt": "123000000", "lastLoginAt": "123000000" } ]}
Get Player
Get the current player's information.
Authorizations
Admin (player_auth.users.get)
HTTP: Admin
HTTP Authorization Scheme: basic
Required scopes: player_auth.users.get
Code samples for "{title}":
Request example
curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/player-identity/v1/projects/{projectId}/users/{playerId}"
Response example
{ "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-Id" } ], "id": "eyJhbGciOiJIUzI1N", "createdAt": "123000000", "lastLoginAt": "123000000", "usernamePasswordLoginMetadata": { "username": "New_User_57", "createdAt": "123000000", "lastLoginAt": "123000000", "passwordUpdatedAt": "123000000" }}
Delete Player
Delete a player. [WARNING] The account deletion API only deletes the player's Unity Authentication account. It is your obligation to ensure that you delete all associated player data that is connected to the player's Unity Authentication account and other UGS services you use, such as Economy and Cloud Save.
Authorizations
Admin (player_auth.users.delete)
HTTP: Admin
HTTP Authorization Scheme: basic
Required scopes: player_auth.users.delete
Enable Player
Enable the player.
Authorizations
Admin (player_auth.users.enable)
HTTP: Admin
HTTP Authorization Scheme: basic
Required scopes: player_auth.users.enable
Code samples for "{title}":
Request example
curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/player-identity/v1/projects/{projectId}/users/{playerId}/enable"
Response example
{ "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-Id" } ], "id": "eyJhbGciOiJIUzI1N", "createdAt": "123000000", "lastLoginAt": "123000000", "usernamePasswordLoginMetadata": { "username": "New_User_57", "createdAt": "123000000", "lastLoginAt": "123000000", "passwordUpdatedAt": "123000000" }}
Disable Player
Disable the player.
Authorizations
Admin (player_auth.users.disable)
HTTP: Admin
HTTP Authorization Scheme: basic
Required scopes: player_auth.users.disable
Code samples for "{title}":
Request example
curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/player-identity/v1/projects/{projectId}/users/{playerId}/disable"
Response example
{ "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-Id" } ], "id": "eyJhbGciOiJIUzI1N", "createdAt": "123000000", "lastLoginAt": "123000000", "usernamePasswordLoginMetadata": { "username": "New_User_57", "createdAt": "123000000", "lastLoginAt": "123000000", "passwordUpdatedAt": "123000000" }}
Change Password
Change Username Password account password
Authorizations
Admin (player_auth.password.update)
HTTP: Admin
HTTP Authorization Scheme: basic
Required scopes: player_auth.password.update
Code samples for "{title}":
Request example
curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "TheNewPassword456@"}' \ "https://services.api.unity.com/player-identity/v1/projects/{projectId}/users/{playerId}/change-password"
Response example
{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ]}