Help Center

Create an API key and make your first request

The REST API lets your own code read and write the records in your app. You authenticate with an API key that you create in the app. The API needs the Business plan or above.

Create an API key

  1. Open Tools in the sidebar and choose Data & API.
  2. Open the API Keys tab.
  3. Click Create API Key.
  4. Enter a name that says what the key is for, such as "Website sync".
  5. Optionally set an expiration date.
  6. Tick the scopes the key needs. Pick at least one.
  7. Create the key and copy it straight away. You will not be able to see it again.

Keys start with usk_. Each key belongs to one app. If you have several apps in your workspace, create a key in each app you want to reach.

Who can make keys

Owners and admins can make keys, and can see and revoke every key in the app.

Anyone whose role has API keys switched on under Data & API in Roles & permissions can make keys too. They see and revoke only the keys they made, and a key they make can never do more than they can:

Owners and admins see these keys marked Member's key on the API Keys tab.

Scopes

A scope is a permission. Give a key only what it needs.

Other scopes cover tables, pages, actions and docs. A request that needs a scope the key does not have is answered with 403 and the message "Missing required scope".

Base URL and authentication

The base URL is:

```

https://unstack.us/api/v1

```

Send your key in the X-API-Key header on every request.

```bash

curl "https://unstack.us/api/v1/custom" \

-H "X-API-Key: usk_your_api_key"

```

This first request lists your tables. Each one has a slug, which is what you use in the URL to read and write its records.

```json

{

"data": [

{ "slug": "customers", "table_name": "customers", "schema": { } }

]

}

```

Keep keys safe

The API Keys tab shows when each key was last used, which helps you find keys nobody needs any more.

Full reference

The View API documentation link on the API Keys tab opens the full reference. The same reference is in the developer docs, and a machine-readable OpenAPI description is at https://unstack.us/api/v1/openapi.json.

Next: Read and write records with the REST API.