Documentation

​
​

Development

User Acquisition

Monetization

Industry

Auth Client API

v1

Supported
​

Auth Client API

v1

Supported
​

Unity Services Web APIs
​
​
Authentication
  • Overview
Endpoints
  • Authentication

Authentication

Overview

The authentication APIs provide the methods to switch between different kinds of authentication tokens. Some APIs only accept the stateless access token to be used for better performance.

The authentication APIs provide a way to switch from a Service Account Key ID and Secret Key pair to a stateless access token. The returned access token can be used as
Bearer
authentication.

Rate Limits

These APIs have rate limiting in place. Requests are limited to 20 requests per second and 18000 requests per thirty minutes per endpoint. The APIs respond with a
429
HTTP status code if the rate limit is exceeded.
Download OpenAPI specification:

Token Exchange API


Exchange a Service Account Key ID and Secret Key pair to a Stateless Access Token. The access token is always scoped to a project and optionally even to an environment. Following the principle of least privilege it is a good practice to scope the token to both project and environment ID if applicable.

The request can optionally contain a list of permissions that should be scoped to the access token. If left out then all scopes will be included by default.

The returned access token is a standard RFC 7519 JWT and has a 1 hour expiration time (TTL).

The Token Exchange API has a maximum limit of 200 permissions that can be included in the Stateless Access Token. Because all permissions are included by default this cap can be hit when no
scopes
are being specified in the request. This might happen if the Service Account has been assigned multiple roles that each grant their own permissions. If the permission cap is reached the API will return an error. In this case it's required to specify the exact permissions that the Stateless Access Token should have when using the exchange API.

Query parameters for "Token Exchange API"

projectId

string
required
ID for Unity project that the access token is scoped to.

environmentId

string
Id of an environment that the access token is scoped to.

Request body for "Token Exchange API"

Media Type:
application/json

scopes

array[string]
example: ["unity.projects.get","unity.projects.create"]
List of requested permissions

HTTP response status codes for "Token Exchange API":

Code samples for "Token Exchange API":

Request example

curl -X POST \ -H "Content-Type: application/json" \ -d '{ "scopes": [ "unity.projects.get", "unity.projects.create" ]}' \ "https://services.api.unity.com/auth/v1/token-exchange"

Response example

{ "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjJ9.tbDepxpstvGdW8TC3G8zg4B6rUYAOvfzdceoH48wgRQ"}

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.