---
title: "Get all campaigns metrics"
description: "Retrieve aggregated usage metrics for a given account or across all accounts."
canonical: https://www.charitips.com/docs/api-reference/get-all-campaigns-metrics
---

# Get all campaigns metrics

`GET /v1/campaigns/metrics`

Retrieve aggregated usage metrics for a given account or across all accounts. These metrics match the ones displayed in the global impact dashboard and the global metrics widget. ⚠️ We recommend including the global metrics widget in your app instead for a better experience.

**Authentication**: Bearer access token.

## Parameters

- `createdAt_lt` (string (date-time)): Format: YYYY-MM-DDTHH:MM:SSZ.
- `createdAt_lte` (string (date-time)): Format: YYYY-MM-DDTHH:MM:SSZ.
- `createdAt_gt` (string (date-time)): Format: YYYY-MM-DDTHH:MM:SSZ.
- `createdAt_gte` (string (date-time)): Format: YYYY-MM-DDTHH:MM:SSZ.
- `accountId` (string, UUID): Id of the account. Only useful for Platform customers to get metrics for a specific account.
- `includeChildAccountsCampaigns` (boolean): Include child accounts' campaigns
- `includeMatchedDonationsInMetrics` (boolean): Include matched donations made by and charged to the beneficiary in the metrics

## Response 200

- `numberOfDonations` (number, required)
- `totalDonation` (number, required)
- `numberOfMatchedDonations` (number, required)
- `totalMatchedDonation` (number, required)
- `numberOfCharitiesWithDonations` (number, required)
- `usedDonationsMetric` (Metric, required)
  - `value` (number, required)
  - `percentage` (number, required)
- `sortedCharities` (SortedCharity[], required)
  - `charityId` (string, required)
  - `name` (string, required)
  - `logoUrl` (string, required)
  - `sustainableDevelopmentGoals` (string[], required) One of `NO_POVERTY`, `ZERO_HUNGER`, `GOOD_HEALTH_AND_WELL_BEING`, `QUALITY_EDUCATION`, `GENDER_EQUALITY`, `CLEAN_WATER_AND_SANITATION`, `AFFORDABLE_AND_CLEAN_ENERGY`, `DECENT_WORK_AND_ECONOMIC_GROWTH`, `INDUSTRY_INNOVATION_AND_INFRASTRUCTURE`, `REDUCED_INEQUALITIES`, `SUSTAINABLE_CITIES_AND_COMMUNITIES`, `RESPONSIBLE_CONSUMPTION_AND_PRODUCTION`, `CLIMATE_ACTION`, `LIFE_BELOW_WATER`, `LIFE_ON_LAND`, `PEACE_JUSTICE_AND_STRONG_INSTITUTIONS`, `PARTNERSHIPS_FOR_THE_GOALS`.
  - `impactIndicators` (OmitTypeClass[], required)
    - `userInvitationId` (string, required)
    - `firstName` (string, required)
    - `lastName` (string, required)
    - `email` (string, required)
    - `phone` (string)
    - `status` (UserInvitationStatus, required) One of `PENDING`, `CLAIMED`, `CANCELED`.
    - `role` (Role, required) One of `ADMIN`, `MEMBER`, `PAYROLL_MANAGER`.
    - `accountId` (string, required)
    - `createdAt` (string (date-time), required)
    - `updatedAt` (string (date-time), required)
  - `numberOfDonations` (number, required)
  - `total` (number, required)
  - `percentage` (number, required)
  - `totalMatchedDonation` (number, required)
  - `latestDonation` (string (date-time), required)
- `sortedSdgs` (SortedSustainableDevelopmentGoal[], required)
  - `sustainableDevelopmentGoal` (string, required) One of `NO_POVERTY`, `ZERO_HUNGER`, `GOOD_HEALTH_AND_WELL_BEING`, `QUALITY_EDUCATION`, `GENDER_EQUALITY`, `CLEAN_WATER_AND_SANITATION`, `AFFORDABLE_AND_CLEAN_ENERGY`, `DECENT_WORK_AND_ECONOMIC_GROWTH`, `INDUSTRY_INNOVATION_AND_INFRASTRUCTURE`, `REDUCED_INEQUALITIES`, `SUSTAINABLE_CITIES_AND_COMMUNITIES`, `RESPONSIBLE_CONSUMPTION_AND_PRODUCTION`, `CLIMATE_ACTION`, `LIFE_BELOW_WATER`, `LIFE_ON_LAND`, `PEACE_JUSTICE_AND_STRONG_INSTITUTIONS`, `PARTNERSHIPS_FOR_THE_GOALS`.
  - `numberOfDonations` (number, required)
  - `total` (number, required)
  - `percentage` (number, required)
  - `charities` (LightCharity[], required)
    - `charityId` (string, required)
    - `name` (string, required)
    - `logoUrl` (string, required)
