> ## Documentation Index
> Fetch the complete documentation index at: https://vms.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Make your first API request

> Create an API key and read your workspace with the REST API.

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

Guide my first API request.

Guide me to create an API key with the workspace:read scope.
Give me the TypeScript code for GET /v1/workspace.
Do not ask me to share the key.

## 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.](https://mintcdn.com/vms-c6f4e5ac/kvsBm-leIVQYZQAw/images/workspace/api-keys/01-create-api-key-light.png?fit=max\&auto=format\&n=kvsBm-leIVQYZQAw\&q=85\&s=524e2fdb6dad87d3c48f1574614ca536)

**2. Send the request**

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

```typescript TypeScript theme={null}
const response = await fetch("https://vms.dev/api/v1/workspace", {
  headers: { Authorization: "Bearer <your-api-key>" },
});

console.log(response.status, await response.json());
```

```bash cURL theme={null}
curl https://vms.dev/api/v1/workspace \
  -H "Authorization: Bearer <your-api-key>"
```

## Check the result

The API returns status 200 and the workspace:

```json theme={null}
{
  "id": "RRe4VqZEvVmRRJ6c4cWO2JMDA2EWO0BA",
  "name": "Acme Inc",
  "slug": "acme",
  "website": "acme.com",
  "language": "en",
  "createdAt": "2026-11-15T22:26:13.708Z"
}
```

If the API returns an error, see the [error codes](https://vms.dev/docs/api-reference/introduction.md#errors).

Read the [changelog.](https://vms.dev/docs/changelog.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.