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

# Get the analytics summary

> Get the totals of the project for a time window: requests, flags, flag rate, allowed, rejected and sent to review, with the window before for the trend. Also the review queue backlog and a flag-rate spike, if there is one.



## OpenAPI

````yaml get /analytics/summary
openapi: 3.1.0
info:
  title: Moderation API
  description: >-
    Moderate text, images, video and audio in real time, manage authors, review
    queues and actions, and receive webhooks.
  version: 1.1.0
servers:
  - url: https://api.moderationapi.com/v1
security: []
tags:
  - name: Content
    description: Submit content for moderation.
  - name: Authors
    description: The users who create content, with their trust level and history.
  - name: Review queues
    description: Queues of content for human review, and their items.
  - name: Actions
    description: Moderation actions reviewers and rules can take.
  - name: Wordlists
    description: Custom word and phrase lists used by policies.
  - name: Webhooks
    description: Endpoints that receive events, and the events they receive.
  - name: Analytics
    description: Moderation numbers for a project, as on the dashboard overview.
  - name: Account
    description: The account that owns the API key.
  - name: Projects
    description: Projects in the organization. Needs an organization key.
  - name: Channels
    description: Channels in a project. Needs an organization key.
  - name: Voice
    description: Real-time voice moderation over WebSocket.
  - name: Feedback
    description: Send feature requests and product feedback to the Moderation API team.
externalDocs:
  url: https://docs.moderationapi.com
