PLANS / get-organization-spend-via-org-api

Plans

Get organization spend with the Organization API

Read per-member included pool spend across linked teams with POST https://api.cursor.com/organizations/spend. Each row is tagged with its owning teamId. Official reference: Organization API → Get Spending Data.

Authenticate with an Organization API key (Basic auth, key as username, empty password). Needs usage:* (or admin:*). Enterprise only. Numbers use the same included-spend definition as Get pooled usage, over the organization contract window (returned in period).

The team Admin route POST /teams/spend reports a single team’s billing cycle and includes cycle-only fields this org route omits (subscriptionCycleStart, overallSpendCents, fastPremiumRequests, hardLimitOverrideDollars, monthlyLimitDollars). Use that how-to for one-team cycle views: Get team spend.

Request

curl -X POST https://api.cursor.com/organizations/spend \
  -u YOUR_ORGANIZATION_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123",
    "sortBy": "spendCents",
    "sortDirection": "desc",
    "page": 1,
    "pageSize": 25
  }'
Field Rules
organizationId Required. Public org id. Must match the key’s organization
teamIds Optional. Org-linked team ints to include. Omit for the whole pool. At most 100 teams
sortBy Optional. email, name, or spendCents. Default: email
sortDirection Optional. asc or desc. Default: asc
page Optional. 1-indexed. Default: 1
pageSize Optional. 1–1000. Default: 100

Response

{
  "teamMemberSpend": [
    {
      "userId": "user_abc123",
      "teamId": 101,
      "name": "Alex",
      "email": "developer@company.com",
      "role": "member",
      "spendCents": 2450
    },
    {
      "userId": "user_def456",
      "teamId": 202,
      "name": "Sam",
      "email": "admin@company.com",
      "role": "owner",
      "spendCents": 1875
    }
  ],
  "totalMembers": 15,
  "totalPages": 1,
  "period": {
    "startDate": 1735689600000,
    "endDate": 1767225600000
  }
}
Field Meaning
userId Encoded id with user_ prefix
teamId Owning linked team
name / email / role Display name, email, role on that team
spendCents Included pool spend in cents for this member over the org contract window
totalMembers / totalPages Paging totals
period.startDate / endDate Contract window in epoch milliseconds

Pitfalls

  • Every teamIds entry must belong to the organization or the request is rejected.
  • Poll usage routes at most once per hour; rate limit is 20 requests per minute.
  • Cross-check totals with pool.usedCents from pooled-usage — member rows should reconcile to the same included definition.
  • Page with page / pageSize when totalPages is greater than 1.