Skip to main content
In this tutorial, you create an API key and read the name of your workspace.

Guide my first API request.

Before you start

  • You need the Owner or Admin role in the workspace.
  • You need Bun, Deno, or Node.js 22.18 or later to run the TypeScript code. You can also use curl in a terminal.
1

Create the key

In the rail, choose Settings, then API keys. Choose Create API key. Type a Name, choose Read for Workspace, then choose Create key. Copy the key.
The Create API key sheet with the Name field, the Expiration select set to 90 days, and the Workspace, Sandboxes, and Snapshots scopes.The Create API key sheet with the Name field, the Expiration select set to 90 days, and the Workspace, Sandboxes, and Snapshots scopes.
2

Send the request

Save the code in first-request.ts. Replace <your-api-key> with the key. Then run bun first-request.ts.

Check the result

The API returns status 200 and the workspace:
If the API returns an error, see the error codes.