# Authentication

Source: https://developers.novilabs.com/start/authentication/

> Every Novi credential type side by side, where each is used, how long it lasts and how to rotate it.

Each product takes its own credential today.

## Compare credentials

| Credential | Used for | How you send it | Lifetime | Rotate or revoke |
| --- | --- | --- | --- | --- |
| [Snowflake login](#snowflake-login-and-token) | Novi UDM Data reader account: Snowflake web interface, drivers, BI tools | Snowflake sign-in | A temporary password you change at first sign-in | Not published yet |
| Your own Snowflake users | Novi UDM Data shared into your Snowflake account | Your Snowflake sign-in | Your account's policy | Your Snowflake administrator |
| [Snowflake programmatic access token](#snowflake-login-and-token) | Novi UDM Data over HTTPS | `Authorization: Bearer` header | Reader-account starter token: 14 days by default. Replace it with a 365-day token | Remove and add the token with `ALTER USER` |
| [Key pair](https://developers.novilabs.com/data/delivery/#connection-for-a-bi-or-lakehouse-tool) [Preview] | Novi UDM Data BI or lakehouse connection | Private key file in your tool | While your subscription is active. The download link lasts 72 hours | Not published yet |
| [Novi API token](#novi-api-token) | Novi Forecasts API and its MCP server, M&A Intelligence MCP server | `Authorization: Bearer` header | 1 to 365 days. The Forecasts app offers 7, 30 or 90 days, 1 year, or custom; 90 days is the default | Revoke on the API tokens page; it stops working within two minutes. Create a new one to rotate |
| [Novi sign-in for assistants](#novi-sign-in-for-assistants) [Preview] | MCP servers for Forecasts, EVA and M&A Intelligence | Your assistant signs you in | 30 days | Sign in again. Removing Access MCP cuts access within about two minutes |
| [EVA Developer API Token](#eva-developer-api-token) | Novi EVA REST API | `x-api-key` header | Not published yet | Not published yet |

Keep every credential in an environment variable or a secret manager. Never put one in code, a URL or a shared notebook. See [Security](https://developers.novilabs.com/platform/security/).

## Snowflake login and token

In a reader account, each person gets a login by welcome email and signs in with role `DATA_READER`. For SQL over HTTPS, send a programmatic access token as a bearer token to your account URL followed by `/api/v2/statements`.

```bash title="Novi UDM Data over HTTPS"
curl -X POST "$NOVI_SNOWFLAKE_URL/api/v2/statements" \
  -H "Authorization: Bearer $NOVI_SNOWFLAKE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"statement": "SELECT COUNT(*) FROM NOVI_WELLS.WELL", "warehouse": "NOVI_WH", "database": "NOVI_DATA_ACCESS"}'
```

The reader-account starter token lasts 14 days by default: [replace it](https://developers.novilabs.com/data/delivery/#replace-the-starter-token) with a one-year token. On your own Snowflake account, the setup script's optional step issues the token.

## Novi API token

A Novi API token acts as one person, with that person's access.

<Screenshot name="api-tokens-create" alt="The Create a token form: a name, and expiry choices of 7, 30 or 90 days, 1 year or custom, with 90 days selected." width={768} height={278} caption="Create a token in the Forecasts app under Settings, then API tokens." />

```bash title="Novi Forecasts API"
curl -sS --fail-with-body \
  -H "Authorization: Bearer $NOVI_API_TOKEN" \
  "$NOVI_API_BASE/me"
```

<TokenLifecycle />

- **Create** it in the Forecasts app under **Settings**, then **API tokens**. You need the Access MCP permission to see that page.
- **Copy it when you create it.** Novi shows it only once.
- **Format:** tokens start with `novi_pat_`, which helps secret scanners find one committed by mistake.
- **Revoke** it on the same page. Anything using it stops working within two minutes.
- **Issued for you:** an administrator with user-management rights can also issue a token for a user. It acts as that user.
- **Limits:** no token can create or manage tokens. Novi API tokens don't work on the EVA MCP server or the EVA REST API.

Read-only service tokens not tied to a person are [Planned].

## Novi sign-in for assistants

[Preview]

Your assistant signs you in with your Novi login; you paste no token.

1. Add the server URL to your assistant.
2. Your browser opens Novi sign-in. Sign in as usual.
3. Novi's consent page shows the client, the product, your company, your email and how long the sign-in lasts. Approve it.
4. The assistant can now use that product at your company, through its MCP server only. The sign-in does not work on Novi's REST APIs or other products.

You need Access MCP and the product's own permission. Supported clients: Claude (claude.ai and Claude Desktop), Claude Code and OpenAI Codex. Sign-in uses OAuth 2.1 with PKCE. Setup: [Connect an assistant](https://developers.novilabs.com/ai/connect/).

## EVA Developer API Token

Create it on EVA's **Organization Settings** page and send it in the `x-api-key` header. It acts for your EVA organization.

```bash title="Novi EVA REST API"
curl -s "$NOVI_EVA_API_BASE/v1/data/fields?group=Header" \
  -H "x-api-key: $NOVI_EVA_API_KEY"
```

`NOVI_EVA_API_BASE` is the base URL on the [EVA REST API](https://developers.novilabs.com/eva/api/) page.

> **Note:**
> The variable names on this page are placeholders. Set them from your welcome email, your Novi host and the token pages above.
