ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Player Authentication API

v1

サポート対象
​

Player Authentication API

v1

サポート対象
​

このページは選択した言語では使用できません。
Unity Services Web APIs
​
​
Player Authentication API
  • Introduction
mdx:openapi:endpoints
  • Player Authentication

Player Authentication API

Introduction

This is the API specification for the Unity Authentication service that allows player authentication.

Rate Limits

The API has rate limiting in place. Most endpoints are limited to 15 requests per second on a per-IP basis, and 300 requests over 30 minutes. Exceptions are outlined on a per-endpoint basis in the documentation below. The API responds with a
429
HTTP status code if the rate limit is exceeded. It also responds with a
Retry-After
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 to be accepted.
Download OpenAPI specification:

Anonymous Sign Up


Sign-up a new anonymous player.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

nonce

string
example: 9i09urd6ffg
String value used to associate a client session with an Id Token, and to mitigate replay attacks. If this field is provided, the nonce claim in response id token has a matching value.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "nonce": "9i09urd6ffg"}' \ "https://player-auth.services.api.unity.com/v1/authentication/anonymous"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

External Token Sign In


Authenticate players using external token. The external tokens are from login providers, such as Facebook.

Path parameters for "{title}"

idProvider

string
必須
example: identity-provider-name
This is the id provider type.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

nonce

string
example: 5eb26a338a232
String value used to associate a client session with an Id token, and to mitigate replay attacks. If this field is provided, the nonce claim in response Id token has a matching value.

signInOnly

boolean
example: false
Whether the API should only attempt to sign-in and do not create a new player if the player does not exist.

token

string
必須
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX
External token that can be verified to represent a player from the id provider. This may be an id token or an access token.

oculusConfig

object
The request body for Oculus authentication. This field is not applicable for any other Id provider.

userId

string
必須
example: 5eb26a338a232
String value of the oculus player's Id.

appleGameCenterConfig

object
The request body for Apple Game Center authentication. This field is not applicable for any other Id provider.

teamPlayerId

string
必須
example: 5eb26a338a232
String value of the Apple Game Center player's team player Id.

timestamp

integer
必須
example: 389743847
Integer value of the timestamp.

publicKeyUrl

string
必須
example: something.com/path.cert
String value of the Apple Game Center public key url.

salt

string
必須
example: ascfr==
String value of the base64 encoded salt.

steamConfig

Identifying string passed as a parameter to Steam's GetAuthTicketForWebApi when the ticket was created, used to identify the entity calling this webapi. This should not be sent if no identity was passed issue a ticket from steam.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "nonce": "5eb26a338a232", "signInOnly": false, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX", "oculusConfig": { "userId": "5eb26a338a232" }, "appleGameCenterConfig": { "teamPlayerId": "5eb26a338a232", "timestamp": 389743847, "publicKeyUrl": "something.com/path.cert", "salt": "ascfr==" }, "steamConfig": { "appId": "123456", "identity": "string" }}' \ "https://player-auth.services.api.unity.com/v1/authentication/external-token/{idProvider}"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Session Token Sign In


Authenticate players using the session token. Store the session token in a persistent storage in the app or on device.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

nonce

string
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX
String value used to associate a Client session with an Id Token, and to mitigate replay attacks. If this field is provided, the nonce claim in response Id token has a matching value.

sessionToken

string
必須
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX
The session token of the player.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "nonce": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX", "sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX"}' \ "https://player-auth.services.api.unity.com/v1/authentication/session-token"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Link External Id


Link an External Id to a Unity Authentication account
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

idProvider

string
必須
example: identity-provider-name
This is the id provider type.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

Request body for "{title}"

Media Type:
application/json

forceLink

boolean
example: false
Force a link between the player specified in the UAS access token and the external Id. If a different UAS player is already linked to the external id, unlink that player from the external id before linking the request's player.

token

string
必須
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX
External token that can be verified to represent a player from the Id provider. This may be an Id token or an access token.

oculusConfig

object
The request body for Oculus authentication. This field is not applicable for any other Id provider.

userId

string
必須
example: 5eb26a338a232
String value of the oculus player's Id.

appleGameCenterConfig

object
The request body for Apple Game Center authentication. This field is not applicable for any other Id provider.

teamPlayerId

string
必須
example: 5eb26a338a232
String value of the Apple Game Center player's team player Id.

timestamp

integer
必須
example: 389743847
Integer value of the timestamp.

publicKeyUrl

string
必須
example: something.com/path.cert
String value of the Apple Game Center public key url.

salt

string
必須
example: ascfr==
String value of the base64 encoded salt.

steamConfig

Identifying string passed as a parameter to Steam's GetAuthTicketForWebApi when the ticket was created, used to identify the entity calling this webapi. This should not be sent if no identity was passed issue a ticket from steam.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "forceLink": false, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX", "oculusConfig": { "userId": "5eb26a338a232" }, "appleGameCenterConfig": { "teamPlayerId": "5eb26a338a232", "timestamp": 389743847, "publicKeyUrl": "something.com/path.cert", "salt": "ascfr==" }, "steamConfig": { "appId": "123456", "identity": "string" }}' \ "https://player-auth.services.api.unity.com/v1/authentication/link/{idProvider}"

Response example

{ "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Unlink External Id


Unlink an external account from a Unity Authentication account.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

idProvider

string
必須
example: identity-provider-name
This is the id provider type.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

Request body for "{title}"

Media Type:
application/json

externalId

string
必須
example: eyJhbGciOiJIUzI1Ni
The external Id to unlink from the player account.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "externalId": "eyJhbGciOiJIUzI1Ni"}' \ "https://player-auth.services.api.unity.com/v1/authentication/unlink/{idProvider}"

Response example

{ "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Username Password Sign Up


Create a new player for the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API. When this is provided, a user associated with the bearer token is used instead of creating a new user.

Request body for "{title}"

Media Type:
application/json

username

string
必須
example: New_User_57
The username. Case insensitive. Length must be between 3-20 with the allowed characters a-z, 0-9 and the symbols [.][-][@][_].

password

string
必須
example: ThePassword123!
The password. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "username": "New_User_57", "password": "ThePassword123!"}' \ "https://player-auth.services.api.unity.com/v1/authentication/usernamepassword/sign-up"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Username Password Sign In


Sign in using the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

username

string
必須
example: New_User_57
The username. Case insensitive. Length must be between 3-20 with the allowed characters a-z, 0-9 and the symbols [.][-][@][_].

password

string
必須
example: ThePassword123!
The password. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "username": "New_User_57", "password": "ThePassword123!"}' \ "https://player-auth.services.api.unity.com/v1/authentication/usernamepassword/sign-in"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Username Password Update Password


Update the password of a player using the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

Request body for "{title}"

Media Type:
application/json

password

string
必須
example: ThePassword123!
The password. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.

newPassword

string
必須
example: TheNewPassword456@
The password to be changed. Length must be between 8-30 and contain at least one uppercase letter, at least one lowercase letter, at least one number and at least one symbol.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "password": "ThePassword123!", "newPassword": "TheNewPassword456@"}' \ "https://player-auth.services.api.unity.com/v1/authentication/usernamepassword/update-password"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Generate Code


Generates a sign in code for an unauthenticated device.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

identifier

string
example: myDevice
Human-readable string to identify the requester device.

codeChallenge

string
必須
SHA-256 string challenge for PKCE validation

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "identifier": "myDevice", "codeChallenge": "string"}' \ "https://player-auth.services.api.unity.com/v1/authentication/code-link/generate"

Response example

{ "codeLinkSessionId": "string", "signInCode": "f4j98K", "expiration": "string"}

Sign In With Code


Tries to sign in a user with code. In the case this returns 200 and an empty response, poll at regular intervals, 2-5s to avoid being rate limited, until you receive a different response.

Path parameters for "{title}"

CodeLinkSessionId

string
必須
An identifier for the device requesting the code sign in.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

codeVerifier

string
必須
Verifier for PKCE validation.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "codeVerifier": "string"}' \ "https://player-auth.services.api.unity.com/v1/authentication/code-link/sign-in/{CodeLinkSessionId}"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Get Code Info


Get code information including the identifier and expiration.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

signInCode

string
必須
The code from which to get the info.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "ProjectId: <ProjectId>" \ -H "UnityEnvironment: <UnityEnvironment>" \ -H "Content-Type: application/json" \ -d '{ "signInCode": "string"}' \ "https://player-auth.services.api.unity.com/v1/authentication/code-link/info"

Response example

{ "identifier": "myDevice", "expiration": "string"}

Code Confirmation


Allow a user to sign in to this account using this code

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

Request body for "{title}"

Media Type:
application/json

signInCode

string
必須
example: f4j98K
The code returned in the GenerateCodeResponse.

sessionToken

string
The authenticated device session token, for added security.

idProvider

string
This is the id provider type. Only for consoles.

