# get_analytics_key

Source: https://modulify.ai/docs/mcp/analytics/get-analytics-key

Returns the analytics API key of a site in plain text, minting one if the site never had one.

- Title: Reveal the analytics API key
- Scope: `credentials:reveal`
- Access: Makes changes

This is the server-only credential the site's own server code uses to read its visitor analytics. The site receives it as the locked `MODULIFY_ANALYTICS_KEY` variable, next to `MODULIFY_ANALYTICS_URL`, and the response carries it as `analyticsKey` with the API address as `apiUrl`. The key only reads analytics: it cannot change collection, clear data or touch anything else.

It comes back in full, so it lands wherever the response goes, an AI client's transcript included. The tool tells the client never to print it, never to put it in a page, a client component or a committed file, never to send it anywhere you did not ask for, and to reach for it only when you explicitly ask to see or copy your key. That is why it sits behind `credentials:reveal`, which is unticked by default.

It needs the **Delete projects** permission in the workspace, so a role without it is refused with a `403` and `You are not allowed to see the analytics API key for this site!` It makes no analytics lookup. See [API access](https://modulify.ai/docs/grow/analytics#api-access).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |