> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agents.labs.bandwidth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export usage runs

> Download filtered run usage as CSV.

Use the same date and JSON-encoded filters as [List usage runs](https://docs.agents.labs.bandwidth.com/api-reference/usage/runs.md). The response is a streamed `text/csv` attachment, not JSON. Save it to a file; recording/transcript and phone-number columns can contain sensitive workspace data.


## OpenAPI

````yaml GET /api/v1/organizations/usage/runs/report
openapi: 3.1.0
info:
  title: Bandwidth Agent Builder API
  version: v1
  description: >-
    Manage agents, place calls, and retrieve conversation results in your
    workspace.
servers:
  - url: https://agents.labs.bandwidth.com
    description: Workspace API
security: []
paths:
  /api/v1/organizations/usage/runs/report:
    get:
      tags:
        - usage
      summary: Export usage runs
      description: >-
        **Authorization:** Accepts a Labs OAuth bearer token or a Labs API key.
        Workspace-scoped resources require membership in the requested
        workspace.


        Download filtered run usage as CSV.
      operationId: download_usage_runs_report_api_v1_organizations_usage_runs_report_get
      parameters:
        - description: >-
            ISO 8601 date-time string (UTC). Lower bound (inclusive) on
            `created_at`.
          in: query
          name: start_date
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              ISO 8601 date-time string (UTC). Lower bound (inclusive) on
              `created_at`.
            title: Start Date
        - description: >-
            ISO 8601 date-time string (UTC). Upper bound (inclusive) on
            `created_at`.
          in: query
          name: end_date
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              ISO 8601 date-time string (UTC). Upper bound (inclusive) on
              `created_at`.
            title: End Date
        - description: >
            JSON-encoded array of filter objects. Each object has the shape:


            ```json

            { "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.
          in: query
          name: filters
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >
              JSON-encoded array of filter objects. Each object has the shape:


              ```json

              { "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.
            title: Filters
        - description: >-
            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.
          in: header
          name: X-VOAI-ORGANIZATION-ID
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              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.
            title: X-Voai-Organization-Id
      responses:
        '200':
          content:
            text/csv:
              schema:
                type: string
          description: CSV download
        '400':
          description: Invalid request or missing/invalid workspace header with an API key.
        '401':
          description: Missing, invalid, or expired credential.
        '403':
          description: >-
            The account lacks access to the workspace, resource, or required
            role.
        '404':
          description: Not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - LabsAuth: []
        - LabsApiKey: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    LabsAuth:
      description: >-
        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.
      scheme: bearer
      type: http
    LabsApiKey:
      description: >-
        Bandwidth Labs API key. Also send `X-VOAI-ORGANIZATION-ID` with a
        positive local workspace ID belonging to the key owner. Access follows
        the owner's current workspace role. Do not also send a bearer token. API
        keys cannot access bearer-only or Labs `super_user` operations.
      in: header
      name: X-BW-LABS-AGENTS-API-KEY
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.