VectoralDocsWebsite
API referenceView Markdown

Verify a sensor token

Server-to-server validation of a token returned by /v1/sensor/collect. Stateless: checks the signature and expiry, not a database.

Server-to-server validation of a token from /v1/sensor/collect. Stateless — checks the signature and expiry, not a database. Tokens are short-lived (120s by default) and bound to the customer that minted them; a cross-customer token returns 403, an expired or tampered one 400.

OpenAPI

POST/v1/sensor/verify

Request body

FieldTypeDescription
tokenRequiredstring

The token your browser received from collect.

actionOptionalstring
Response 200

Verdict

FieldTypeDescription
is_botRequiredboolean

True when the decision is deny.

is_humanRequiredboolean

True when the decision is allow. Both are false for challenge.

scoreRequirednumber

Browser bot score, 0–1.

decisionRequiredallow | challenge | deny

deny for a high bot score, challenge for medium, allow otherwise.

reasonsRequiredstring[]

Up to three reason codes, strongest first (e.g. webdriver_present, automation_signature, headless_browser, no_human_interaction, cursor_teleport); no_significant_signals when nothing fired.

Response 400

Malformed JSON or body over 1 MiB (decode: …), empty token (token required), an expired token (token expired), or a bad signature / unparseable token (invalid token).

FieldTypeDescription
errorRequiredstring

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

Response 401

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

FieldTypeDescription
errorRequiredstring

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

Response 403

The token was minted for a different customer's site key.

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/sensor/verify:
    post:
      tags:
        - Sensor
      summary: Verify a sensor token
      description: >-
        Server-to-server validation of a token returned by `/v1/sensor/collect`.
        Stateless: checks the signature and expiry, not a database.
      operationId: sensorVerify
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyRequest'
            example:
              token: eyJjaWQiOi….Zk3q…
      responses:
        '200':
          description: Verdict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyResponse'
              example:
                is_bot: false
                is_human: true
                score: 0.04
                decision: allow
                reasons:
                  - no_significant_signals
        '400':
          description: >-
            Malformed JSON or body over 1 MiB (`decode: …`), empty `token`
            (`token required`), an expired token (`token expired`), or a bad
            signature / unparseable token (`invalid token`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: token expired
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: The token was minted for a different customer's site key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: token does not belong to this customer
components:
  schemas:
    VerifyRequest:
      type: object
      required:
        - token
      properties:
        token:
          type: string
          description: The token your browser received from collect.
        action:
          type: string
    VerifyResponse:
      type: object
      properties:
        is_bot:
          type: boolean
          description: True when the decision is `deny`.
        is_human:
          type: boolean
          description: True when the decision is `allow`. Both are false for `challenge`.
        score:
          type: number
          example: 0.04
          minimum: 0
          maximum: 1
          description: Browser bot score, 0–1.
        decision:
          type: string
          enum:
            - allow
            - challenge
            - deny
          example: allow
          description: >-
            `deny` for a high bot score, `challenge` for medium, `allow`
            otherwise.
        reasons:
          type: array
          items:
            type: string
          example:
            - no_significant_signals
          description: >-
            Up to three reason codes, strongest first (e.g. `webdriver_present`,
            `automation_signature`, `headless_browser`, `no_human_interaction`,
            `cursor_teleport`); `no_significant_signals` when nothing fired.
      required:
        - is_bot
        - is_human
        - score
        - decision
        - reasons
    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
  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.