> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.adid.dev/llms.txt.
> For full documentation content, see https://docs.adid.dev/llms-full.txt.

# Issuer Analytics

#### 4.5.1. Dashboard Widgets ##### When to use

You want to see a quick snapshot of issuance and revocation activity for your DID(s).

##### Before you begin

Issuer role.

##### Steps

1. Navigate to `/issuer/analytics`.
   2\. The page renders:
   * **KPIs** — Issued (lifetime), Issued (30d), Revoked (30d), Active credentials.
   * **Issuance trend chart** — daily counts over selectable range.
   * **Revocation trend chart** — daily counts.
   * **Top schemas** — ranked by issuance volume.
   * **Recent activity** — last 50 events.

##### API

```bash
curl "https://adid.dev/api/v1/issuers/did:adi:0xOrg.../analytics?from=2026-03-26&to=2026-04-26" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

(Implemented at `issuer_analytics.go`, registered at `router.go:154`.)

Response (truncated):

```json
{
  "issuerDid":"did:adi:0xOrg...",
  "from":"2026-03-26","to":"2026-04-26",
  "issued":{ "total": 42, "byDay":[{"day":"2026-04-25","count":5},{"day":"2026-04-26","count":7}] },
  "revoked":{ "total": 3, "byDay":[...] },
  "activeCredentials": 39,
  "topSchemas":[{ "schemaId":"schema-uuid-1", "name":"OrganisationMembership", "issuedCount": 30 }]
}
```

#### 4.5.2. Issuance & Revocation Trends ##### Reading the charts

* **Stacked bars** for issuance show schemas as colour stacks — useful to spot which credential type is dominating volume.
* **Line + area** for revocation shows the running sum of active credentials.
* **Hover** any data point to see the exact count and a click-through to the underlying credentials.

> 💡 **Tip** — A sudden spike in revocations is often the signal of a key compromise. Set up an email alert at `/profile → Notifications → Daily revocation digest`.

#### 4.5.3. Activity Log ##### When to use

You want a per-event audit trail for compliance.

##### API

```bash
curl "https://adid.dev/api/v1/issuers/did:adi:0xOrg.../activity?limit=50&offset=0" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

(Implemented at `issuer_analytics.go`, registered at `router.go:155`.)

Response:

```json
{
  "data":[
    { "ts":"2026-04-26T11:59:01Z", "type":"issued",  "credentialId":"...", "subjectDid":"did:adi:0x9a2c...", "schemaId":"..." },
    { "ts":"2026-04-26T12:05:12Z", "type":"revoked", "credentialId":"...", "reason":"employment terminated" }
  ],
  "total": 50
}
```

##### Export

Click **Download CSV** in the activity panel for a CSV export covering the current filter range. Output is signed with the platform's audit key for downstream non-repudiation.

##### Verify

Cross-reference the activity log against your own internal records. Counts should match.

##### Troubleshooting

| Symptom              | Cause                    | Fix                                    |
| -------------------- | ------------------------ | -------------------------------------- |
| Counts don't match   | Time-zone mismatch       | Activity log is in UTC.                |
| Some rows missing    | Filter too tight         | Reset filters.                         |
| `403 NOT_ISSUER_DID` | Caller is not the issuer | Sign in as the right DID's controller. |

***