Events

Get Events Volume from Workspace

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.

Securitytoken
Request
query Parameters
granularity
required
string (granularity)

The size of each bucket in the requested window.

This parameter exists in v1.

Enum: "DAY" "HOUR" "MINUTE"
Example: granularity=DAY
startTime
required
string (startTime)

The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive.

This parameter exists in v1.

Example: startTime=2021-10-28T00:00:00Z
endTime
required
string (endTime)

The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts.

This parameter exists in v1.

Example: endTime=2021-10-29T16:40:00Z
groupBy
Array of strings (groupBy)

A comma-delimited list of strings that represents the dimensions to group the result by. The options are: eventName, eventType and source.

This parameter exists in v1.

Example: groupBy=groupBy.0=eventType
sourceId
Array of strings (sourceId)

A list of strings which filters the results to the given SourceIds.

This parameter exists in v1.

eventName
Array of strings (eventName)

A list of strings which filters the results to the given EventNames.

This parameter exists in v1.

eventType
Array of strings (eventType)

A list of strings which filters the results to the given EventTypes.

This parameter exists in v1.

appVersion
Array of strings (appVersion)

A list of strings which filters the results to the given AppVersions.

This parameter exists in v1.

object (PaginationInput)

Pagination input for event volume by Workspace.

This parameter exists in v1.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/events/volume
Request samples
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)
}
Response samples
{
  • "data": {
    }
}