Metrics
Get Organization Metrics
Get public metrics for one or more organizations
POST
This API requires an API key with appropriate permissions. See API Key Documentation for more details.
Quick Start
Authentication
Include your API key in the Authorization
header:
Example Request
Access Control
The API enforces strict access control based on your API key type:
-
Organization API Keys:
- Can only access metrics for their associated organization
- Must match the
organizationSlug
exactly - Example: An API key for “acme-org” can only query metrics for “acme-org”
-
User API Keys:
- Can access metrics for any organization where the user is a member
- Requires the user to be an active member of the queried organization
- Example: A user who is a member of both “acme-org” and “beta-org” can query metrics for both organizations
If you attempt to query an organization without proper permissions, you will receive a 403 Forbidden error with the message: “You do not have permission to access metrics for this organization”
Example Implementation
API Details
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
organizationSlug | string | Yes | Organization slug to query |
startDate | Date | No | Start date for metrics (default: all time) |
endDate | Date | No | End date for metrics (default: current date) |
Response Format
Error Handling
Status Code | Description |
---|---|
401 Unauthorized | Invalid or missing API key |
403 Forbidden | API key does not have permission to query the requested organization |
500 Internal Server Error | Server error occurred while processing the request |
Notes
- If no date range is provided, metrics will be returned for all time
- The API only returns metrics for a single organization per request
- Organization API keys can only access metrics for their associated organization
- User API keys can access metrics for any organization where the user is a member
- To query multiple organizations, you must use a user API key and ensure the user is a member of all organizations you wish to query
Authorizations
Your API key. This is required by most endpoints to access our API programatically. Reach out to us at support@chainpatrol.io to get an API key for your use.
Response
200
application/json
Successful response
Was this page helpful?