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

# Monitor Tenant

> Get usage statistics for a tenant – object counts.

## When to use it

* **Verify ingestion** – confirm data landed after upload (expect `row_count` to grow)
* **Capacity planning** – track storage growth over time
* **Billing reconciliation** – generate usage reports

## Endpoint

* **Auth:** Bearer token
* **Idempotency:** Read-only
* **Async:** No

## Example

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl 'https://api.hydradb.com/tenants/monitor?tenant_id=my_first_tenant' \
    -H "Authorization: Bearer <your_api_key>"
  ```

  ```typescript TypeScript SDK theme={"dark"}
  const stats = await client.tenant.monitor({
    tenant_id: "my_first_tenant"
  });
  ```

  ```python Python SDK theme={"dark"}
  stats = client.tenant.monitor(tenant_id="my_first_tenant")
  ```
</CodeGroup>

## Query parameters

| Name        | Type   | Required | Description            |
| ----------- | ------ | -------- | ---------------------- |
| `tenant_id` | string | Yes      | The tenant to inspect. |

## Response

```json theme={"dark"}
{
  "tenant_id": "my_first_tenant",
  "normal_collection": {
    "row_count": 1243
  },
  "memory_collection": {
    "row_count": 87
  },
  "message": "Successfully retrieved tenant collection statistics"
}
```

| Field                         | Description                                   |
| ----------------------------- | --------------------------------------------- |
| `tenant_id`                   | The tenant that was queried.                  |
| `normal_collection.row_count` | Number of chunks in the knowledge collection. |
| `memory_collection.row_count` | Number of chunks in the memory collection.    |

## Related endpoints

* **Before this:** [Check infra status](/api-reference/endpoint/infra-status) – confirm the tenant is provisioned
* **Related:** [List data](/api-reference/endpoint/list-data) – browse stored content

## Errors

Common codes: `400 INVALID_PARAMETERS`, `404 TENANT_NOT_FOUND`. See [Error Responses](/api-reference/error-responses) for the full list.


## OpenAPI

````yaml GET /tenants/monitor
openapi: 3.1.0
info:
  title: HydraDB API
  description: REST APIs for the HydraDB retrieval engine
  version: 0.0.1
servers:
  - url: https://api.hydradb.com
    description: Production
    x-fern-server-name: hydradb-prod
security: []
paths:
  /tenants/monitor:
    get:
      tags:
        - tenants
        - tenants
        - Monitor & infra status
      summary: Get Tenant Stats
      operationId: get_tenant_stats_tenants_monitor_get
      parameters:
        - name: tenant_id
          in: query
          required: true
          schema:
            type: string
            title: Tenant Id
            description: Unique identifier for the tenant/organization
            example: tenant_1234
          description: Unique identifier for the tenant/organization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantStatsResponse'
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '403':
          description: Forbidden - Access denied
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '422':
          description: Unprocessable Entity - Validation failed
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
      security:
        - HTTPBearer: []
components:
  schemas:
    TenantStatsResponse:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
          description: Tenant identifier
          example: tenant_1234
        normal_collection:
          $ref: '#/components/schemas/CollectionStats'
          description: Statistics for the normal (context) collection
        memory_collection:
          $ref: '#/components/schemas/CollectionStats'
          description: Statistics for the memory collection
        message:
          type: string
          title: Message
          description: Summary message
          default: Successfully retrieved tenant collection statistics
      type: object
      required:
        - tenant_id
        - normal_collection
        - memory_collection
      title: TenantStatsResponse
    cortex__models__response__commons__ActualErrorResponse:
      properties:
        detail:
          $ref: >-
            #/components/schemas/cortex__models__response__commons__ErrorResponse
      type: object
      required:
        - detail
      title: ActualErrorResponse
    CollectionStats:
      properties:
        row_count:
          type: integer
          title: Row Count
          description: Number of rows in the collection
          example: 1
        dimensions:
          type: integer
          title: Dimensions
          description: Number of dimensions in the collection
          example: 1
      type: object
      required:
        - row_count
        - dimensions
      title: CollectionStats
    cortex__models__response__commons__ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: false
          example: true
        message:
          type: string
          title: Message
          default: Error occurred
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ErrorResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````