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

# Create Witness Request

> Initiate a multi-agent witness verification for a truth claim

Creates a new witness request that coordinates multiple independent machine agents to verify a truth claim. Witness verification is a core primitive of the MAIP protocol -- it provides Byzantine-fault-tolerant consensus by requiring a quorum of trusted agents to independently attest to a claim before it is accepted.

The system selects eligible witnesses based on their trust scores, excluding the originating agent and any agents below the minimum trust threshold. If explicit `witness_agent_ids` are provided, those agents are invited directly (subject to trust score validation).

### Authentication

Requires `X-API-Key` header or Bearer JWT token. Tenant-scoped via `X-Tenant-ID`.

### Request Body

<ParamField body="claim_id" type="string" required>
  The identifier of the truth claim to be witnessed. Must reference an existing
  claim in `pending` or `verifying` status. Format: `maip-tc:ULID`.
</ParamField>

<ParamField body="required_witnesses" type="integer" default="3">
  The number of witness attestations required to reach consensus. Minimum: `1`.
  Maximum: `10`. Higher values increase verification confidence but take longer.
</ParamField>

<ParamField body="witness_agent_ids" type="string[]">
  Optional list of specific agent identifiers to invite as witnesses. If
  omitted, the system auto-selects eligible agents from the tenant's agent pool.
  Format: `maip-agent:ULID`.
</ParamField>

<ParamField body="min_trust_score" type="number" default="0.5">
  Minimum trust score required for an agent to participate as a witness. Range:
  `0.0`-`1.0`. Agents below this threshold are excluded from selection.
</ParamField>

<ParamField body="ttl_seconds" type="integer" default="86400">
  Time-to-live in seconds before the witness request expires if consensus is not
  reached. Range: `300` (5 minutes) to `604800` (7 days).
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique identifier for the witness request. Format: `maip-wit:ULID`.
</ResponseField>

<ResponseField name="claim_id" type="string">
  The truth claim being witnessed.
</ResponseField>

<ResponseField name="status" type="string">
  Initial status of the witness request. Always `pending` on creation.
</ResponseField>

<ResponseField name="required_witnesses" type="integer">
  Number of attestations needed to reach consensus.
</ResponseField>

<ResponseField name="current_witnesses" type="integer">
  Number of attestations received so far. `0` on creation.
</ResponseField>

<ResponseField name="expires_at" type="string">
  ISO 8601 timestamp when the witness request will expire if consensus is not
  reached.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of creation.
</ResponseField>

### Witness Lifecycle

| Status      | Description                                     |
| :---------- | :---------------------------------------------- |
| `pending`   | Created, awaiting witness attestations          |
| `confirmed` | Quorum reached with majority `confirm` verdicts |
| `denied`    | Quorum reached with majority `deny` verdicts    |
| `expired`   | TTL elapsed without reaching consensus          |


## OpenAPI

````yaml mint-openapi.yaml POST /v1/witness/request
openapi: 3.0.3
info:
  title: Truthlocks API
  description: >
    Truthlocks is a universal verification infrastructure for documents,
    credentials, and digital assets.

    This specification defines the canonical API for interacting with Truthlocks
    services.


    ## Base URLs

    - **Production**: `https://api.truthlocks.com`

    - **Sandbox**: `https://sandbox-api.truthlocks.com`


    ## Authentication

    - **API Keys**: Use `X-API-Key` header for machine-to-machine operations

    - **Bearer Tokens**: Use `Authorization: Bearer <jwt>` for user-initiated
    operations


    ## Tenant Identity

    In production, tenant identity is derived from the authenticated context
    (API key or JWT).

    The `X-Tenant-ID` header is ignored in production to prevent spoofing.
  version: 1.0.0
  contact:
    name: Truthlocks Support
    url: https://truthlocks.com/support
    email: support@truthlocks.com
servers:
  - url: https://api.truthlocks.com
    description: Production API
  - url: https://sandbox-api.truthlocks.com
    description: Sandbox Environment
security:
  - APIKey: []
tags:
  - name: Authentication
    description: API key and token management
  - name: Issuers
    description: Issuer registration and trust management
  - name: Keys
    description: Cryptographic key management for issuers
  - name: Attestations
    description: Attestation lifecycle (mint, revoke, supersede)
  - name: Verification
    description: Attestation verification and proof bundles
  - name: Governance
    description: Issuer governance workflows (admin only)
  - name: Identity
    description: Organization, user, and role management
  - name: Audit
    description: Audit event queries
  - name: Platform
    description: Platform administration (super admin only)
  - name: Platform Review
    description: Staff review workflows for issuer applications
  - name: Tenant Console
    description: Tenant profile and lifecycle endpoints
  - name: Health
    description: Service health and readiness endpoints
  - name: Risk
    description: Risk signal ingestion and fraud detection
  - name: Risk Enforcement
    description: Risk enforcement actions — block, challenge, quarantine, and configuration
  - name: Billing
    description: Billing, subscription, and addon management
  - name: Machine Identity
    description: >-
      Machine Agent Identity Protocol (MAIP) — agent registration, sessions,
      trust, witness, compliance, orchestration, and observability
externalDocs:
  description: Transparency read-only API (separate service spec)
  url: >-
    https://github.com/truthlocks/truthlock/blob/main/docs/transparency/openapi.yaml
paths:
  /v1/witness/request:
    post:
      tags:
        - Machine Identity
      summary: Create Witness Request
      description: >
        Creates a witness group requiring a threshold of attestations from
        specified

        agents before a claim is considered validated.
      operationId: maip.witness.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - required_attestations
                - agent_ids
              properties:
                name:
                  type: string
                  description: Witness group name
                required_attestations:
                  type: integer
                  minimum: 1
                  description: Minimum attestations required for consensus
                agent_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: Agents eligible to attest
            example:
              name: Model Validation Panel
              required_attestations: 3
              agent_ids:
                - 550e8400-e29b-41d4-a716-446655440000
                - 550e8400-e29b-41d4-a716-446655440001
                - 550e8400-e29b-41d4-a716-446655440002
                - 550e8400-e29b-41d4-a716-446655440003
      responses:
        '201':
          description: Witness group created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaipWitnessGroup'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - APIKey: []
components:
  schemas:
    MaipWitnessGroup:
      type: object
      properties:
        witness_id:
          type: string
          format: uuid
        name:
          type: string
        required_attestations:
          type: integer
        agent_ids:
          type: array
          items:
            type: string
            format: uuid
        status:
          type: string
          enum:
            - pending
            - active
            - completed
        created_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - code
        - message
        - http_status
      properties:
        code:
          type: string
          description: Machine-readable error code
          enum:
            - AUTH_REQUIRED
            - AUTH_INVALID
            - PERMISSION_DENIED
            - TENANT_IDENTITY_UNVERIFIED
            - NOT_FOUND
            - VALIDATION_ERROR
            - CONFLICT
            - PAYLOAD_TOO_LARGE
            - RATE_LIMIT_EXCEEDED
            - QUOTA_EXCEEDED
            - SERVICE_UNAVAILABLE
            - INTERNAL_ERROR
        message:
          type: string
          description: Human-readable error message
        http_status:
          type: integer
          description: HTTP status code
        retry_after_ms:
          type: integer
          description: Milliseconds to wait before retrying (for rate limits)
        details:
          type: object
          description: Additional error context
      example:
        code: AUTH_REQUIRED
        message: Authentication required
        http_status: 401
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for machine-to-machine authentication

````