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

# Diagnostics

> Use the PowerSync Diagnostics API to inspect replication status and sync health.

All self-hosted PowerSync Service instances ship with a Diagnostics API.
This API provides the following diagnostic information:

* Connections → Connected backend source database and any active errors associated with the connection.
* Active Sync Streams / Sync Rules → Currently deployed Sync Streams (or legacy Sync Rules) and its status.

## CLI

If you have the [PowerSync CLI](/tools/cli) installed, use `powersync status` to check instance status without calling the API directly. This works with any running PowerSync instance — local or remote.

```bash theme={null}
powersync status

# Extract a specific field
powersync status --output=json | jq '.connections[0]'
```

## Diagnostics API

# Configuration

1. To enable the Diagnostics API, specify an API token in your PowerSync YAML file:

```yaml service.yaml theme={null}
api:
  tokens:
    - YOUR_API_TOKEN
```

<Warning>Make sure to use a secure API token as part of this configuration</Warning>

2. Restart the PowerSync Service.

3. Once configured, send an HTTP request to your PowerSync Service Diagnostics API endpoint. Include the API token set in step 1 as a Bearer token in the Authorization header.

```shell theme={null}
curl -X POST http://localhost:8080/api/admin/v1/diagnostics \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```