externalToken

string
External token to validate the user. Only for consoles.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "signInCode": "f4j98K", "sessionToken": "string", "idProvider": "string", "externalToken": "string"}' \ "https://player-auth.services.api.unity.com/v1/authentication/code-link/confirm"

Response example

{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ]}

Custom ID Sign In


Sign In using a Custom ID from a trusted server. This endpoint is limited to 500 RPS per IP address.
Authorizations
Admin (player_auth.server.custom_id_auth)
HTTP: Admin
HTTP Authorization Scheme: bearer
Required scopes: player_auth.server.custom_id_auth

Path parameters for "{title}"

ProjectId

string
必須
This is the Unity Project Id. It is a uuid format.

Header parameters for "{title}"

UnityEnvironment

string
example: production
This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input.

Request body for "{title}"

Media Type:
application/json

externalId

string
必須
example: externalId
The external id used to identify the player. Length must be between 1-320.

signInOnly

boolean
example: false
Whether the API should only attempt to sign-in and do not create a new player if the player does not exist.

accessToken

string
example: eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzo3MDdFQkJCNy05MEYzLTQ3NEYtOTA0NC02NDIzRUNDM0Q3NDkiLCJ0eXAiOiJKV1QifQ.eyJdWQiOlsiaWRkOmY1OWRmNDViLWY1YzUtNGE4Yy1iMmM0LWQzNDJiNmM5ZThkZiIsImVudk5hbWU6cHJvZHVjdGlvbiIsImVudklkOmRiNjQ5YzJiLWZjZTAtNDZkZS1iMGFhLTU1MzE1Y2VjYmUwNCIsInVwaWQ6NjU3YjViZGEtZWNmOS00NTFlLTk2NzMtODhlMjg4NTM2MzA1Il0sImV4cCI6MTcxMjg0NjA5NiwiaWF0IjoxNzEyODQyNDk2LCJpZGQiOiJmNTlkZjQ1Yi1mNWM1LTRhOGMtYjJjNC1kMzQyYjZjOWU4ZGYiLCJpc3MiOiJodHRwczovL3BsYXllci1hdXRoLXN0Zy5zZXJ2aWNlcy5hcGkudW5pdHkuY29tIiwianRpIjoiMjIyMjExNGUtMzE4Ni00ODljLTk3YzMtNjg4ZWI2NmJkNDVhIiwibmJmIjoxNzEyODQyNDk2LCJub25jZSI6Im51bGwiLCJwcm9qZWN0X2lkIjoiNjU3YjViZGEtZWNmOS00NTFlLTk2NzMtODhlMjg4NTM2MzA1Iiwic2lnbl9pbl9wcm92aWRlciI6ImFub255bW91cyIsInN1YiI6ImtzOWtJeW1iUnloMFVXVmVJbHBvVXZhR3ZueEoiLCJ0b2tlbl90eXBlIjoiYXV0aGVudGljYXRpb24iLCJ2ZXJzaW9uIjoiMSJ9.iVMwPYOp7qGNdzHS0CqWSdhGE7UTQOL_9J418zUJvlZtmDeslSSEinHAJn_Bv58yaVDNV1Z4dzSdKr5ixVDcxhVpe0lNkThFLRD6r2Ae36NNBKkSztBt9BD14k0_hwyU4beDrY7TUDHNfSppRczkBJAKp5T6eOt3rR9M7ilAOLJLd9Tz5l4aoJWkqG-V-S8qjkDvhiMdHE6HwGk2CVch5MGzTiBqHelCNoroA_cjkLFfUBkT4TTRUMBzXfrsyc8qat1iUPtAjxsvF91Y22d75PiPZAffSaCfT1vzIRWKZQcRH1QQl8BcSFUPGYAKrUKqlvP8njU1GuGYAluxJusseg
The access token for the account to be linked.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "externalId": "externalId", "signInOnly": false, "accessToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzo3MDdFQkJCNy05MEYzLTQ3NEYtOTA0NC02NDIzRUNDM0Q3NDkiLCJ0eXAiOiJKV1QifQ.eyJdWQiOlsiaWRkOmY1OWRmNDViLWY1YzUtNGE4Yy1iMmM0LWQzNDJiNmM5ZThkZiIsImVudk5hbWU6cHJvZHVjdGlvbiIsImVudklkOmRiNjQ5YzJiLWZjZTAtNDZkZS1iMGFhLTU1MzE1Y2VjYmUwNCIsInVwaWQ6NjU3YjViZGEtZWNmOS00NTFlLTk2NzMtODhlMjg4NTM2MzA1Il0sImV4cCI6MTcxMjg0NjA5NiwiaWF0IjoxNzEyODQyNDk2LCJpZGQiOiJmNTlkZjQ1Yi1mNWM1LTRhOGMtYjJjNC1kMzQyYjZjOWU4ZGYiLCJpc3MiOiJodHRwczovL3BsYXllci1hdXRoLXN0Zy5zZXJ2aWNlcy5hcGkudW5pdHkuY29tIiwianRpIjoiMjIyMjExNGUtMzE4Ni00ODljLTk3YzMtNjg4ZWI2NmJkNDVhIiwibmJmIjoxNzEyODQyNDk2LCJub25jZSI6Im51bGwiLCJwcm9qZWN0X2lkIjoiNjU3YjViZGEtZWNmOS00NTFlLTk2NzMtODhlMjg4NTM2MzA1Iiwic2lnbl9pbl9wcm92aWRlciI6ImFub255bW91cyIsInN1YiI6ImtzOWtJeW1iUnloMFVXVmVJbHBvVXZhR3ZueEoiLCJ0b2tlbl90eXBlIjoiYXV0aGVudGljYXRpb24iLCJ2ZXJzaW9uIjoiMSJ9.iVMwPYOp7qGNdzHS0CqWSdhGE7UTQOL_9J418zUJvlZtmDeslSSEinHAJn_Bv58yaVDNV1Z4dzSdKr5ixVDcxhVpe0lNkThFLRD6r2Ae36NNBKkSztBt9BD14k0_hwyU4beDrY7TUDHNfSppRczkBJAKp5T6eOt3rR9M7ilAOLJLd9Tz5l4aoJWkqG-V-S8qjkDvhiMdHE6HwGk2CVch5MGzTiBqHelCNoroA_cjkLFfUBkT4TTRUMBzXfrsyc8qat1iUPtAjxsvF91Y22d75PiPZAffSaCfT1vzIRWKZQcRH1QQl8BcSFUPGYAKrUKqlvP8njU1GuGYAluxJusseg"}' \ "https://player-auth.services.api.unity.com/v1/projects/{ProjectId}/authentication/server/custom-id"

