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

> Retrieves usage data for multi-tenant apps.

# Fetch usage

For the complete error reference, see [Error Guide](/rest-api/management-apis/error-codes).


## OpenAPI

````yaml post /apps/{appId}/usage
openapi: 3.0.0
info:
  title: Management APIs (Multi-Tenancy)
  description: Create and manage apps on-the-fly using our app management APIs
  version: '1.0'
servers:
  - url: https://apimgmt.cometchat.io
security: []
tags:
  - name: App
    description: The Rest collection for app.
  - name: Extensions
    description: The REST collections for extensions.
  - name: Extensions
    description: The REST collections for Chat widgets.
  - name: Extensions
    description: The REST collections for Giphy extension.
  - name: Extensions
    description: The REST collections for XSS Filter extension.
  - name: Extensions
    description: The REST collections for Image Moderation extension.
  - name: Extensions
    description: The REST collections for Report user extension.
  - name: Extensions
    description: The REST collections for Report message extension.
  - name: Extensions
    description: The REST collections for Sentiment analysis extension.
  - name: Extensions
    description: The REST collections for Voice transcription extension.
  - name: Extensions
    description: The REST collections for Stipop extension.
  - name: Extensions
    description: The REST collections for TinyURL extension.
  - name: Extensions
    description: The REST collections for Intercom extension.
  - name: Extensions
    description: The REST collections for Bitly extension.
  - name: Extensions
    description: The REST collections for Rich media preview extension.
  - name: Extensions
    description: The REST collections for Virus Malware Scanner extension.
  - name: Extensions
    description: The REST collections for Video Broadcasting extension.
  - name: Extensions
    description: The REST collections for Tenor gifs extension.
  - name: Extensions
    description: The REST collections for End-to-end encryption extension.
  - name: Extensions
    description: The REST collections for In-flight message moderation extension.
  - name: Extensions
    description: The REST collections for Stickers extension.
  - name: Extensions
    description: The REST collections for Data masking extension.
  - name: Extensions
    description: The REST collections for Email replies extension.
  - name: Extensions
    description: The REST collections for SMS Notification extension.
  - name: Extensions
    description: The REST collections for Push notification extension.
  - name: Extensions
    description: The REST collections for Chatwoot extension.
  - name: Extensions
    description: The REST collections for Message shortcuts extension.
  - name: Extensions
    description: The REST collections for Email Notification extension.
  - name: Team Management
    description: The REST collections for team management.
  - name: Settings
    description: The REST collections for Settings.
  - name: Extensions
    description: The REST collections for Profanity-filter extension.
  - name: Webhooks
    description: The REST collections for Webhooks.
  - name: Moderation
    description: The REST collections for Moderations.
paths:
  /apps/{appId}/usage:
    post:
      tags:
        - App
      summary: Fetch usage
      description: Retrieves usage data for multi-tenant apps.
      operationId: fetch-multi-tenant-usage
      parameters:
        - $ref: '#/components/parameters/key'
        - $ref: '#/components/parameters/secret'
        - name: appId
          in: path
          description: The parent appId to which the subscription is linked.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                usePreviousBillingCycle:
                  description: >-
                    Indicates whether the usage from the previous billing cycle
                    should be retrieved.


                    If set to false, the usage for the current cycle will be
                    fetched.


                    If set to true, the usage from the previous cycle will be
                    fetched.
                  type: boolean
              type: object
      responses:
        '200':
          description: Updated App
          content:
            application/json:
              schema:
                properties:
                  data:
                    properties:
                      '':
                        $ref: '#/components/schemas/appSchema'
                    type: object
                type: object
              example:
                data:
                  success: true
                  message: >-
                    Your usage request has been accepted and is being processed
                    for . You will receive an email with the details at
                    <emailID>@example.com
components:
  parameters:
    key:
      name: key
      in: header
      description: Authorization Key
      required: true
      schema:
        type: string
    secret:
      name: secret
      in: header
      description: Authorization Secret
      required: true
      schema:
        type: string
  schemas:
    appSchema:
      properties:
        id:
          type: string
        name:
          type: integer
        plan:
          type: integer
        trialEndsAt:
          type: integer
        state:
          type: string
        owner:
          type: integer
        region:
          type: string
        createdAt:
          type: integer
        appOwner:
          properties:
            id:
              type: string
            name:
              type: string
            email:
              type: string
          type: object
        appRegion:
          properties:
            id:
              type: string
            name:
              type: string
            description:
              type: string
          type: object
        apiKeys:
          properties:
            <API_KEY_1>:
              properties:
                apiKey:
                  type: string
                name:
                  type: string
                scope:
                  type: string
                createdBy:
                  type: string
              type: object
            <API_KEY_2>:
              properties:
                apiKey:
                  type: string
                name:
                  type: string
                scope:
                  type: string
                createdBy:
                  type: string
              type: object
          type: object
      type: object

````