API Calls

The Segment Public API lets you get cumulative API call counts for a usage period.

Get Daily Per Source API Calls Usage

Provides daily cumulative per-source API call counts for a usage period.

Securitytoken
Request
query Parameters
period
required
string (period)

The start of the usage month in the ISO-8601 format.

This parameter exists in v1.

Example: period=2021-02-01
object (PaginationInput)

Pagination input for per Source API calls counts.

This parameter exists in v1.

Example: pagination=pagination.count=10
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/usage/api-calls/sources/daily
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.apiCalls.getDailyPerSourceAPICallsUsage('2021-02-01'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}

Get Daily Workspace API Calls Usage

Provides daily cumulative API call counts for a usage period.

Securitytoken
Request
query Parameters
period
required
string (period)

The start of the usage month in the ISO-8601 format.

This parameter exists in v1.

Example: period=2021-02-01
object (PaginationInput)

Pagination input for Workspace API call counts.

This parameter exists in v1.

Example: pagination=pagination.count=10
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/usage/api-calls/daily
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.apiCalls.getDailyWorkspaceAPICallsUsage('2021-02-01'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}