# Authorization of the API

> How to generate User Tokens and Service Tokens for Roadie API access

*Published: 2024-01-16*


Roadie supports two types of API tokens: **User Tokens** and **Service Tokens**. Both use bearer token authentication and provide the same API access.

## User Tokens

User tokens are tied to your personal Roadie account. They're ideal for local development, personal scripts, and MCP server connections from your IDE.

### Prerequisites

You need to have the "Roadie API Key Access" policy assigned to your user in Roadie to create a user token.

### Generate a User Token

1. Go to **Administration → Account**
2. Navigate to the **Roadie API Access** section
3. Add a token description
4. Click **Generate Token**
5. Copy and store the token securely — it won't be shown again

## Service Tokens

Service tokens are not tied to any individual user account. They're designed for automated systems like CI/CD pipelines, shared integrations, and team tooling where you don't want the token to depend on a specific person's account.

### Generate a Service Token

1. Go to **Administration → Service Tokens**
2. Click **Create Service Token**
3. Add a description for the token
4. Click **Generate**
5. Copy and store the token securely — it won't be shown again

## Using Your Token

```shell
curl \
  -X GET \
  -H 'Accept: application/json' \
  -H "Authorization: bearer ${ROADIE_API_TOKEN}" \
  https://api.roadie.so/api/catalog/entities
```

For write operations using PUT, POST, or PATCH requests with a request body, we expect a JSON structure. You should modify your calls to include the `Content-Type` header.

```shell
curl \
  -X POST \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: bearer ${ROADIE_API_TOKEN}" \
  -d '{ "key": "value" }'
  https://api.roadie.so/api/catalog/fragments
```

Both user tokens and service tokens work identically in API requests.
