> ## Documentation Index
> Fetch the complete documentation index at: https://prismeai-legacy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get v2workspaces usage

> Retrieve workspace usage stats



## OpenAPI

````yaml /api-reference/swagger.yml get /v2/workspaces/{workspaceId}/usage
openapi: 3.0.0
info:
  version: 1.0.0
  title: Prisme.ai APIs
  description: Prisme.ai APIs specifications
  termsOfService: https://www.prisme.ai/mentions-legales
  contact:
    name: Prisme.ai Support Team
    email: support@prisme.ai
    url: https://www.prisme.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.eda.prisme.ai
  - url: http://localhost:3001
security:
  - BearerAuth: []
  - WorkspaceApiKeyAuth: []
  - BearerAuth: []
    WorkspaceApiKeyAuth: []
paths:
  /v2/workspaces/{workspaceId}/usage:
    get:
      tags:
        - Prisme.ai Events
      description: Retrieve workspace usage stats
      operationId: workspaceUsage
      parameters:
        - name: workspaceId
          in: path
          description: ID of workspace to listen to
          required: true
          schema:
            type: string
        - name: afterDate
          in: query
          description: Retrieve usage stats after this ISO8601 formatted date.
          required: true
          schema:
            type: string
        - name: beforeDate
          in: query
          required: true
          description: Retrieve usage stats before this ISO8601 formatted date.
          schema:
            type: string
        - name: interval
          in: query
          description: >-
            If specified, this field will add a field to the result containing
            the usage over time at the specified interval. The queried data will
            be found in the timeseries field.
          schema:
            type: string
            enum:
              - month
              - day
        - name: details
          in: query
          description: Includes individual appInstances details
          schema:
            type: boolean
      responses:
        '200':
          description: Success Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceUsage'
        '400':
          description: Bad parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadParametersError'
        '401':
          description: AuthenticationError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '403':
          description: Bad permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Object not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectNotFoundError'
components:
  schemas:
    WorkspaceUsage:
      type: object
      required:
        - workspaceId
        - beforeDate
        - afterDate
        - total
        - apps
      properties:
        workspaceId:
          type: string
        beforeDate:
          type: string
        afterDate:
          type: string
        interval:
          type: string
        total:
          $ref: '#/components/schemas/UsageMetrics'
        timeseries:
          type: array
          items:
            properties:
              date:
                type: string
              total:
                $ref: '#/components/schemas/UsageMetrics'
              apps:
                type: array
                items:
                  $ref: '#/components/schemas/AppUsageMetrics'
        apps:
          type: array
          items:
            $ref: '#/components/schemas/AppUsageMetrics'
    BadParametersError:
      type: object
      properties:
        error:
          type: string
          example: BadParameters
        message:
          type: string
        details: {}
    AuthenticationError:
      type: object
      properties:
        error:
          type: string
          example: AuthenticationError
        message:
          type: string
          example: Unauthenticated
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: ForbiddenError
        message:
          type: string
          example: Forbidden
    ObjectNotFoundError:
      type: object
      properties:
        error:
          type: string
          example: ObjectNotFound
        message:
          type: string
    UsageMetrics:
      type: object
      required:
        - transactions
        - httpTransactions
        - eventTransactions
        - scheduleTransactions
        - sessions
        - users
      additionalProperties: false
      properties:
        transactions:
          type: number
        httpTransactions:
          type: number
        eventTransactions:
          type: number
        scheduleTransactions:
          type: number
        sessions:
          type: number
        users:
          type: number
    AppUsageMetrics:
      type: object
      required:
        - slug
        - total
      properties:
        slug:
          type: string
        total:
          type: object
          required:
            - custom
          properties:
            custom:
              type: object
              additionalProperties: true
        appInstances:
          type: array
          items:
            type: object
            required:
              - slug
              - total
            properties:
              slug:
                type: string
              total:
                type: object
                required:
                  - custom
                properties:
                  custom:
                    type: object
                    additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key

````