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

# Verify content

> Verify content API endpoint allows to verify LLM response against your custom policies

This endpoint allows to run multiple verifiers against a single LLM response. The response will contain the result of each verifier and the final action based on the verifiers' results.


## OpenAPI

````yaml POST /v1/{team_id}/verify
openapi: 3.1.0
info:
  title: NaviML API
  description: NaviML API
  version: 1.0.0
servers:
  - url: https://api.naviml.com
security: []
paths:
  /v1/{team_id}/verify:
    post:
      parameters:
        - name: team_id
          description: >-
            Team ID of the team owning the resources and under which the
            verifiers are executed
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/VerifyResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIError'
components:
  schemas:
    VerifyRequest:
      type: object
      properties:
        messages:
          description: List of messages to run verifiers against
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
        verifiers:
          type: array
          description: List of verifiers to execute with configurations
          items:
            $ref: '#/components/schemas/VerifierParameters'
        explain:
          description: Includes explanation for the result in response
          type: boolean
      required:
        - messages
        - verifiers
    VerifyResponse:
      type: object
      properties:
        request_id:
          type: string
          format: uuid
          description: Unique identifier for the request
        action:
          $ref: '#/components/schemas/ResultAction'
          type: string
        result:
          $ref: '#/components/schemas/ExecutionResult'
      required:
        - action
        - request_id
        - result
    APIError:
      type: object
      properties:
        detail:
          $ref: '#/components/schemas/ApiErrorDetails'
    ChatMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          type: string
      required:
        - role
        - content
    VerifierParameters:
      oneOf:
        - $ref: '#/components/schemas/PolicyVerifier'
        - $ref: '#/components/schemas/LlamaGuardVerifier'
    ResultAction:
      type: string
      description: Suggested action based on the result
      enum:
        - allow
        - modify
        - deny
    ExecutionResult:
      type: object
      properties:
        verifiers:
          type: array
          items:
            $ref: '#/components/schemas/VerifierResult'
        action:
          $ref: '#/components/schemas/ResultAction'
      required:
        - verifiers
        - action
    ApiErrorDetails:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        param:
          type: string
        type:
          type: string
    PolicyVerifier:
      type: object
      properties:
        id:
          type: string
          description: ID of the policy verifier in the system
        type:
          type: string
          enum:
            - policy-verifier
        parameters:
          $ref: '#/components/schemas/PolicyVerifierParameters'
      required:
        - id
        - type
        - parameters
    LlamaGuardVerifier:
      type: object
      properties:
        id:
          type: string
          enum:
            - llama-guard
        type:
          type: string
          enum:
            - llama-guard
        parameters:
          $ref: '#/components/schemas/LlamaGuardParameters'
      required:
        - id
        - type
        - parameters
    VerifierResult:
      type: object
      properties:
        id:
          type: string
          description: ID of the verifier
        result:
          type: string
          description: Plaintext result of the verifier
        explanation:
          $ref: '#/components/schemas/ResultExplanation'
        action:
          $ref: '#/components/schemas/ResultAction'
        details:
          $ref: '#/components/schemas/ResultDetails'
        usage:
          $ref: '#/components/schemas/Usage'
      required:
        - id
        - result
        - action
    PolicyVerifierParameters:
      type: object
      properties:
        threshold:
          description: Threshold for the policy verifier
          type: number
          minimum: 0
          maximum: 1
    LlamaGuardParameters:
      type: object
      properties:
        guards:
          type: array
          items:
            $ref: '#/components/schemas/LLamaGuardType'
      required:
        - guards
    ResultExplanation:
      type: object
      description: Object encapsulating explanation of the result
      properties:
        text:
          description: Explanation of the result in plain text
          type: string
    ResultDetails:
      type: object
      description: Verifier specific execution details
      properties: {}
    Usage:
      type: object
      description: Usage of tokens by the request
      properties:
        prompt_tokens:
          description: Number of tokens used for the prompt
          type: integer
          format: int32
        completion_tokens:
          description: Number of tokens used for the completion
          type: integer
          format: int32
        total_tokens:
          description: Total number of tokens used
          type: integer
          format: int32
    LLamaGuardType:
      type: string
      enum:
        - S1
        - S2
        - S3
        - S4
        - S5
        - S6
        - S7
        - S8
        - S9
        - S10
        - S11
        - S12
        - S13
        - S14

````