paths:
  /analytics/summary:
    get:
      tags:
        - Analytics
      summary: Get the analytics summary
      description: >-
        Get the totals of the project for a time window: requests, flags, flag
        rate, allowed, rejected and sent to review, with the window before for
        the trend. Also the review queue backlog and a flag-rate spike, if there
        is one.
      operationId: getAnalyticsSummary
      parameters:
        - in: query
          name: range
          schema:
            default: 30d
            description: >-
              The time window. `24h` is the last 24 hours, in hourly buckets.
              `7d`, `30d` and `90d` are whole UTC days that end with today, in
              daily buckets.
            type: string
            enum:
              - 24h
              - 7d
              - 30d
              - 90d
        - in: query
          name: channel
          schema:
            type: string
            description: >-
              A channel ID or key. Only count content from this channel. Leave
              out to count all channels.
        - in: header
          name: Project-Id
          required: false
          schema:
            type: string
          description: >-
            The project to act on, by ID or name. Required with an organization
            key unless the key reaches only one project; list projects with GET
            /projects. A project key acts on its own project and needs no value:
            naming another one is an error.
          x-speakeasy-name-override: projectId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  range:
                    type: string
                    enum:
                      - 24h
                      - 7d
                      - 30d
                      - 90d
                    description: The time window of the numbers.
                  channelId:
                    description: >-
                      The channel the numbers are for. Null when they are for
                      all channels.
                    type:
                      - string
                      - 'null'
                  totals:
                    type: object
                    properties:
                      requests:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests received. Every request counts, also repeats
                          and edits of the same content.
                      flagged:
                        type: integer
                        minimum: 0
                        description: Requests that were flagged.
                      flagRate:
                        type: number
                        minimum: 0
                        maximum: 1
                        description: >-
                          The share of requests that were flagged: flagged /
                          requests. 0 when there were no requests.
                      allowed:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests with the recommendation "allow". Includes
                          content that was not flagged.
                      rejected:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests with the recommendation "reject". All of them
                          were flagged.
                      sentToReview:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests with the recommendation "review". This counts
                          requests, not the deduplicated items in the review
                          queue.
                      handledAutomatically:
                        type: integer
                        minimum: 0
                        description: >-
                          Flagged requests that were settled without human
                          review: rejected plus flaggedButAllowed.
                      flaggedButAllowed:
                        type: integer
                        minimum: 0
                        description: >-
                          Flagged requests that were allowed without human
                          review.
                      distinctAuthors:
                        type: integer
                        minimum: 0
                        description: >-
                          Distinct authors that sent content in the window.
                          Approximate.
                    required:
                      - requests
                      - flagged
                      - flagRate
                      - allowed
                      - rejected
                      - sentToReview
                      - handledAutomatically
                      - flaggedButAllowed
                      - distinctAuthors
                    additionalProperties: false
                    description: >-
                      Request counts for the window. A flagged request has one
                      recommendation: allow, reject or review.
                  previousPeriod:
                    type: object
                    properties:
                      requests:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests received. Every request counts, also repeats
                          and edits of the same content.
                      flagged:
                        type: integer
                        minimum: 0
                        description: Requests that were flagged.
                      flagRate:
                        type: number
                        minimum: 0
                        maximum: 1
                        description: >-
                          The share of requests that were flagged: flagged /
                          requests. 0 when there were no requests.
                      allowed:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests with the recommendation "allow". Includes
                          content that was not flagged.
                      rejected:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests with the recommendation "reject". All of them
                          were flagged.
                      sentToReview:
                        type: integer
                        minimum: 0
                        description: >-
                          Requests with the recommendation "review". This counts
                          requests, not the deduplicated items in the review
                          queue.
                      handledAutomatically:
                        type: integer
                        minimum: 0
                        description: >-
                          Flagged requests that were settled without human
                          review: rejected plus flaggedButAllowed.
                      flaggedButAllowed:
                        type: integer
                        minimum: 0
                        description: >-
                          Flagged requests that were allowed without human
                          review.
                    required:
                      - requests
                      - flagged
                      - flagRate
                      - allowed
                      - rejected
                      - sentToReview
                      - handledAutomatically
                      - flaggedButAllowed
                    additionalProperties: false
                    description: >-
                      The same counts for the window of equal length just before
                      this one. Compare with `totals` to see the trend.
                  pendingReview:
                    type: integer
                    minimum: 0
                    description: >-
                      Items in the default review queue that nobody has reviewed
                      yet, counted as the queue counts them (repeats count
                      once). The queue looks back 30 days, so older items are
                      not included. The range does not change it.
                  flagRateSpike:
                    anyOf:
                      - type: object
                        properties:
                          multiple:
                            type: number
                            description: >-
                              How many times higher the recent flag rate is than
                              the baseline, for example 2.4.
                          recentFlagRate:
                            type: number
                            minimum: 0
                            maximum: 1
                            description: The flag rate in the last 2 days.
                          baselineFlagRate:
                            type: number
                            minimum: 0
                            maximum: 1
                            description: The flag rate in the 30 days before that.
                          recentFlagged:
                            type: integer
                            minimum: 0
                            description: Flagged requests in the last 2 days.
                          recentRequests:
                            type: integer
                            minimum: 0
                            description: Requests in the last 2 days.
                        required:
                          - multiple
                          - recentFlagRate
                          - baselineFlagRate
                          - recentFlagged
                          - recentRequests
                        additionalProperties: false
                      - type: 'null'
                    description: >-
                      Set when the flag rate of the last 2 days is at least 2
                      times the rate of the 30 days before, with at least 50
                      flagged requests. Null when there is no spike. Always for
                      the full project: the range and channel do not change it.
                required:
                  - range
                  - channelId
                  - totals
                  - previousPeriod
                  - pendingReview
                  - flagRateSpike
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionDeniedError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '429':
          description: >-
            Too many requests. Retry after the number of seconds in the
            `Retry-After` header.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
      security:
        - Authorization: []
