Enumerates the Workspace event volumes over time in minute increments.
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.events.getEventsVolumeFromWorkspace('DAY', '2021-10-28T00:00:00Z', '2021-10-29T16:40:00Z')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "path": "/observability/event_volume/v2.json",
- "query": {
- "workspaceId": "workspace-id",
- "startTime": "2023-01-01T00:00:00Z",
- "endTime": "2023-01-03T00:00:00Z",
- "granularity": "DAY"
}, - "result": [
- {
- "total": 32504646,
- "series": [
- {
- "time": "2023-01-01T00:00:00Z",
- "count": 15637147
}, - {
- "time": "2023-01-02T00:00:00Z",
- "count": 16867499
}
]
}
], - "pagination": {
- "current": "MA==",
- "totalEntries": 1
}
}
}