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

# List flag codes

> The complete flag catalogue. Stable; safe to cache.



## OpenAPI

````yaml /api_schema.yaml get /api/v1/document-checks/flags/
openapi: 3.0.3
info:
  title: Sphinx Document Fraud API
  version: 1.0.0
  description: >
    Detect forged, tampered, and AI-generated documents. Upload a PDF or image
    and get back a

    structured verdict with a defined set of fraud flags.


    **Quick Start:**

    1. **Create an API key**: sign up, then generate a key from Settings.

    2. **Submit a document**: `POST /api/v1/document-checks/` with a file or a
    URL.
       You get back an id with status `"processing"`.
    3. **Poll for the result**: `GET /api/v1/document-checks/{id}/` until status
    is
       `"completed"` or `"failed"`.

    Optionally pass `webhook_url` on submit to be notified when analysis
    finishes, or

    `?wait=true` to block the submit request for up to 55s.


    **Authentication:** `Authorization: Bearer <api_key>`


    **Decisions:** Every completed check returns a decision (`clear`, `pending`,
    `suspicious`, or

    `fraudulent`), a `risk_level`, a plain-language summary, structured flags,
    and any

    workspace rules that triggered. The four-value decision set is the v1
    contract.
servers:
  - url: /
    description: This environment
security: []
tags:
  - name: Document Checks
    description: |-
      Submit a document for fraud analysis and retrieve structured results.

      **Allowed file types:** PDF, PNG, JPG.
  - name: Rules
    description: >-
      Workspace rules that guide the fraud engine, plus the score cut lines that
      set the `decision` field on each check.
paths:
  /api/v1/document-checks/flags/:
    get:
      tags:
        - Document Checks
      summary: List flag codes
      description: The complete flag catalogue. Stable; safe to cache.
      operationId: v1_document_checks_flags_retrieve
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlagCatalogue'
          description: Every flag code v1 can emit.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid API key.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FlagCatalogue:
      type: object
      properties:
        object:
          type: string
          default: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/FlagDefinition'
      required:
        - data
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
    FlagDefinition:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/FlagCodeEnum'
        category:
          type: string
        severity:
          $ref: '#/components/schemas/SeverityEnum'
        title:
          type: string
        description:
          type: string
      required:
        - category
        - code
        - description
        - severity
        - title
    ErrorDetail:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ErrorTypeEnum'
        code:
          type: string
          description: Machine-readable cause, e.g. `unsupported_document`.
        message:
          type: string
          description: Human-readable explanation. Safe to log; do not parse.
      required:
        - code
        - message
        - type
    FlagCodeEnum:
      enum:
        - ai_generated_metadata
        - ai_generated_embedded_image
        - photoshop_artifact
        - editing_software_detected
        - metadata_scrubbed
        - document_rebuilt
        - incremental_edit
        - empty_shell_revision
        - font_inconsistency
        - numeric_font_mismatch
        - amount_outlier
        - template_deviation
        - visual_tampering
        - fabricated_document
      type: string
      description: |-
        * `ai_generated_metadata` - ai_generated_metadata
        * `ai_generated_embedded_image` - ai_generated_embedded_image
        * `photoshop_artifact` - photoshop_artifact
        * `editing_software_detected` - editing_software_detected
        * `metadata_scrubbed` - metadata_scrubbed
        * `document_rebuilt` - document_rebuilt
        * `incremental_edit` - incremental_edit
        * `empty_shell_revision` - empty_shell_revision
        * `font_inconsistency` - font_inconsistency
        * `numeric_font_mismatch` - numeric_font_mismatch
        * `amount_outlier` - amount_outlier
        * `template_deviation` - template_deviation
        * `visual_tampering` - visual_tampering
        * `fabricated_document` - fabricated_document
    SeverityEnum:
      enum:
        - low
        - medium
        - high
      type: string
      description: |-
        * `low` - low
        * `medium` - medium
        * `high` - high
    ErrorTypeEnum:
      enum:
        - invalid_request_error
        - authentication_error
        - insufficient_credits_error
        - permission_error
        - not_found_error
        - rate_limit_error
        - api_error
      type: string
      description: |-
        * `invalid_request_error` - invalid_request_error
        * `authentication_error` - authentication_error
        * `insufficient_credits_error` - insufficient_credits_error
        * `permission_error` - permission_error
        * `not_found_error` - not_found_error
        * `rate_limit_error` - rate_limit_error
        * `api_error` - api_error
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Paste your workspace API key from Settings. Sent as Authorization:
        Bearer <key>.

````