Usage Analytics

POST /api/v1/usage-analyticsRetrieves usage analytics data for API keys within your organization. This endpoint requires a root API key and can provide analytics for all API keys in the organization or for a specific API key if api_key_id is provided.HEADER PARAMETERS
REQUIREDX-Scrubs-Clinic-Api-Keystring
Your API key for authentication.
REQUIREDX-Scrubs-Clinic-Providerstring
Provider ID associated with your EHR application.
BODY PARAMETERS
REQUIREDstart_datestring
Start date for the analytics period in YYYY-MM-DD format.
REQUIREDend_datestring
End date for the analytics period in YYYY-MM-DD format.
OPTIONALapi_key_idstring
Optional. Specific API key ID to get analytics for. If not provided, returns analytics for all API keys in the organization.
Domain
BASE URL
1https://usescrubs.com
Sample Request
CURL
Node.JS
Python
Go
CURL
1curl --location --request POST 'https://usescrubs.com/api/v1/usage-analytics' \
2--header 'X-Scrubs-Clinic-Api-Key: your_root_api_key_here' \
3--header 'X-Scrubs-Clinic-Provider: your_provider_id' \
4--header 'Content-Type: application/json' \
5--data '{
6  "start_date": "2024-01-01",
7  "end_date": "2024-01-31"
8}'
9
10# To query specific API key:
11curl --location --request POST 'https://usescrubs.com/api/v1/usage-analytics' \
12--header 'X-Scrubs-Clinic-Api-Key: your_root_api_key_here' \
13--header 'X-Scrubs-Clinic-Provider: your_provider_id' \
14--header 'Content-Type: application/json' \
15--data '{
16  "api_key_id": "key_uuid_here",
17  "start_date": "2024-01-01",
18  "end_date": "2024-01-31"
19}'
Sample Response
JSON
1{
2  "api_key": null,
3  "total": {
4    "stt_duration": 120,
5    "tokens": 5000000,
6    "usage": 150
7  },
8  "deltas": {
9    "2024-01-15": {
10      "tokens": 1000000,
11      "usage": 25,
12      "stt_duration": 30
13    },
14    "2024-01-16": {
15      "tokens": 800000,
16      "usage": 20,
17      "stt_duration": 25
18    }
19  }
20}
Contact us: support@usescrubs.com