Skip to navigation

Authentication

Authenticate API requests using an API key.

The CAD ROOMS API uses API keys for authentication. Each API key is associated with your user account and a specific workspace.

To authenticate your requests, include your API key in the Authorization header using the Bearer scheme:

Authorization: Bearer <apiKey>

For example, to retrieve a list of projects:

curl https://api.cadrooms.workers.dev/v1/projects \
-H "Authorization: Bearer <apiKey>"

All API requests must use HTTPS. Requests made over HTTP or without a valid API key will be rejected.

API key permissions

API keys inherit your existing permissions within the selected workspace. The API provides access to a subset of the functionality available in the CAD ROOMS app. Each endpoint returns only what your permissions allow in the app.

API keys do not have independent scopes or permissions. Each API endpoint specifies the minimum role required, such as Viewer or higher in the project or Workspace owner or admin.

If your permissions change or your access to the workspace is removed, the API key’s access is updated accordingly.

Keep your API key secure

Treat your API key like a password. Never expose it in client-side code, mobile apps, or source repositories.

For server-side integrations, store API keys in environment variables or a secrets manager.

If an API key is compromised, immediately revoke it in the CAD ROOMS app and create a new one.

Session tokens

All API endpoints also accept session tokens belonging to users signed in to the CAD ROOMS app. The app uses these tokens to authenticate its own API requests.

Include the session token in the same Authorization header:

Authorization: Bearer <sessionToken>

A session token inherits the user’s permissions across all workspaces they belong to, whereas an API key is limited to its associated workspace.

List and Create webhook endpoints act on one workspace. With a session token, send its workspaceId. With an API key, the key’s workspace is used.

Create an API key

  1. Open your avatar menu in the CAD ROOMS app and select Account Settings.
  2. Navigate to the API Keys tab and click New API key.
  3. Enter a name, select a workspace, and set an expiration date.
  4. Click Create.

Your API key is displayed only once. Copy and store it securely, as you will not be able to retrieve it later.

If you lose your API key, revoke it and create a new one.

For workspace administrators: Workspace owners and admins can view and revoke API keys associated with their workspace under Workspace > Settings > API Keys.

Authentication errors

The API returns the following HTTP status codes for authentication and permission-related errors:

  • 401 Unauthorized: The API key or session token is missing, invalid, expired, or revoked.
  • 403 Forbidden: The API key is valid, but the workspace plan does not support the requested feature.
  • 404 Not Found: The requested resource does not exist or is not accessible to your account. The API returns the same response in both cases.