# REST API tutorial

> Access Cloud Save data from any development environment with the REST API.

You can access data in Cloud Save using the REST API.

REST APIs provide more flexibility and allow you to automate your workflows by using your favorite language and game development engine or from a game server.

The Cloud Save service provides the following REST APIs:

* [Cloud Save Player API](https://services.docs.unity.com/cloud-save/) for player actions *(e.g. saving/loading data)*
* [Cloud Save Admin API](https://services.docs.unity.com/cloud-save-admin/) for admin actions *(e.g. configuring queries/indexes)*

> **Note:**
>
> There is a rate limit of 600 requests per player per minute to the Cloud Save service.

### Authentication

You can authenticate requests to the Cloud Save REST API using a [stateless token](#authenticate-using-a-stateless-token). Use the received token as a bearer token for HTTP authentication in the request header.

#### Authenticate using a stateless token

To use a stateless token, you need to create a service account and call the [Token Exchange API](https://services.docs.unity.com/auth/v1/#tag/Authentication/operation/exchangeToStateless) to obtain a stateless token with a limited lifespan.

### Calling the REST API

You can call a module endpoint using any HTTP library that is native to the codebase. Use the retrieved authentication token as a bearer token for HTTP authentication in the request header.

An example CURL request to save data to a player could look like this:

```bash
curl -X POST
  -H 'Authorization: Bearer <BEARER_TOKEN>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"key":"someKey","value":"someValue"}' \
  'https://cloud-save.services.api.unity.com/v1/data/projects/<PROJECT_ID>/players/<PLAYER_ID>/items'
```