Response example

{ "expiresIn": 3600, "idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "sessionToken": "5eb26a338a232", "lastNotificationDate": "123000000", "user": { "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1", "username": "New_User_57" }, "userId": "5eb26a338a232"}

Get Player


Get the information for a player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

PlayerId

string
必須
example: 99i9ju8juh
This is the player id.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://player-auth.services.api.unity.com/v1/users/{PlayerId}"

Response example

{ "disabled": false, "externalIds": [ { "externalId": "5eb26a338a232", "providerId": "provider-id" } ], "id": "eyJhbGciOiJIUzI1N", "createdAt": "123000000", "lastLoginAt": "123000000", "usernamepassword": { "username": "New_User_57", "createdAt": "123000000", "lastLoginAt": "123000000", "passwordUpdatedAt": "123000000" }}

Delete Player


Delete the player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

PlayerId

string
必須
example: 99i9ju8juh
This is the player id.

Header parameters for "{title}"

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://player-auth.services.api.unity.com/v1/users/{PlayerId}"

Response example

{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ]}

Read Notification


Gets a player's notifications to be displayed by the client.

Path parameters for "{title}"

PlayerId

string
必須
example: 99i9ju8juh
This is the player id.

Header parameters for "{title}"

Authorization

string
example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
This is the bearer token for the user authorized to call this API.

ProjectId

string
必須
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
This is the Unity Project Id. It is a uuid format.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ "https://player-auth.services.api.unity.com/v1/users/{PlayerId}/notifications"

Response example

{ "notifications": [ { "id": "string", "type": "DSA", "playerID": "string", "caseID": "string", "projectID": "string", "message": "string", "createdAt": "string", "updatedAt": "string", "deletedAt": "string" } ]}

Get JWKS


Get the JSON Web Key Set for validating authentication tokens.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ "https://player-auth.services.api.unity.com/.well-known/jwks.json"

Response example

{ "keys": [ { "alg": "RS256", "e": "43urutru", "kid": "public-0000000-0000-0000-0000-111111111111", "kty": "RSA", "n": "igu4jtou4389ru34890ut90i34r0-i39w4ru90u", "crv": "string", "x": "string", "y": "string", "use": "sig" } ]}

Copyright © 2026 Unity Technologies
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。