---
agentTools:
  projectIndex: https://developers.pipefy.com/llms.txt
---

# API Usage Stats

Retrieve the limit, filter date and the total usage of API calls or the usage broken down by operation name or token, to identify top consumers.

### **Before You Begin**

* **GraphQL Playground**:
  🔗 All examples should be run in the [GraphQL Playground](https://app.pipefy.com/graphiql).
  ➡️ New to GraphQL? Review the [Playground Basics Guide](https://developers.pipefy.com/reference/exploring-the-playground).
* **Authentication**:
  🛠️ Use [Service Account tokens](https://developers.pipefy.com/reference/service-accounts) *(Personal Access Tokens are deprecated)*.

### **Prerequisites**

* **Organization access**: You must have a `Super Admin` or `Admin` role on the organization.
* **Organization UUID**: You will need the organization’s UUID to run the query.

***

### **Step 1. Find the Organization UUID**

You need the organization’s UUID to query API usage. Run the query below, replacing `<ORGANIZATION_ID>` with your organization ID:

```graphql
{
  organization(id: "<ORGANIZATION_ID>") {
    uuid
  }
}
```

You can find the organization ID in the URL when viewing the organization in Pipefy: `https://app.pipefy.com/organizations/<ORGANIZATION_ID>`.

### **Step 2. Query API usage grouped by dimension**

Run the following query with your organization UUID, the desired time period, and the dimension to group by:

```graphql
query apiUsageStats(
  $organizationUuid: ID!
  $period: PeriodFilter!
  $dimension: GroupedAPIDimension
) {
  apiUsageStats(organizationUuid: $organizationUuid, period: $period, dimension: $dimension) {
    data {
      dimension
      metric
      __typename
    }
    filterDate {
      from
      to
    }
    limit
    __typename
  }
}
```

**Input Explanation**:

* **period**: Time window for the stats. Use `current_month`, `last_month`, or `last_3_months`.
* **dimension**: How to group the usage data:
  * **operation\_name**: Groups by the GraphQL operation name you set in your query (see [Operation names](https://developers.pipefy.com/reference/mastering-the-documentation-your-guide-to-queries-and-mutations#1-operation-name)). Queries without an operation name appear as `"Not specified"`.
  * **token**: Groups by the token used for the request (e.g. user/token name or service account name).
  * **when not passed or null**: Return the total count in that period

**Sample response (grouped by operation name)**:

```json
{
  "data": {
    "apiUsageStatsGroupedBy": {
      "data": [
        {
          "dimension": "Not specified",
          "metric": 130,
          "__typename": "MetricItem"
        },
        {
          "dimension": "GetUsage",
          "metric": 52,
          "__typename": "MetricItem"
        },
        {
          "dimension": "GetCards",
          "metric": 36,
          "__typename": "MetricItem"
        },
        {
          "dimension": "CreateCards",
          "metric": 35,
          "__typename": "MetricItem"
        },
        {
          "dimension": "UpdatePipe",
          "metric": 34,
          "__typename": "MetricItem"
        }
      ],
      "__typename": "APIUsageSummary"
    }
  }
}
```

**Sample response (grouped by token)**:

```json
{
  "data": {
    "apiUsageStatsGroupedBy": {
      "data": [
        {
          "dimension": "John - Python Integration",
          "metric": 167,
          "__typename": "MetricItem"
        },
        {
          "dimension": "HR Integration Bot",
          "metric": 120,
          "__typename": "MetricItem"
        }
      ],
      "filterDate": {
        "from": "2026-05-01T00:00:00Z",
        "to": "2026-05-27T17:04:01Z"
      },
      "limit": 1000,
      "__typename": "APIUsageSummary"
    }
  }
}
```

**Sample response (grouped only by period, with no dimension)**:

```json
{
  "data": {
    "apiUsageStatsGroupedBy": {
      "data": [
        {
          "metric": 717,
          "dimension": "Counter",
          "__typename": "MetricItem"
        }
      ],
      "filterDate": {
        "from": "2026-05-01T00:00:00Z",
        "to": "2026-05-27T17:04:01Z"
      },
      "limit": 1000,
      "__typename": "APIUsageSummary"
    }
  }
}
```

The response returns an array of `data` entries, each with a `dimension` value and a `metric` (API call count) and the dates this data applies to (`filterDate`). Results are limited to the top 10 entries for the chosen dimension.

It also includes the API calls `limit`, which does not consider the
dimension grouping.
-------------------