Skip to Content
Mutation APIAuthorization

Authorization

From this article, you’ll learn how to get access to the Prepr REST API.

To access the Prepr API you first need to authenticate your app with an OAuth bearer token.

A token provides scoped access to a single environment, you need to obtain another token for every new environment you want to access. Organizations with an Enterprise plan can create access tokens on the organization level.

We recommend using different access tokens for different applications or front end applications, for example, one for an iOS app and another for Android app. This allows you to revoke them individually in the future and manage access independently.

Sign in to your Prepr account Go to https://signin.prepr.io  and sign in with your Prepr account credentials. Then navigate to the Environment you want to use.

Create an Access token
Go to Settings → Access tokens and click the Add access token button.

Mutation access token example

Enter a Name and select the Rest API scopes to give the new token API access. In most cases just adding content_items is sufficient.

If you want to update content items, add the content_items_publish scope and make sure to set the Bound to user name to the user who’s responsible for this mutation project.

Click save and copy the generated access token to use later.

To authenticate the request include an Authorization HTTP header with the value of the access token you copied.

curl -v https://cdn.prepr.io/{{endpoint}} -H 'Authorization: Bearer sdfg...'

Or

curl -v https://api.eu1.prepr.io/{{endpoint}} -H 'Authorization: Bearer sdfg...'

If you fail to include a valid access token, the endpoint will return a status code 401.

Last updated on