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

# Verify a Credential

> Verify a presented credential and return a structured outcome.

The verifier runs a deterministic pipeline against the JWT-VC: parse, resolve
the issuer's signing key from the published JWKS, check the ES256 signature,
validate the standard claims (`iat` / `exp` / `nbf`, and `audience` if
provided), confirm the payload matches the credential-type schema, look up
the live revocation status, and — for agent credentials — evaluate the
authorization policy against the supplied request context.

Verification outcomes (revoked, expired, signature mismatch, policy denied,
etc.) return HTTP 200 with `{ valid: false, reason }` so callers can branch
on outcome without try/catching transport errors. Only infrastructure
failures use the error envelope.



## OpenAPI

````yaml POST /v1/credentials/verify
openapi: 3.1.0
info:
  title: Beltic Credentials API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/credentials/verify:
    post:
      tags:
        - Credentials
      summary: Verify a credential
      description: >-
        Verify a presented credential and return a structured outcome.


        The verifier runs a deterministic pipeline against the JWT-VC: parse,
        resolve

        the issuer's signing key from the published JWKS, check the ES256
        signature,

        validate the standard claims (`iat` / `exp` / `nbf`, and `audience` if

        provided), confirm the payload matches the credential-type schema, look
        up

        the live revocation status, and — for agent credentials — evaluate the

        authorization policy against the supplied request context.


        Verification outcomes (revoked, expired, signature mismatch, policy
        denied,

        etc.) return HTTP 200 with `{ valid: false, reason }` so callers can
        branch

        on outcome without try/catching transport errors. Only infrastructure

        failures use the error envelope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyRequest'
      responses:
        '200':
          description: >-
            Verification result — `valid: true` on success, `valid: false` with
            `reason` on domain-level failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyResponse'
        '400':
          description: Validation error or malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: Forbidden — caller lacks required permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: Conflict (e.g., credential already revoked, idempotency clash)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    VerifyRequest:
      type: object
      properties:
        credential:
          type: string
          minLength: 1
        context:
          type: object
          properties:
            resource_type:
              type: string
              minLength: 1
              maxLength: 64
            resource_id:
              type: string
              minLength: 1
              maxLength: 256
            action:
              type: string
              minLength: 1
              maxLength: 64
            transaction_amount:
              type: number
              minimum: 0
            transaction_currency:
              type: string
              minLength: 3
              maxLength: 3
            merchant_category:
              type: string
            merchant_id:
              type: string
            time_of_day:
              type: string
              pattern: ^\d{2}:\d{2}$
            day_of_week:
              type: string
              enum:
                - mon
                - tue
                - wed
                - thu
                - fri
                - sat
                - sun
            user_country:
              type: string
              minLength: 2
              maxLength: 2
            audience:
              type: string
          additionalProperties: {}
        by_credential_id:
          type: string
    VerifyResponse:
      oneOf:
        - type: object
          properties:
            valid:
              type: boolean
              enum:
                - true
            credential_id:
              type: string
            credential_type:
              type: string
              enum:
                - business
                - user
                - agent_authorization
                - outcome_attestation
            attestation_type:
              type: string
            issuer_did:
              type: string
            subject:
              anyOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - organisation
                    id:
                      type: string
                      minLength: 1
                    registration_number:
                      type: string
                    jurisdiction:
                      type: string
                    legal_form:
                      type: string
                    registered_name:
                      type: string
                    trading_name:
                      type: string
                    founded_year:
                      type: integer
                    website:
                      type: string
                    sector:
                      type: string
                  required:
                    - type
                    - id
                  additionalProperties: {}
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - person
                    id:
                      type: string
                      minLength: 1
                    email:
                      type: string
                      format: email
                    nationality:
                      type: string
                      minLength: 2
                      maxLength: 2
                    first_name:
                      type: string
                    last_name:
                      type: string
                    preferred_name:
                      type: string
                    title:
                      type: string
                    phone:
                      type: string
                    date_of_birth:
                      type: string
                    city:
                      type: string
                    role_at_org:
                      type: string
                  required:
                    - type
                    - id
                  additionalProperties: {}
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - agent
                    id:
                      type: string
                      pattern: ^did:jwk:[A-Za-z0-9_-]+$
                    agent_external_id:
                      type: string
                    agent_display_name:
                      type: string
                    agent_framework:
                      type: string
                    parent_user_id:
                      type: string
                    parent_business_id:
                      type: string
                  required:
                    - type
                    - id
                  additionalProperties: {}
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - email
                    id:
                      type: string
                      minLength: 1
                  required:
                    - type
                    - id
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - transaction
                    id:
                      type: string
                      minLength: 1
                  required:
                    - type
                    - id
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - document
                    id:
                      type: string
                      minLength: 1
                    mime_type:
                      type: string
                  required:
                    - type
                    - id
                - type: object
                  properties:
                    type:
                      anyOf:
                        - type: string
                          enum:
                            - organisation
                            - person
                            - agent
                            - email
                            - transaction
                            - document
                        - type: string
                          minLength: 1
                          maxLength: 64
                    id:
                      type: string
                      minLength: 1
                  required:
                    - type
                    - id
                  additionalProperties: {}
            trust_level:
              type: string
              enum:
                - self_attested
                - liveness_verified
                - idv_verified
                - enterprise_verified
            issued_at:
              type: string
              format: date-time
            expires_at:
              type: string
              format: date-time
            verified_at:
              type: string
              format: date-time
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
                - suspended
            policy_match:
              type: object
              properties:
                matched:
                  type: boolean
                permission_index:
                  type: integer
                  minimum: 0
                conditions_evaluated:
                  type: array
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      op:
                        type: string
                      result:
                        type: string
                        enum:
                          - pass
                          - fail
                    required:
                      - field
                      - op
                      - result
                deny_reason:
                  type: string
              required:
                - matched
            evidence_refs:
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 512
              maxItems: 50
              default: []
            verification_id:
              type: string
          required:
            - valid
            - credential_id
            - credential_type
            - issuer_did
            - subject
            - issued_at
            - expires_at
            - verified_at
            - status
            - verification_id
        - type: object
          properties:
            valid:
              type: boolean
              enum:
                - false
            reason:
              type: string
              enum:
                - malformed_jwt
                - alg_not_allowed
                - issuer_not_trusted
                - kid_not_found
                - signature_mismatch
                - expired
                - not_yet_valid
                - audience_mismatch
                - schema_mismatch
                - revoked
                - parent_revoked
                - policy_deny
                - no_matching_permission
                - condition_failed
            credential_id:
              type: string
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
                - suspended
            verified_at:
              type: string
              format: date-time
            verification_id:
              type: string
            details:
              type: object
              additionalProperties: {}
          required:
            - valid
            - reason
            - verified_at
            - verification_id
    ApiErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    ApiError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorDetail'
        request_id:
          type: string
      required:
        - code
        - message
    ApiErrorDetail:
      type: object
      properties:
        field:
          type: string
        issue:
          type: string
        hint:
          type: string
      required:
        - issue

````