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

# Authentication

> How to authenticate with the Enterprise Monitoring API

All Monitoring API endpoints require authentication, except for the health check endpoint (`GET /health`).

## Required role

You must have **admin** or **owner** role in the workspace to access the Monitoring API. Regular workspace members cannot access these endpoints.

Requests without the proper role return a `401 Unauthorized` error.

To learn about workspace roles, see [Managing your workspace members](/Account-and-billing/Managing-your-workspaces#managing-your-workspace-members).

## API key

The Monitoring API accepts both [personal API keys](#personal-api-key) and [workspace API keys](#workspace-api-key). Include an API key in the `api_key` header with all requests:

```bash theme={null}
api_key: YOUR_API_KEY
```

### Example request

```curl theme={null}
curl --request GET \
  --url http://localhost:3000/api/v1/monitoring/analytics/{workspace_id} \
  --header 'api_key: <api_key>'
```

### Personal API key

To get your personal API key:

1. Click your profile icon at the top right of your account.
2. Click **Settings**.
3. Select the **Account** tab.
4. Scroll down to the **API Key** section.

### Workspace API key

Enterprise workspaces can also use workspace API keys. To create one:

1. Click your workspace name at the top left and click **Settings**.
2. Click **Secrets** in the sidebar.
3. Click **+ Create API Key**.
4. Enter a name for the key and an optional description, then click **Create Key**.
5. Copy the key immediately and store it securely.

For the full guide, see [Managing workspace secrets](/Enterprise/workspace-secrets).

<Warning>
  Your API key provides access to your workspace data. Treat it like a password and do not share it or commit it to version control.
</Warning>
