VectoralDocsWebsite
API referenceView Markdown

Stats overview

Customer-wide rollup: account totals, risk-tier distribution (by each account's most recent score), label breakdown, and 24-hour activity.

Customer-wide rollup that powers the console overview: account totals, risk-tier distribution, label breakdown, and 24-hour activity.

Risk buckets count each account once, by the tier of its most recent score. unscored_accounts is whatever is left over — accounts that have never been scored.

OpenAPI

GET/v1/stats
Response 200

Stats

FieldTypeDescription
total_accountsRequiredinteger

Accounts seen for this customer.

high_risk_accountsRequiredinteger

Accounts whose most recent score has tier high.

medium_risk_accountsRequiredinteger

Accounts whose most recent score has tier medium.

low_risk_accountsRequiredinteger

Accounts whose most recent score has tier low.

unscored_accountsRequiredinteger

total_accounts minus the three risk buckets (floored at 0) — accounts that have never been scored.

labeled_fraudRequiredinteger

Accounts whose current label is fraud.

labeled_legitimateRequiredinteger

Accounts whose current label is legitimate.

unlabeledRequiredinteger

Accounts with no label.

scores_24hRequiredinteger

Score rows recorded in the last 24 hours.

events_24hRequiredinteger

Post-call events recorded in the last 24 hours.

Response 401

Missing, malformed, unknown, expired, or revoked API key.

FieldTypeDescription
errorRequiredstring

Human-readable message. Not stable — don't parse it.

Response 500

Server-side failure (e.g. a database error). Read endpoints don't fail open.

FieldTypeDescription
errorRequiredstring

Human-readable message. Not stable — don't parse it.

View complete OpenAPI definition
yaml
openapi: 3.1.0
info:
  title: Vectoral API
  version: 1.0.0
  description: >-
    Fraud and abuse detection for AI app builders. Score the accounts hitting
    your AI features and catch the abuse draining your inference budget.
servers:
  - url: https://api.vectoral.cloud
    description: Hosted
  - url: http://localhost:8080
    description: Self-hosted (default bind)
security:
  - bearerAuth: []
paths:
  /v1/stats:
    get:
      tags:
        - Dashboard
      summary: Stats overview
      description: >-
        Customer-wide rollup: account totals, risk-tier distribution (by each
        account's most recent score), label breakdown, and 24-hour activity.
      operationId: stats
      responses:
        '200':
          description: Stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    StatsResponse:
      type: object
      properties:
        total_accounts:
          type: integer
          example: 12840
          description: Accounts seen for this customer.
          format: int64
        high_risk_accounts:
          type: integer
          example: 214
          description: Accounts whose most recent score has tier `high`.
          format: int64
        medium_risk_accounts:
          type: integer
          example: 902
          description: Accounts whose most recent score has tier `medium`.
          format: int64
        low_risk_accounts:
          type: integer
          example: 10004
          description: Accounts whose most recent score has tier `low`.
          format: int64
        unscored_accounts:
          type: integer
          example: 1720
          description: >-
            `total_accounts` minus the three risk buckets (floored at 0) —
            accounts that have never been scored.
          format: int64
        labeled_fraud:
          type: integer
          example: 88
          description: Accounts whose current label is `fraud`.
          format: int64
        labeled_legitimate:
          type: integer
          example: 240
          description: Accounts whose current label is `legitimate`.
          format: int64
        unlabeled:
          type: integer
          example: 12512
          description: Accounts with no label.
          format: int64
        scores_24h:
          type: integer
          example: 4821
          description: Score rows recorded in the last 24 hours.
          format: int64
        events_24h:
          type: integer
          example: 4530
          description: Post-call events recorded in the last 24 hours.
          format: int64
      required:
        - total_accounts
        - high_risk_accounts
        - medium_risk_accounts
        - low_risk_accounts
        - unscored_accounts
        - labeled_fraud
        - labeled_legitimate
        - unlabeled
        - scores_24h
        - events_24h
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: account_id required
          description: Human-readable message. Not stable — don't parse it.
      required:
        - error
      description: >-
        Uniform error envelope. The message is for humans and is not stable;
        branch on the HTTP status.
  responses:
    Unauthorized:
      description: Missing, malformed, unknown, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing:
              summary: No or malformed Authorization header
              value:
                error: 'missing or malformed Authorization: Bearer <api key>'
            invalid:
              summary: Unknown, expired, or revoked key
              value:
                error: invalid, expired, or revoked api key
    InternalError:
      description: >-
        Server-side failure (e.g. a database error). Read endpoints don't fail
        open.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret API key: `vg_live_` followed by 43 base64url characters.
        Send it as `Authorization: Bearer vg_live_…` on every `/v1` request
        (except `POST /v1/sensor/collect`, which uses a publishable site key in
        the body).

Search guides, concepts, and API endpoints.