# Analytics

The Partner API provides aggregate analytics across all your sub-organizations. Use these metrics to monitor portfolio performance, track identification volume, and manage credit usage.

## Overview

Partner analytics aggregate data from every sub-organization under your partner account. You can filter by date range to analyze usage over specific periods. These endpoints are intended for reporting, dashboards, and operational monitoring.

## Available Endpoints

| Endpoint               | Purpose                                          |
| ---------------------- | ------------------------------------------------ |
| GET /partner/analytics | Aggregate analytics across all sub-organizations |
| GET /partner/usage     | Usage summary for a date range                   |

## Analytics Response

**GET** `/partner/analytics` returns aggregate metrics. Query parameters:

| Parameter | Type       | Description                                          |
| --------- | ---------- | ---------------------------------------------------- |
| startDate | date (ISO) | Start of the analytics period (default: 30 days ago) |
| endDate   | date (ISO) | End of the analytics period (default: today)         |

### Response Fields

| Field                | Description                                 |
| -------------------- | ------------------------------------------- |
| partnerId            | Your partner account ID                     |
| startDate            | Start date of the analytics period          |
| endDate              | End date of the analytics period            |
| totalOrganizations   | Total number of sub-organizations           |
| activeOrganizations  | Number of active sub-organizations          |
| totalIdentifications | Total visitor identifications in the period |
| creditsRemaining     | Credits remaining in your pool              |
| creditsUsed          | Credits consumed in the period              |

### Example Request

```
GET https://api.app.bullseye.so/api/v1/partner/analytics?startDate=2024-01-01&endDate=2024-01-31
X-Partner-API-Key: <your-api-key>
```

### Example Response

```json
{
  "partnerId": "550e8400-e29b-41d4-a716-446655440000",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "totalOrganizations": 12,
  "activeOrganizations": 10,
  "totalIdentifications": 4523,
  "creditsRemaining": 5477,
  "creditsUsed": 4523
}
```

## Usage Summary

**GET** `/partner/usage` returns a usage summary for a date range. Query parameters:

| Parameter | Type       | Description                                  |
| --------- | ---------- | -------------------------------------------- |
| startDate | date (ISO) | Start date (default: start of current month) |
| endDate   | date (ISO) | End date (default: today)                    |

### Response Fields

| Field         | Description                        |
| ------------- | ---------------------------------- |
| totalQuantity | Total usage quantity in the period |
| totalEvents   | Total number of events             |

Use this endpoint for billing reconciliation and usage reporting when you need event-level or quantity-level summaries.

## Date Range Filtering

Both endpoints accept ISO 8601 date format (e.g., `2024-01-01`). The date range is inclusive: both the start and end dates are included in the results.

* **Analytics** — Defaults to the last 30 days if no parameters are provided
* **Usage** — Defaults to the start of the current month through today

## Use Cases

| Use Case               | Endpoint           | Notes                                         |
| ---------------------- | ------------------ | --------------------------------------------- |
| Portfolio overview     | /partner/analytics | Total orgs, identifications, credits          |
| Monthly reporting      | /partner/analytics | Set startDate and endDate to month boundaries |
| Billing reconciliation | /partner/usage     | Align with your billing period                |
| Credit monitoring      | /partner/analytics | Track creditsRemaining and creditsUsed        |
| Growth tracking        | /partner/analytics | Compare periods to measure growth             |

## Related Endpoints

For organization-level or billing-specific data:

* **GET** `/partner/billing` — Billing configuration and credit pool info
* **GET** `/partner/billing/usage` — Current billing period usage
* **GET** `/partner/organizations` — List sub-organizations (filter by status, search, externalId)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bullseye.so/partner-program/analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
