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

# Verify a signed document

> Verify that a downloaded certificate or evidence bundle was issued by the platform and has not been altered, by re-deriving its HMAC signature — use it when a third party hands you a document and you need to trust its numbers.

Read scope suffices (POST that writes nothing); nothing is stored. Verification canonicalises the document (keys sorted recursively, undefined dropped) before hashing, so key order does not matter but any value change does. Sent with Cache-Control: no-store.



## OpenAPI

````yaml /openapi.json post /v1/verify
openapi: 3.1.0
info:
  title: errorbar Management API
  description: >-
    The management API behind the improvement loop: capture and setup, request
    logs and datasets, grades (labels), judges (criteria), evals and deploy
    gates, fine-tuning and reinforcement learning, dedicated GPU endpoints, and
    model aliases and versions. Authenticated with a workspace API key
    (sk_sovereign_...). The inference API (chat, embeddings, rerank, responses)
    is OpenAI-compatible and documented separately.


    Responses are snake_case, list endpoints on the loop products use the
    {"object": "list", "data": [...]} envelope, and refusals use the same nested
    error shape the gateway emits: {"error": {"message", "type", "code"}}.
    Request bodies on the loop products (logs, labels, criteria, evals,
    datasets, aliases) are snake_case; the training and infrastructure products
    (fine-tuning, GRPO, environment tools, dedicated, model-version adoption)
    validate camelCase bodies, and each schema below says which it is. Endpoints
    that spend money require a key minted by a workspace owner or admin and
    return 403 otherwise.
  version: 1.0.0
servers:
  - url: https://gateway.errorbar.ai
    description: Production
  - url: https://www.errorbar.ai/api
    description: Control plane (also served at this base URL)
security:
  - bearerAuth: []
paths:
  /v1/verify:
    post:
      tags:
        - Audit & proving
      summary: Verify a signed document
      description: >-
        Verify that a downloaded certificate or evidence bundle was issued by
        the platform and has not been altered, by re-deriving its HMAC signature
        — use it when a third party hands you a document and you need to trust
        its numbers.


        Read scope suffices (POST that writes nothing); nothing is stored.
        Verification canonicalises the document (keys sorted recursively,
        undefined dropped) before hashing, so key order does not matter but any
        value change does. Sent with Cache-Control: no-store.
      operationId: verifyDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                document:
                  type: object
                  description: >-
                    The full signed JSON document exactly as downloaded (a
                    certificate or evidence bundle carrying signature: { alg:
                    'HS256', key_id, value }). The `document` key must be
                    present (400 'Body must be { document: <signed JSON> }'
                    otherwise); its value may be any JSON.
              required:
                - document
      responses:
        '200':
          description: >-
            Always 200 for a well-formed body: { ok: true, key_id: string } when
            the bytes are ours and unaltered; otherwise { ok: false, reason:
            'unsigned' (no signature field) | 'malformed' (not an object or
            signature shape wrong) | 'unknown_key' (signed by a key this
            platform doesn't hold, e.g. after rotation) | 'mismatch' (any field
            was edited) | 'no_secret' (verification not configured on the
            platform) }.
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Malformed request or invalid field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, malformed, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid API key
              type: invalid_request_error
              code: invalid_api_key
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                invalid_request_error, insufficient_quota, rate_limit_error, or
                api_error.
            code:
              type: string
              description: >-
                Machine-stable cause, e.g. invalid_api_key, not_found,
                insufficient_permissions, precondition_failed.
          required:
            - message
            - type
            - code
      description: >-
        Every refusal — gateway and management API alike — uses this one
        envelope.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your workspace API key, e.g. `sk_sovereign_...`, sent as `Authorization:
        Bearer <key>`.

````