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

# Workspace Voice Consumption

> Total voice agent cost of one workspace over a date range, in credits. endDate is inclusive and can be at most 31 days after startDate. The workspace must belong to the API token's company.

Get the total voice cost of one workspace over a date range. The figure is the
sum of the actual cost of every voice agent call in the workspace for the range,
returned in credits.

Use [List Workspaces](https://docs.unleashx.ai/api-reference/workspaces/workspace-list.md) to find the
`workspaceId` to pass.

## API Endpoint

**GET** `/api/v1/global/workspace-voice-consumption/{workspaceId}`

**Base URL:** `https://www.tryunleashx.com`

**Authentication:** Required (Token header: `token` or `api_access_token`)

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `workspaceId` | integer | Yes | Workspace to report on. Must belong to the API token's company |

## Query Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `startDate` | string | Yes | First day of the range, `YYYY-MM-DD`. Counted from `00:00:00` |
| `endDate` | string | Yes | Last day of the range, `YYYY-MM-DD`. Inclusive, counted up to `23:59:59` |

`endDate` must be on or after `startDate`, and no more than 31 days after it.

## Success Response

**Status Code:** `200 OK`

```json theme={null}
{
  "error": false,
  "code": 200,
  "message": "",
  "timestamp": 1769243432947,
  "data": {
    "workspaceId": "363",
    "startDate": "2026-11-01",
    "endDate": "2026-11-30",
    "totalCost": 1284.5,
    "unit": "credits"
  }
}
```

## Response Fields

| Field | Type | Description |
| - | - | - |
| `workspaceId` | string | The workspace id from the request path |
| `startDate` | string | Start of the range, as sent |
| `endDate` | string | End of the range, as sent |
| `totalCost` | number | Total voice cost for the range, in credits. `0` when the workspace had no voice calls |
| `unit` | string | Always `credits` |

## What Is Counted

* Only calls made by **voice agents** (agent type 3) in the workspace.
* The cost is the final charged cost of each call, converted to credits in your
  company's base currency. Each call is rounded up to a whole credit before it is
  added, the same way the consumption tables in the app work.
* Calls are matched on the time the call started, inside the date range.

## Access Control

The workspace must belong to the company of the API token. A token for one
company can never read the consumption of another company's workspace, and an
unknown or foreign `workspaceId` returns the same "not found" error.

## Errors

| Status | Message | Cause |
| - | - | - |
| `422` | `Invalid date format, expected YYYY-MM-DD` | `startDate` or `endDate` is not a real date in `YYYY-MM-DD` format |
| `422` | `endDate must be on or after startDate` | The range runs backwards |
| `422` | `Date range cannot be more than 31 days` | `endDate` is more than 31 days after `startDate` |
| `422` | `Workspace {workspaceId} not found` | The workspace does not exist in the token's company |
| `422` | A required-field message | `startDate` or `endDate` is missing |

## Example cURL

### Voice cost for November 2026

```bash theme={null}
curl -X GET "https://www.tryunleashx.com/api/v1/global/workspace-voice-consumption/363?startDate=2026-11-01&endDate=2026-11-30" \
  -H "token: <api_key>"
```

### A single day

```bash theme={null}
curl -X GET "https://www.tryunleashx.com/api/v1/global/workspace-voice-consumption/363?startDate=2026-11-15&endDate=2026-11-15" \
  -H "token: <api_key>"
```

## Notes

* Use several requests to cover a longer period, for example one per month.
* The result covers voice agent calls only. Chatbot, video and other agent usage
  is not included.
* The same data is available inside the app at
  `/api/transactions/workspace-voice-consumption/{workspaceId}` for signed-in
  users, who must also be an active member of the workspace.

## Related Operations

* [List Workspaces](https://docs.unleashx.ai/api-reference/workspaces/workspace-list.md) — find the `workspaceId`
* [Campaign Consumption](https://docs.unleashx.ai/api-reference/campaigns/campaign-consumption.md) — consumption of a single campaign


## OpenAPI

````yaml api-reference/openapi.json GET /workspace-voice-consumption/{workspaceId}
openapi: 3.1.0
info:
  title: >-
    UnleashX - Build human like conversations | Voice Agents | Automations | AI
    Workforce
  version: 1.0.0
  description: UnleashX - Your home for human like conversations
servers:
  - url: https://www.tryunleashx.com/api/v1/global/
security:
  - bearerAuth: []
paths:
  /workspace-voice-consumption/{workspaceId}:
    get:
      tags:
        - Workspaces
      summary: Workspace voice consumption (API token)
      description: >-
        Total voice agent cost of one workspace over a date range, in credits.
        endDate is inclusive and can be at most 31 days after startDate. The
        workspace must belong to the API token's company.
      parameters:
        - name: token
          in: header
          required: true
          description: API token for authentication
          schema:
            type: string
        - name: workspaceId
          in: path
          required: true
          description: Workspace to report on
          schema:
            type: integer
        - name: startDate
          in: query
          required: true
          description: First day of the range, YYYY-MM-DD (from 00:00:00)
          schema:
            type: string
            format: date
        - name: endDate
          in: query
          required: true
          description: Last day of the range, YYYY-MM-DD (inclusive, to 23:59:59)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Voice consumption retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspaceId:
                    type: string
                  startDate:
                    type: string
                  endDate:
                    type: string
                  totalCost:
                    type: number
                    description: Total voice cost for the range, in credits
                  unit:
                    type: string
                    example: credits
        '401':
          description: Unauthorized
        '422':
          description: >-
            Invalid date format, endDate before startDate, range longer than 31
            days, missing dates, or workspace not found in the token's company
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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