Documentation

​
​

Development

User Acquisition

Monetization

Industry

Access (deprecated) API

v1

Supported
​

Access (deprecated) API

v1

Supported
​

Unity Services Web APIs
​
​
Endpoints
  • PlayerPolicy
  • ProjectPolicy

Access Control API (Deprecated)

This set of endpoints are deprecated. Please use the new endpoints for managing resource policies.
This service allows customers and administrators to restrict project and player read/write access for gaming services.
Download OpenAPI specification:

Get a project based policy


This endpoint is deprecated, please use the new get policy endpoint.
A policy consists of multiple policy statements. This endpoint will return a Policy object containing an array of all non-expired policy statements in that policy.
Authorizations
ServiceAccount (unity.project_resource_policy.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.project_resource_policy.get

Path parameters for "Get a project based policy"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

HTTP response status codes for "Get a project based policy":

Code samples for "Get a project based policy":

Request example

curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/resource-policy"

Response example

{ "statements": [ { "Sid": "statement_id1", "Action": [ "string" ], "Effect": "string", "Principal": "string", "Resource": "urn:ugs:cloud-save:*", "ExpiresAt": "2020-07-20T18:30:51.243Z", "Version": "string" } ]}

Create or update a project based policy


This endpoint is deprecated, please use the new upsert policy endpoint.
Create or update a project based policy. A maximum of 500 non-expired statements per policy can be created/updated.
Authorizations
ServiceAccount (unity.project_resource_policy.update)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.project_resource_policy.update

Path parameters for "Create or update a project based policy"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

Request body for "Create or update a project based policy"

Media Type:
application/json

statements

array[object]
No description

Sid

string
required
example: statement_id1
Statement ID. Consists of alphanumeric characters and hyphen, and must be of length between 6 and 60 chars.

Action

array[string]
required
User action against which the policy statement will be applicable. Allowable values are "Read", "Write", "*", "Vivox:JoinMuted", "Vivox:JoinAllMuted, "Vivox:JoinWithConsent", "Vivox:JoinWithConsent".

Effect

string
required
Effect of the policy statement. Allowable values are "Allow" and "Deny"

Principal

string
required
The principal the statement applies to, Allowed values are "Player" and "Unauthenticated"

Resource

string
required
example: urn:ugs:cloud-save:*
Uniform resource name of the resource(s) being targeted by the policy. The format is
urn:ugs:<service-name>:/<path>
. For example,
urn:ugs:*
targets all services. Some other examples are
  • urn:ugs:cloud-code:/v1/projects/*/scripts/*
  • urn:ugs:economy:/*

ExpiresAt

string
example: 2020-07-20T18:30:51.243Z
UTC time (ISO 8601 extended format) when the policy expires

Version

string
No description

HTTP response status codes for "Create or update a project based policy":

Code samples for "Create or update a project based policy":

Request example

curl -X PATCH \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "statements": [ { "Sid": "statement_id1", "Action": [ "string" ], "Effect": "string", "Principal": "string", "Resource": "urn:ugs:cloud-save:*", "ExpiresAt": "2020-07-20T18:30:51.243Z", "Version": "string" } ]}' \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/resource-policy"

Response example

{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ], "requestId": "aad109f8-033f-4a24-8b77-5032eb3a6158"}

Delete policy statement(s)


This endpoint is deprecated, please use the new delete policy statements endpoint.
Delete policy statement(s) for project-based policy.
Authorizations
ServiceAccount (unity.project_resource_policy.update)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.project_resource_policy.update

Path parameters for "Delete policy statement(s)"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

Request body for "Delete policy statement(s)"

Media Type:
application/json

statementIDs

array[string]
required
example: ["statementId1","statementId2"]
Array of statement IDs which are to be deleted from the policy

HTTP response status codes for "Delete policy statement(s)":

Code samples for "Delete policy statement(s)":

Request example

curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "statementIDs": [ "statementId1", "statementId2" ]}' \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/resource-policy:delete-statements"

Response example

{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ], "requestId": "aad109f8-033f-4a24-8b77-5032eb3a6158"}

Get a player based policy


This endpoint is deprecated, please use the new get player policy endpoint.
A policy consists of multiple policy statements. This endpoint will return a Policy object containing an array of all non-expired policy statements in that policy.
Authorizations
ServiceAccount (unity.player_resource_policy.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.player_resource_policy.get

Path parameters for "Get a player based policy"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

playerId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0c
ID of the player

HTTP response status codes for "Get a player based policy":

Code samples for "Get a player based policy":

Request example

curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/players/{playerId}/resource-policy"

Response example

{ "playerId": "HgIZuzj0MwDwPO062o0BSVxAcFAV", "statements": [ { "Sid": "statement_id1", "Action": [ "string" ], "Effect": "string", "Principal": "string", "Resource": "urn:ugs:cloud-save:*", "ExpiresAt": "2020-07-20T18:30:51.243Z", "Version": "string" } ]}

Create or update a player based policy


This endpoint is deprecated, please use the new upsert player policy endpoint.
Create or update a player based policy. A maximum of 500 non-expired statements per policy can be created/updated.
Authorizations
ServiceAccount (unity.player_resource_policy.update)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.player_resource_policy.update

Path parameters for "Create or update a player based policy"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

playerId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0c
ID of the player

Request body for "Create or update a player based policy"

Media Type:
application/json

statements

array[object]
No description

Sid

string
required
example: statement_id1
Statement ID. Consists of alphanumeric characters and hyphen, and must be of length between 6 and 60 chars.

Action

array[string]
required
User action against which the policy statement will be applicable. Allowable values are "Read", "Write", "*", "Vivox:JoinMuted", "Vivox:JoinAllMuted", "Vivox:JoinWithConsent".

Effect

string
required
Effect of the policy statement. Allowable values are "Allow" and "Deny"

Principal

string
required
The principal the statement applies to, Allowed value is "Player"

Resource

string
required
example: urn:ugs:cloud-save:*
Uniform resource name of the resource(s) being targeted by the policy. The format is
urn:ugs:<service-name>:/<path>
. For example,
urn:ugs:*
targets all services. Some other examples are
  • urn:ugs:cloud-code:/v1/projects/*/scripts/*
  • urn:ugs:economy:/*

ExpiresAt

string
example: 2020-07-20T18:30:51.243Z
UTC time (ISO 8601 extended format) when the policy expires

Version

string
No description

HTTP response status codes for "Create or update a player based policy":

Code samples for "Create or update a player based policy":

Request example

curl -X PATCH \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "statements": [ { "Sid": "statement_id1", "Action": [ "string" ], "Effect": "string", "Principal": "string", "Resource": "urn:ugs:cloud-save:*", "ExpiresAt": "2020-07-20T18:30:51.243Z", "Version": "string" } ]}' \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/players/{playerId}/resource-policy"

Response example

{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ], "requestId": "aad109f8-033f-4a24-8b77-5032eb3a6158"}

Delete policy statement(s)


This endpoint is deprecated, please use the new delete player policy statements endpoint.
Delete policy statement(s) for player-based policy.
Authorizations
ServiceAccount (unity.player_resource_policy.update)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.player_resource_policy.update

Path parameters for "Delete policy statement(s)"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

playerId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0c
ID of the player

Request body for "Delete policy statement(s)"

Media Type:
application/json

statementIDs

array[string]
required
example: ["statementId1","statementId2"]
Array of statement IDs which are to be deleted from the policy

HTTP response status codes for "Delete policy statement(s)":

Code samples for "Delete policy statement(s)":

Request example

curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "statementIDs": [ "statementId1", "statementId2" ]}' \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/players/{playerId}/resource-policy:delete-statements"

Response example

{ "title": "Bad Request", "status": 400, "detail": "Something is wrong", "details": [ { "code": "ERROR_CODE_123", "path": "nested.value", "message": "Invalid value" } ], "requestId": "aad109f8-033f-4a24-8b77-5032eb3a6158"}

Get all player based policies in project


This endpoint is deprecated, please use the new get all player policies endpoint.
This endpoint returns all player based policies which belong to a specific project and environment.
By default, the API returns 5 results per page. The number of results per page can be customized by including the limit query parameter in the request. To retrieve subsequent pages of results, pass the next query parameter, the value of which will be provided in the response body of the first paginated response.
Authorizations
ServiceAccount (unity.player_resource_policy.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: unity.player_resource_policy.get

Path parameters for "Get all player based policies in project"

projectId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0b
ID of the project

environmentId

string
required
example: 8bdacc33-6eef-4577-beb0-633c86259f0a
ID of the environment

Query parameters for "Get all player based policies in project"

limit

integer
example: 5
max results per page - is ignored if
next
query parameter is provided

next

string
example: eyJuZXh0IjoiNTliZDIwYjItMWE5My00Y2YxLWJhZWYtYWY3ZTJiNThmZGY2IiwibGltaXQiOjN9
pagination token for requesting next page of results

HTTP response status codes for "Get all player based policies in project":

Code samples for "Get all player based policies in project":

Request example

curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/access/v1/projects/{projectId}/environments/{environmentId}/players/resource-policy"

Response example

{ "next": "eyJuZXh0IjoiNTliZDIwYjItMWE5My00Y2YxLWJhZWYtYWY3ZTJiNThmZGY2IiwibGltaXQiOjN9", "results": [ { "playerId": "HgIZuzj0MwDwPO062o0BSVxAcFAV", "statements": [ { "Sid": "statement_id1", "Action": [ null ], "Effect": "string", "Principal": "string", "Resource": "urn:ugs:cloud-save:*", "ExpiresAt": "2020-07-20T18:30:51.243Z", "Version": "string" } ] } ]}

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.