components:
  schemas:
    BadRequestError:
      type: object
      description: The request is malformed or a parameter is invalid.
      properties:
        type:
          type: string
          const: invalid_request_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - invalid_request
            - project_id_required
            - project_name_ambiguous
            - validation_failed
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `invalid_request`: A parameter is invalid. `message` says which
            one.

            - `project_id_required`: An organization key called a project
            endpoint without naming the project in `Project-Id`, and the key
            reaches more than one project. `message` lists the projects it
            reaches.

            - `project_name_ambiguous`: The name in `Project-Id` fits more than
            one project the key reaches. `message` lists them; name the project
            by ID instead.

            - `validation_failed`: The request body does not match the schema.
            `issues` lists each problem with its `path`.
          example: invalid_request
        message:
          type: string
          description: Human-readable explanation.
          example: Invalid input data
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    AuthenticationError:
      type: object
      description: The API key is missing, invalid or revoked.
      properties:
        type:
          type: string
          const: authentication_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - unauthorized
            - missing_api_key
            - malformed_api_key
            - invalid_api_key
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `unauthorized`: Authentication failed.

            - `missing_api_key`: No API key in the `Authorization` header.

            - `malformed_api_key`: The `Authorization` header does not contain a
            valid key format.

            - `invalid_api_key`: The API key does not exist or was revoked.
          example: unauthorized
        message:
          type: string
          description: Human-readable explanation.
          example: Authorization not provided
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    PermissionDeniedError:
      type: object
      description: >-
        The API key cannot do this, or the plan limit for this resource is
        reached.
      properties:
        type:
          type: string
          const: permission_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - permission_denied
            - account_disabled
            - quota_exceeded
            - plan_feature_unavailable
            - plan_limit_exceeded
            - organization_key_required
            - missing_key_permission
            - project_not_reachable
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `permission_denied`: The API key cannot perform this request.

            - `account_disabled`: The organization account is disabled.

            - `quota_exceeded`: The organization has used all API requests on
            its plan.

            - `plan_feature_unavailable`: The current plan does not include this
            feature.

            - `plan_limit_exceeded`: The request goes over a limit of the
            current plan.

            - `organization_key_required`: This endpoint needs an organization
            API key, but a project key was used.

            - `missing_key_permission`: The organization key does not have the
            permission this endpoint needs.

            - `project_not_reachable`: The organization key is limited to other
            projects.
          example: permission_denied
        message:
          type: string
          description: Human-readable explanation.
          example: Insufficient access
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    NotFoundError:
      type: object
      description: The resource does not exist or the key cannot see it.
      properties:
        type:
          type: string
          const: not_found_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - resource_not_found
            - action_not_found
            - author_not_found
            - queue_not_found
            - queue_item_not_found
            - wordlist_not_found
            - webhook_not_found
            - project_not_found
            - channel_not_found
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `resource_not_found`: The resource does not exist.

            - `action_not_found`: The action does not exist.

            - `author_not_found`: The author does not exist.

            - `queue_not_found`: The review queue does not exist.

            - `queue_item_not_found`: The queue item does not exist in the
            project.

            - `wordlist_not_found`: The wordlist does not exist.

            - `webhook_not_found`: The webhook does not exist.

            - `project_not_found`: The project does not exist.

            - `channel_not_found`: The channel does not exist.
          example: resource_not_found
        message:
          type: string
          description: Human-readable explanation.
          example: Not found
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    RateLimitError:
      type: object
      description: >-
        Too many requests. Retry after the number of seconds in the
        `Retry-After` header.
      properties:
        type:
          type: string
          const: rate_limit_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - rate_limit_exceeded
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `rate_limit_exceeded`: Too many requests. Wait for the
            `Retry-After` seconds.
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable explanation.
          example: Rate limit exceeded
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    InternalServerError:
      type: object
      description: Something went wrong on our side. Retry with backoff.
      properties:
        type:
          type: string
          const: api_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - internal_error
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `internal_error`: Something went wrong on our side. Retry with
            backoff.
          example: internal_error
        message:
          type: string
          description: Human-readable explanation.
          example: Internal server error
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    ErrorIssue:
      type: object
      properties:
        message:
          type: string
          description: What is wrong.
        path:
          type: array
          items:
            anyOf:
              - type: string
              - type: number
          description: Location of the invalid field in the request body.
        code:
          type: string
          description: Validation rule that failed.
      required:
        - message
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      x-speakeasy-name-override: secretKey

````