Protect

Check Session

POST
/api/protect/check

Authorizations

  • Authorizationstringheaderrequired

    API Key required. Format: Bearer wc-your-api-key

Headers

  • whitecircle-versionstringrequired

    API Version

    Example: "2025-06-15"

Body

application/json

  • messagesobject[]required

    Array of chat messages to analyze for policy violations. Required

    Show child attributes
    • messages.roleenum<string>required

      Available options: system, assistant, user

    • messages.contentnull | string | object[]

  • external_idstring | null

    Optional external identifier for tracking this session. Useful for correlating results with your own systems

  • include_contextboolean | null

    Include previous conversation context associated with the same external_id. Default: false.

  • include_policy_namesboolean | null

    Include human-readable policy names in the response. Default: false.

  • metadataobject

    Optional metadata object for additional info about session.

    Show child attributes
    • metadata.{key}object

      Show child attributes
      • metadata.{key}.{key}any

  • policiesstring[] | null

    Optional list of specific policy IDs to check. If omitted, all deployment policies are used.

Response

application/json

Success

  • internal_idstringrequired

    Unique internal identifier for this check

  • violationbooleanrequired

    Whether any policy violations were detected

  • violationsobjectrequired

    Map of policy IDs to policy status objects containing violation and optional name

    Show child attributes
    • violations.{key}object

      Show child attributes
      • violations.{key}.violationbooleanrequired

        Whether a violation was detected for this policy

      • violations.{key}.violation_sourceenum<string>[]required

        Sources where violations were detected (includes only triggered violations)

        Available options: text, image

      • violations.{key}.namestring | null

        Human-readable policy name (only present if include_policy_names=true)

  • external_idstring | null

    Optional external identifier provided by client