- `sortedImpactIndicators` (SortedImpactIndicator[], required)
  - `charityImpactIndicatorId` (string, required)
  - `singularLabel` (string, required)
  - `pluralLabel` (string, required)
  - `count` (number, required)
  - `total` (number, required)
  - `countMatchedDonation` (number, required)
  - `totalMatchedDonation` (number, required)
  - `name` (string, required)
  - `logoUrl` (string, required)
- `monthlyDonations` (MonthlyDonation[], required)
  - `name` (string, required)
  - `average` (number, required)
  - `averageMatchedDonation` (number, required)
- `nps` (NPS, required)
  - `promoters` (number, required)
  - `detractors` (number, required)
  - `neutrals` (number, required)
  - `score` (number, required)
- `rating` (Rating, required)
  - `average` (number, required)
- `comments` (Commment[], required)
  - `feedbackId` (string, required)
  - `comment` (string)
  - `charity` (CommentCharity, required)
    - `name` (string, required)
    - `logoUrl` (string, required)
  - `campaign` (CommentCampaign, required)
    - `name` (string, required)
    - `logoUrl` (string)
  - `donor` (CommentDonor, required)
    - `email` (string)
- `socialSharing` (SocialSharing, required)
  - `LINKEDIN` (SocialSharingMetric, required)
    - `count` (number, required)
    - `percentage` (number, required)
  - `INSTAGRAM` (SocialSharingMetric, required)
    - `count` (number, required)
    - `percentage` (number, required)
  - `FACEBOOK` (SocialSharingMetric, required)
    - `count` (number, required)
    - `percentage` (number, required)
  - `TWITTER` (SocialSharingMetric, required)
    - `count` (number, required)
    - `percentage` (number, required)
  - `WHATSAPP` (SocialSharingMetric, required)
    - `count` (number, required)
    - `percentage` (number, required)
- `emailMetrics` (EmailMetrics, required)
  - `sent` (Metric, required)
    - `value` (number, required)
    - `percentage` (number, required)
  - `opened` (Metric, required)
    - `value` (number, required)
    - `percentage` (number, required)
  - `clicked` (Metric, required)
    - `value` (number, required)
    - `percentage` (number, required)
  - `error` (Metric, required)
    - `value` (number, required)
    - `percentage` (number, required)
- `numberOfPublishedCampaigns` (number, required)
- `campaigns` (TopCampaignMetrics[], required)
  - `campaignId` (string, required)
  - `name` (string, required)
  - `numberOfDonations` (number, required)
  - `totalDonation` (number, required)
  - `percentage` (number, required)
  - `status` (string, required) One of `DRAFT`, `PENDING`, `ACTIVE`, `COMPLETE`, `CANCELED`.

## Errors

- 400 `Only one of accountId or includeChildAccountsCampaigns can be used`: Send `accountId` for the metrics of one account, or `includeChildAccountsCampaigns=true` to add your child accounts' campaigns to yours, not both. See https://www.charitips.com/docs/api-reference/get-all-campaigns-metrics.md.
- 400 `A field is missing, has the wrong type, or is not part of the request schema.`: `message` lists every problem. Unknown fields are rejected, not ignored: remove them rather than sending extra data. See https://www.charitips.com/docs/api-reference/errors.md.
- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.

## Example

```bash
curl -X GET https://api.sandbox.charitips.com/v1/campaigns/metrics \
  -H "Authorization: Bearer $CHARITIPS_TOKEN"
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/campaigns/metrics', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
  },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.get(
    "https://api.sandbox.charitips.com/v1/campaigns/metrics",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
)
response.raise_for_status()
data = response.json()
```

## Response example (200, placeholder values)

```json
{
  "numberOfDonations": 1,
  "totalDonation": 1,
  "numberOfMatchedDonations": 1,
  "totalMatchedDonation": 1,
  "numberOfCharitiesWithDonations": 1,
  "usedDonationsMetric": {},
  "sortedCharities": [],
  "sortedSdgs": []
}
```
