Skip to main content
All HTTP methods should be prepended by this service’s endpoint:
The Usage Monitoring endpoints are only available on https://api-v2.withleaf.io. Requests to https://api.withleaf.io/services/billingapplication return 404. Use an access_token from the OAuth2 flow described in Authentication.

Usage Monitoring Endpoints

Monitor your usage with these endpoints:

List your contracts

GET /billing/contracts Get a list of all usage monitoring contracts available for your organization. Each contract represents a different service or feature you can monitor.

Parameters

Both values are truncated to the start of the day (UTC). The filter matches contracts that fall entirely inside the range, not contracts that only overlap it. For example, afterStartDate=2026-10-01T00:00:00Z does not return a contract that started on 2026-02-17, even if it is still active. Without either parameter, the endpoint returns all your contracts. The endpoint has no other query parameters. It returns all matching contracts in one response, without paging. If you have no contracts, the response is 404 with the message Your account does not have any contracts available yet.... If you have contracts but none match the filters, the response is 404 with the message No contract matching your criteria was found.

Request

Response

Response fields:
  • id: Unique identifier for this contract
  • product: Which service this tracks
  • startDate: When usage monitoring began for this contract
  • endDate: When usage monitoring ends for this contract
  • region: Geographic region, if applicable

Get contract details

GET /billing/contracts/{contract_id} Get detailed information about a specific usage monitoring contract.

Parameters

Request

Response


Get daily usage summary

GET /billing/contracts/{contract_id}/consumption Get usage metrics for a specific contract for a single day. If you don’t specify a date, it returns today’s usage.

Parameters

Request

Response

Response fields:
  • areaUnit: Unit of measurement, Acre or Hectare
  • date: The date this usage data represents
  • totalUniqueArea: Total unique area processed, removing overlaps between users
  • leafUsersAreas: Breakdown of usage by individual users

Get usage range for your organization

GET /billing/contracts/{contract_id}/consumption/api-owner Get usage metrics for your entire organization over a date range. Shows daily breakdown of total and cumulative usage.

Parameters

Request

Response

Response fields:
  • areaUnit: Unit of measurement, Acre or Hectare
  • areaPerDay: Array of daily usage data
  • date: The date for this data point
  • totalArea: Cumulative area processed up to this date
  • dailyArea: New area processed on this specific date

Get usage range for specific user

GET /billing/contracts/{contract_id}/consumption/leaf-user/{leaf_user_id} Get usage metrics for a specific Leaf user over a date range. Shows how much area this user has processed day by day.

Parameters

Request

Response

Response fields:
  • areaUnit: Unit of measurement, Acre or Hectare
  • areaPerDay: Array of daily usage data for this user
  • date: The date for this data point
  • totalArea: Cumulative area processed by this user up to this date
  • dailyArea: New area processed by this user on this specific date
Last modified on November 23, 2026