Create Multi-Org Usage Report Export

Trigger an asynchronous multi-organization usage report export (API calls or automations) delivered by email.

Before You Begin

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 myUsageStatsOrganizations to 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, or last_3_months.

  • resourceType: Which Multi-Org Usage Stats view to export:

    ValueReportAvailability
    apiAPI calls usageAvailable
    automationAutomation jobs usageAvailable
    ai_creditAI credits usageNot yet available

Sample response:

{
  "data": {
    "createMultiOrgUsageReportExport": {
      "status": "created"
    }
  }
}
  • status: created when 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 exportOrganizationMembers or createAutomationJobsExport, 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: Passing ai_credit returns a GraphQL error on resourceType, for example unsupported 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 apiUsageStatsCombined and automationsUsageDetailsCombined to review the on-screen data for the same organizations and period.