---
title: Programmatic Access
sidebar:
  order: 3
---
## Personal Access Token [#access-token-section]

In order to configure programmatic access to your Roboto account, you can create an access token.

[Login](https://app.roboto.ai/signin) to your Roboto account, and follow these instructions:

1. Navigate to the [Tokens](https://app.roboto.ai/settings/tokens) tab on the Settings page.
2. Fill out the *Create a new access token* section and click *Create*.

You will see a modal window appear with your new token. Save it to `~/.roboto/config.json` on your machine. You will not be able to see it again.

Your `~/.roboto/config.json` file should look like this:

```bash
{
    "version": "v1",
    "profiles": {
        "prod": {
            "api_key": "robo_pat_123456789"
        }
    },
    "default_profile": "prod"
}
```

You can then install the [Roboto SDK & CLI](/docs/getting-started/programmatic-access#cli-section) to interact with your account programmatically.

### Restricting a Token [#token-scopes-section]

A token you create in the web app can do everything your account can. When a token goes somewhere you trust less, such as a script that only uploads data, you can restrict it with **API scopes** when you create it through the SDK:

- `datasets.create`: create datasets.
- `files.upload` and `files.import`: add files to datasets, by uploading them or importing them from your own storage.
- `api.everything_else`: every other endpoint.

A token holding all four scopes, or created without any, is unrestricted.

```python
from roboto.auth.scope import ApiScope
from roboto.domain.tokens import Token

token, secret = Token.create(
    name="uploader",
    api_scopes=ApiScope.minimal_uploader(),
)
```

Some endpoints, such as AI chat, accept only unrestricted tokens. The [REST API reference](/docs/reference/rest-api) lists the scopes each endpoint needs under "Access control". A restricted token cannot create a token that may do more than it can, and its scopes never give it more than your account itself may do.

## Device Access Token [#device-token-section]

Access tokens for robots and other entities can be provisioned using the instructions in [Devices](/docs/learn/devices).

## SDK & CLI [#cli-section]

The [Roboto SDK](https://github.com/roboto-ai/roboto-python-sdk/) is a Python library that provides access to Roboto. The CLI is distributed separately as a standalone binary; in a Python environment with the SDK installed, it can also be run as `python -m roboto.cli`.

Learn more at [SDK & CLI](/docs/learn/sdk) and refer to the latest [installation instructions](https://github.com/roboto-ai/roboto-python-sdk/tree/main?tab=readme-ov-file#install) available on GitHub.

## REST API

The Roboto REST API is a JSON API that also provides programmatic access to Roboto.

See reference documentation for the [REST API](/docs/reference/rest-api).
