curl --request GET \
--url https://agents.labs.bandwidth.com/api/v1/organizations/usage/runs/report \
--header 'Authorization: Bearer <token>'import requests
url = "https://agents.labs.bandwidth.com/api/v1/organizations/usage/runs/report"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agents.labs.bandwidth.com/api/v1/organizations/usage/runs/report', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<string>{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Export usage runs
Download filtered run usage as CSV.
curl --request GET \
--url https://agents.labs.bandwidth.com/api/v1/organizations/usage/runs/report \
--header 'Authorization: Bearer <token>'import requests
url = "https://agents.labs.bandwidth.com/api/v1/organizations/usage/runs/report"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agents.labs.bandwidth.com/api/v1/organizations/usage/runs/report', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<string>{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}text/csv attachment, not JSON. Save it to a file; recording/transcript and phone-number columns can contain sensitive workspace data.Authorizations
Bandwidth Labs OAuth access token. Uses the user's selected workspace; the workspace header is not required. Do not also send an API key. Bearer-only operations may additionally require the Labs super_user role.
Headers
Required with X-BW-LABS-AGENTS-API-KEY: the positive local workspace ID to access. The key owner must be a current member. Missing or invalid IDs return 400; non-member workspaces return 403. Not required for bearer authentication, which uses the user's selected workspace.
Query Parameters
ISO 8601 date-time string (UTC). Lower bound (inclusive) on created_at.
ISO 8601 date-time string (UTC). Upper bound (inclusive) on created_at.
JSON-encoded array of filter objects. Each object has the shape:
{ "attribute": "<name>", "type": "<type>", "value": <value> }
Supported attribute / type / value combinations:
| attribute | type | value shape | matches |
|---|---|---|---|
runId | number | { "value": 12345 } | exact run id |
workflowId | number | { "value": 42 } | exact agent (workflow) id |
campaignId | number | { "value": 7 } | exact campaign id |
callerNumber | text | { "value": "415555" } | substring match on initial_context.caller_number |
calledNumber | text | { "value": "9911848" } | substring match on initial_context.called_number |
dispositionCode | multiSelect | { "codes": ["XFER", "DNC"] } | any of the codes in gathered_context.mapped_call_disposition |
duration | numberRange | { "min": 60, "max": 300 } | call duration (seconds), inclusive bounds |
Unknown attributes and unsupported type values are silently ignored.
Date filtering on this endpoint is done via the dedicated start_date / end_date query params, not via a dateRange filter object.
Response
CSV download
The response is of type string.