Quickstart
Create an organization, give a program its own identity, get an access token and make your first API call.
In this quickstart you create an organization in the console, create a service user with an API key, exchange the key for an access token, and list your organization's workspaces through the API.
You sign in to the console with your Hexel account. Hexel Studio doesn't issue personal access tokens for use outside the console, so scripts, servers and tools call the API as a service user: a non-human identity that belongs to your organization and has only the permissions you give it.
- Sign in and create an organization
Open console.hexelstudio.com and sign in, or sign up for a Hexel account. See Your Hexel account for the sign-in methods.
If you don't belong to an organization yet, the console asks you to create one. Hexel Studio creates the organization with a Default workspace that has a Production and a Development environment, and makes you its owner.
- Create a service user
In the console, open IAM > Service Users and choose Create service user.
- Give it a name that says what it's for, for example
quickstart. - On the Policies step, select Workspace Read-Only Access (
WorkspaceReadOnlyAccess). It allows one action,workspace:workspace:read, which is all this quickstart needs. - Create the service user.
A new service user can do nothing until a policy allows it. Attach only what it needs.
- Give it a name that says what it's for, for example
- Create an API key
On the service user's page, open Security Credentials and choose Create API Key. Name the key and pick an expiry: every key expires, after 90 days unless you choose another date, and at most one year from today.
Copy the key when it's shown. Hexel Studio shows it once and stores only a hash. Keep it in an environment variable:
Bash export API_KEY="studio_live_..." - Get an access token
Exchange the key for an access token at the token service:
Bash curl -X POST https://sts.hexelstudio.com/token \ -H "X-API-Key: $API_KEY" \ -d grant_type=api_keyResponse { "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6...", "refresh_token": "", "token_type": "Bearer", "expires_in": 900 }The token is valid for 15 minutes (
expires_inis in seconds) and belongs to the service user in your organization. There is no refresh token for a service user: when the token expires, exchange the key again.Bash export ACCESS_TOKEN="eyJhbGciOiJSUzI1NiIsImtpZCI6..." - Make your first API call
List the workspaces in your organization:
curl https://api.hexelstudio.com/v1/workspaces \ -H "Authorization: Bearer $ACCESS_TOKEN"const response = await fetch("https://api.hexelstudio.com/v1/workspaces", { headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN}` }, }); if (!response.ok) throw new Error(`HTTP ${response.status}`); const workspaces = await response.json(); console.log(workspaces);import os import requests response = requests.get( "https://api.hexelstudio.com/v1/workspaces", headers={"Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}"}, ) response.raise_for_status() print(response.json())The response is a JSON array of workspaces. A new organization has one:
Response [ { "id": "ws_3f9c1d2e8a7b4c6d9e0f1a2b3c4d5e6f", "organization_id": "org_7b2e4c1a9d8f4e3b8c6a5d4e3f2a1b0c", "name": "Default", "slug": "default", "is_default": true, "is_active": true, "created_by_user_id": "5d1e9a3c-7b2f-4e8d-9c6a-1f0e2d3c4b5a", "created_at": "2026-10-20T09:12:44.512Z", "updated_at": "2026-10-20T09:12:44.512Z" } ]You don't send an organization ID: it comes from the token. The
organization_idfield is your organization's ID, which some other calls need.
Call with the API key directly
You can also skip the token exchange and send the key on each request in the X-API-Key header:
curl https://api.hexelstudio.com/v1/workspaces \
-H "X-API-Key: $API_KEY"Hexel Studio exchanges the key for an access token on its side, so the request is decided exactly as if you had sent the token. This is convenient for scripts and occasional calls. For a workload that makes many calls, exchange the key once and reuse the token until it expires.
If something goes wrong
| Response | Cause |
|---|---|
401 with {"error":{"code":"401","message":"Invalid API key."}} | The key is wrong, revoked or expired, or its service user is inactive. |
401 from the token service with {"error":"invalid api key"} | The same, when you exchange the key at /token. |
403 with {"error":"forbidden"} | The caller is authenticated but no policy allows the action. Check the service user's policies. |
429 | You hit a rate limit. Wait the number of seconds in the Retry-After header. See Limits. |