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

# Use your admin bearer

> Call the Sariva REST API using the admin bearer printed by setup-secret.sh.

ⓘINFO

**After the Helm deployment — not a wizard prompt.** This page verifies that the Sariva platform Service is reachable and that your `SARIVA_PLATFORM_API_KEY` can authenticate to the REST API.

ⓘINFO

**On the [Linux VM (Docker) path](https://sariva.mintlify.site/deploy/vm-docker-cc.md)** there is no `setup-secret.sh` and no port-forward: the bearer is the `SARIVA_PLATFORM_API_KEY` value *you* set in `.env`, the API is already at `http://localhost:8000`, and you export the bearer with `export SARIVA_PLATFORM_API_KEY=$(grep ^SARIVA_PLATFORM_API_KEY .env | cut -d= -f2)`. Sections 3–4 below and the key-minting commands then apply unchanged with `--api-url http://localhost:8000`; skip sections 1–2.

You already have the admin REST bearer. On the Kubernetes paths it is the `sariva_...` value printed by `setup-secret.sh` after it created the `sariva-platform-extras` Secret.

On startup, the Sariva pod reads `SARIVA_PLATFORM_API_KEY` and seeds its HMAC digest into `platform.db` as a `platform_admin` key. That means the value authenticates the REST API immediately. You do **not** need to `kubectl exec` into the pod to mint the first key.

## 1. Confirm the Service name

Customers should not have to guess the Service name. List the Service created by the Helm release:

```bash theme={null}
kubectl -n sariva-platform get svc
```

For the standard install command, the Service is normally named:

```text theme={null}
sariva-platform
```

You can also discover it from the Helm release labels:

```bash theme={null}
export SARIVA_SERVICE="$(kubectl -n sariva-platform get svc \
  -l app.kubernetes.io/instance=sariva-platform,app.kubernetes.io/name=sariva-platform \
  -o jsonpath='{.items[0].metadata.name}')"

echo "$SARIVA_SERVICE"
```

Expected result:

```text theme={null}
sariva-platform
```

ⓘINFO

If you installed the chart with a different Helm release name, `nameOverride`, or `fullnameOverride`, the Service name may be different. Use the `kubectl get svc` command above as the source of truth.

## 2. Open a local port-forward

The default Sariva Service is internal to the cluster. Use `kubectl port-forward` from your workstation:

```bash theme={null}
kubectl -n sariva-platform port-forward "svc/${SARIVA_SERVICE:-sariva-platform}" 8000:8000
```

Keep this terminal open while you run REST or CLI commands from a second terminal.

## 3. Check platform health

In a second terminal, call the health endpoint through the local port-forward:

```bash theme={null}
curl -sS http://127.0.0.1:8000/api/v1/health
```

Expected result: HTTP `200` with a JSON response similar to:

```json theme={null}
{
  "status": "healthy",
  "version": "...",
  "llm_reachable": true,
  "llm": { "state": "ok", ... },
  "db_reachable": true,
  "kafka_clusters": {}
}
```

Right after a restart `llm.state` can read `unknown` (with `llm_reachable: false`) until the first model call returns; `billing` or `auth` there means the AI backend's account needs attention — see [the REST API health fields](https://sariva.mintlify.site/api-mcp/rest-api.md#health).

An empty `kafka_clusters` object is normal at this point if you have not connected or registered a Kafka cluster yet.

## 4. Validate the admin bearer

Now export the admin bearer that was printed by `setup-secret.sh` and call an authenticated endpoint that does not require any Kafka cluster to exist:

```bash theme={null}
export SARIVA_PLATFORM_API_KEY="sariva_<generated-admin-bearer>"

curl -sS -H "Authorization: Bearer $SARIVA_PLATFORM_API_KEY" \
  http://127.0.0.1:8000/api/v1/keys
```

Expected result: HTTP `200` with a JSON response listing API-key metadata. The response does **not** return plaintext keys. This confirms that the Sariva API is reachable and that your `SARIVA_PLATFORM_API_KEY` is valid.

⚠WARNING

Use the `sariva_...` value printed by `setup-secret.sh`. Do not use an old variable name, a GitHub token, a Confluent Cloud key, or a Slack token as the REST bearer.

The bearer is needed for app/cluster registration over REST, direct chat over `/v1/chat`, and the `sariva key` / `sariva cluster` REST commands. Slack-driven flows do not need this bearer from the end user because Slack identity is resolved separately.

## Mint more keys for teammates or services

You can mint additional API keys through REST. Reuse the local port-forward from the previous section:

```bash theme={null}
sariva key create \
  --api-url http://127.0.0.1:8000 \
  --user-id sre@example.com \
  --role platform_engineer
```

Other supported operations:

```bash theme={null}
sariva key list --api-url http://127.0.0.1:8000
sariva key revoke --api-url http://127.0.0.1:8000 --prefix <8-hex>
```

ⓘINFO

If the authenticated `/api/v1/keys` call returns `401`, confirm that you exported the same `SARIVA_PLATFORM_API_KEY` printed by `setup-secret.sh`, then restart the pod only if the Secret was changed after the pod started.

## Continue the deployment path

> [card] [Next: bootstrap GitOps and first apply](https://sariva.mintlify.site/install-setup/infrastructure.md)
>
> Push the generated scaffold, activate workflow templates, and let CI create or update cloud resources.

> [card] [Back to deployment path](https://sariva.mintlify.site/deploy/aws-eks-cc.md)
>
> Return to the supported deployment path checklist.


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