Trigger an asynchronous multi-organization usage report export (API calls or automations) delivered by email.
Before You Begin
- GraphQL Playground:
🔗 All examples should be run in the GraphQL Playground.
➡️ New to GraphQL? Review the Playground Basics Guide. - Authentication:
🛠️ Use Service Account tokens (Personal Access Tokens are deprecated).
Prerequisites
- A role that grants the Usage Stats permission in each organization you want to include. This is the same permission that controls access to the Usage Statistics page in the Pipefy app — organizations where you do not have it are silently dropped from the export. Organization admins manage this under Roles & Permissions.
- Organization UUIDs for the orgs to aggregate (1 to 25 per request). Use
myUsageStatsOrganizationsto list eligible orgs.
Step 1. List the organizations you can export
The mutation expects an explicit list of organization UUIDs. The easiest way to obtain that list is the myUsageStatsOrganizations query:
{
myUsageStatsOrganizations {
uuid
name
}
}
Pick the uuid values you want to include and pass them to createMultiOrgUsageReportExport.
Step 2. Trigger the export
Use the createMultiOrgUsageReportExport mutation with the organization UUIDs, a period filter, and the usage tab you want to export.
mutation CreateMultiOrgUsageReportExport(
$organizationUuids: [ID!]!
$period: PeriodFilter!
$resourceType: MultiOrgUsageResource!
) {
createMultiOrgUsageReportExport(
input: {
organizationUuids: $organizationUuids
period: $period
resourceType: $resourceType
}
) {
status
}
}
Variables — API Calls tab (resourceType: api):
{
"organizationUuids": [
"8a1c4f10-1111-4d2c-9c2a-abc123def456",
"b27d5e21-2222-4a3b-8d1b-def456abc789"
],
"period": "current_month",
"resourceType": "api"
}
Variables — Automations tab (resourceType: automation):
{
"organizationUuids": [
"8a1c4f10-1111-4d2c-9c2a-abc123def456",
"b27d5e21-2222-4a3b-8d1b-def456abc789"
],
"period": "current_month",
"resourceType": "automation"
}
Input explanation:
-
organizationUuids: List of organization UUIDs to aggregate. Must contain between 1 and 25 entries. Only organizations where the authenticated user has Usage Stats access are included; unknown or unauthorized UUIDs are ignored.
-
period: Time window for the report. One of
current_month,last_month, orlast_3_months. -
resourceType: Which Multi-Org Usage Stats view to export:
Value Report Availability apiAPI calls usage Available automationAutomation jobs usage Available ai_creditAI credits usage Not yet available
Sample response:
{
"data": {
"createMultiOrgUsageReportExport": {
"status": "created"
}
}
}
- status:
createdwhen the export was accepted. The report is generated asynchronously and emailed to the requesting user when ready. There is no polling query or download URL in the mutation response.
Key Notes
- Email delivery: Unlike
exportOrganizationMembersorcreateAutomationJobsExport, this mutation does not return a download URL. Check the email inbox of the authenticated user for the spreadsheet download link when processing completes. - Report contents: Both report types are delivered as XLSX files and include a Company name column so rows from different organizations are easy to read. The automations report lists automation usage details and job counts; AI automations are not included. The API calls report lists call counts by organization, user, and operation.
- Partial org lists: If some UUIDs are unknown or you lack Usage Stats access, the export still proceeds with the authorized subset.
- Unsupported
resourceType: Passingai_creditreturns a GraphQL error onresourceType, for exampleunsupported resource type: ai_credit. - Mutation not available: If the operation is not enabled for your organization, GraphQL may respond with an error such as
Field 'createMultiOrgUsageReportExport' doesn't exist on type 'Mutation'. - Preview before exporting: Use
apiUsageStatsCombinedandautomationsUsageDetailsCombinedto review the on-screen data for the same organizations and period.

