{
  "openapi": "3.1.0",
  "info": {
    "title": "WhiteCircle API Backend",
    "description": "Authentication: Bearer API Key Required",
    "license": {
      "name": ""
    },
    "version": "2026-06-01"
  },
  "servers": [
    {
      "url": "https://eu.whitecircle.com"
    },
    {
      "url": "https://us.whitecircle.com"
    }
  ],
  "paths": {
    "/api/artifact": {
      "get": {
        "tags": [
          "Artifact"
        ],
        "operationId": "artifact_get_by_external_id_v4",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-04-15"
          },
          {
            "name": "external_artifact_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactCheckResponse"
                },
                "example": {
                  "flagged": false,
                  "status": "completed",
                  "kind": "image",
                  "internal_artifact_id": "d4e5f6a7-b8c9-4123-def0-456789012345",
                  "external_artifact_id": "profile_photo_42",
                  "policies": {
                    "01930000-0000-7000-8000-000000000001": {
                      "flagged": false,
                      "name": "NSFW imagery"
                    }
                  },
                  "created_at": "2026-06-01T12:00:00Z",
                  "updated_at": "2026-06-01T12:00:00Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Artifact"
        ],
        "operationId": "artifact_check_v5",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactCheckResponse"
                },
                "example": {
                  "flagged": false,
                  "status": "completed",
                  "kind": "image",
                  "internal_artifact_id": "d4e5f6a7-b8c9-4123-def0-456789012345",
                  "external_artifact_id": "profile_photo_42",
                  "policies": {
                    "01930000-0000-7000-8000-000000000001": {
                      "flagged": false,
                      "name": "NSFW imagery"
                    }
                  },
                  "created_at": "2026-06-01T12:00:00Z",
                  "updated_at": "2026-06-01T12:00:00Z"
                }
              }
            }
          },
          "202": {
            "description": "Accepted, still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactCheckResponse"
                },
                "example": {
                  "flagged": null,
                  "status": "processing",
                  "kind": "image",
                  "internal_artifact_id": "d4e5f6a7-b8c9-4123-def0-456789012345",
                  "external_artifact_id": "profile_photo_42",
                  "policies": {},
                  "note": "Async check in progress"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/artifact/{internal_artifact_id}": {
      "get": {
        "tags": [
          "Artifact"
        ],
        "operationId": "artifact_get_by_id_v4",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-04-15"
          },
          {
            "name": "internal_artifact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactCheckResponse"
                },
                "example": {
                  "flagged": false,
                  "status": "completed",
                  "kind": "image",
                  "internal_artifact_id": "d4e5f6a7-b8c9-4123-def0-456789012345",
                  "external_artifact_id": "profile_photo_42",
                  "policies": {
                    "01930000-0000-7000-8000-000000000001": {
                      "flagged": false,
                      "name": "NSFW imagery"
                    }
                  },
                  "created_at": "2026-06-01T12:00:00Z",
                  "updated_at": "2026-06-01T12:00:00Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/condition/create": {
      "post": {
        "tags": [
          "Condition"
        ],
        "operationId": "create_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConditionRequest"
              },
              "example": {
                "name": "EU users",
                "description": "Route EU traffic to the GDPR policy set",
                "conditions": {
                  "type": "condition",
                  "field": "user.region",
                  "operator": "eq",
                  "value": "eu"
                },
                "environment_ids": [
                  "environment_123"
                ],
                "policy_ids": [
                  "01930000-0000-7000-8000-000000000001"
                ],
                "state": "Active"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCondition"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/condition/delete": {
      "post": {
        "tags": [
          "Condition"
        ],
        "operationId": "delete_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteConditionPublicRequest"
              },
              "example": {
                "id": "01930000-0000-7000-8000-000000000002"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCondition"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/condition/list": {
      "get": {
        "tags": [
          "Condition"
        ],
        "operationId": "list_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "environment_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicConditionState"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicCondition"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/condition/update": {
      "post": {
        "tags": [
          "Condition"
        ],
        "operationId": "update_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateConditionRequest"
              },
              "example": {
                "id": "01930000-0000-7000-8000-000000000002",
                "state": "Inactive"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCondition"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/condition/{id}": {
      "get": {
        "tags": [
          "Condition"
        ],
        "operationId": "get_by_id_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCondition"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/event": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "get_event_by_public_key_handler",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "environment_id",
            "in": "query",
            "description": "Required environment selector.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Run of the Event to look up."
          },
          {
            "name": "event_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ID for the Event to look up. Returns the latest result with this `run_id` and `event_id`."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Expected Event type. Returns `404` when the latest match has a different type."
          },
          {
            "name": "include_shadow",
            "in": "query",
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicEventDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Events"
        ],
        "operationId": "event_check_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventRequestEnvelope"
              },
              "example": {
                "environment_id": "environment_123",
                "run_id": "run_refund_123",
                "external_session_id": "conversation_456",
                "event": {
                  "type": "message",
                  "role": "user",
                  "content": "I need help with a refund. My order number is 4815.",
                  "event_id": "evt_user_001"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventResponseEnvelope"
                },
                "example": {
                  "flagged": false,
                  "policies": {
                    "01930000-0000-7000-8000-000000000001": {
                      "flagged": false,
                      "name": "PII disclosure",
                      "enabled_by_conditions": [
                        {
                          "id": "01930000-0000-7000-8000-000000000002",
                          "name": "EU users"
                        }
                      ]
                    }
                  },
                  "event": {
                    "type": "message",
                    "status": "completed",
                    "event_id": "evt_user_001",
                    "internal_event_id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890"
                  },
                  "run_id": "run_refund_123"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/event/{internal_event_id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "get_event_by_internal_id_handler",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "internal_event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "White Circle's ID for one saved result, from a check response or the run graph."
          },
          {
            "name": "environment_id",
            "in": "query",
            "description": "Required environment selector.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_shadow",
            "in": "query",
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicEventDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/events": {
      "post": {
        "tags": [
          "Events"
        ],
        "operationId": "events_check_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventsRequestEnvelope"
              },
              "example": {
                "environment_id": "environment_123",
                "run_id": "run_refund_123",
                "external_session_id": "conversation_456",
                "events": [
                  {
                    "type": "message",
                    "role": "user",
                    "content": "Can you refund my order 4815?",
                    "event_id": "evt_user_001"
                  },
                  {
                    "type": "tool",
                    "name": "lookup_order",
                    "output": {
                      "order_id": "4815",
                      "refund_eligible": true
                    },
                    "event_id": "evt_tool_001",
                    "call_id": "call_abc"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsResponseEnvelope"
                },
                "example": {
                  "flagged": false,
                  "messages": [
                    {
                      "type": "message",
                      "status": "completed",
                      "flagged": false,
                      "policies": {
                        "01930000-0000-7000-8000-000000000001": {
                          "flagged": false,
                          "name": "PII disclosure",
                          "enabled_by_conditions": [
                            {
                              "id": "01930000-0000-7000-8000-000000000002",
                              "name": "EU users"
                            }
                          ]
                        }
                      },
                      "event_id": "evt_user_001",
                      "internal_event_id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890"
                    }
                  ],
                  "artifacts": [],
                  "tools": [
                    {
                      "type": "tool",
                      "status": "completed",
                      "flagged": false,
                      "policies": {},
                      "note": "No policies or metrics were selected for this Event",
                      "event_id": "evt_tool_001",
                      "internal_event_id": "b2c3d4e5-f6a7-4901-bcde-f23456789012"
                    }
                  ],
                  "functions": [],
                  "agents": [],
                  "reasoning": [],
                  "run_id": "run_refund_123"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/metric/create": {
      "post": {
        "tags": [
          "Metric"
        ],
        "operationId": "create_metric_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolicyRequestV2"
              },
              "example": {
                "name": "Escalation risk",
                "rules": [
                  {
                    "flagged_content": "Messages indicating the user may escalate or churn"
                  }
                ],
                "content_type": "any",
                "applies_to": "any"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/metric/delete": {
      "post": {
        "tags": [
          "Metric"
        ],
        "operationId": "delete_metric_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeletePolicyRequestV2"
              },
              "example": {
                "id": "01930000-0000-7000-8000-000000000001"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/metric/get_by_id": {
      "get": {
        "tags": [
          "Metric"
        ],
        "operationId": "get_by_id_metric_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/metric/list": {
      "get": {
        "tags": [
          "Metric"
        ],
        "operationId": "list_metric_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicContentType"
                }
              ]
            }
          },
          {
            "name": "applies_to",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicAppliesTo"
                }
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicPolicyMode"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicPolicyV2"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/metric/update": {
      "post": {
        "tags": [
          "Metric"
        ],
        "operationId": "update_metric_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePolicyRequestV2"
              },
              "example": {
                "id": "01930000-0000-7000-8000-000000000001",
                "name": "Escalation risk (revised)"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/policy/create": {
      "post": {
        "tags": [
          "Policy"
        ],
        "operationId": "create_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolicyRequestV2"
              },
              "example": {
                "name": "No medical advice",
                "rules": [
                  {
                    "flagged_content": "Specific medical diagnoses or treatment recommendations"
                  },
                  {
                    "allowed_content": "General wellness information and encouragement to consult a professional"
                  }
                ],
                "content_type": "any",
                "applies_to": "any",
                "mode": "prod"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/policy/delete": {
      "post": {
        "tags": [
          "Policy"
        ],
        "operationId": "delete_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeletePolicyRequestV2"
              },
              "example": {
                "id": "01930000-0000-7000-8000-000000000001"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/policy/get_by_id": {
      "get": {
        "tags": [
          "Policy"
        ],
        "operationId": "get_by_id_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/policy/list": {
      "get": {
        "tags": [
          "Policy"
        ],
        "operationId": "list_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicContentType"
                }
              ]
            }
          },
          {
            "name": "applies_to",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicAppliesTo"
                }
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/PublicPolicyMode"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicPolicyV2"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/policy/update": {
      "post": {
        "tags": [
          "Policy"
        ],
        "operationId": "update_v2",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePolicyRequestV2"
              },
              "example": {
                "id": "01930000-0000-7000-8000-000000000001",
                "name": "No medical advice (revised)",
                "mode": "shadow"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPolicyV2"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/runs/{run_id}/graph": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "get_public_run_graph",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Run to load."
          },
          {
            "name": "environment_id",
            "in": "query",
            "description": "Required environment selector.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of Events to return. Values above 100 are clamped to 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100,
              "minimum": 1
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "`next_cursor` from the previous page. Valid only for the same Environment and run."
          }
        ],
        "responses": {
          "200": {
            "description": "Run graph retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventGraphResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid run or cursor"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/session": {
      "get": {
        "tags": [
          "Session"
        ],
        "operationId": "get_by_external_id_v4",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-04-15"
          },
          {
            "name": "deployment_id",
            "in": "query",
            "description": "Optional deployment ID to validate session ownership",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "external_session_id",
            "in": "query",
            "description": "Find the latest session by your external session ID within the deployment",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_shadow",
            "in": "query",
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionEnvelopeV4"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Session"
        ],
        "operationId": "check_v5",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckRequestV5"
              },
              "example": {
                "environment_id": "environment_123",
                "external_session_id": "conversation_456",
                "messages": [
                  {
                    "role": "user",
                    "content": "I need help with a refund. My order number is 4815."
                  }
                ],
                "metadata": {
                  "user": {
                    "region": "eu"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionEnvelopeV4"
                },
                "example": {
                  "session": {
                    "flagged": false,
                    "internal_session_id": "c3d4e5f6-a7b8-4012-cdef-345678901234",
                    "external_session_id": "conversation_456",
                    "policies": {
                      "01930000-0000-7000-8000-000000000001": {
                        "flagged": false,
                        "flagged_source": [],
                        "name": "PII disclosure",
                        "enabled_by_conditions": [
                          {
                            "id": "01930000-0000-7000-8000-000000000002",
                            "name": "EU users"
                          }
                        ]
                      }
                    }
                  },
                  "artifacts": []
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/session/{internal_session_id}": {
      "get": {
        "tags": [
          "Session"
        ],
        "operationId": "get_by_id_v4",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-04-15"
          },
          {
            "name": "internal_session_id",
            "in": "path",
            "description": "Find a session by its internal session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deployment_id",
            "in": "query",
            "description": "Optional deployment ID to validate session ownership",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_shadow",
            "in": "query",
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionEnvelopeV4"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/user/risk": {
      "get": {
        "tags": [
          "User"
        ],
        "operationId": "risk_v3",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2025-12-01"
          },
          {
            "name": "email",
            "in": "query",
            "description": "User email address (provide exactly one of email or id)",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "External user ID (provide exactly one of email or id)",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRiskResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/user/strike": {
      "post": {
        "tags": [
          "User"
        ],
        "operationId": "strike_v3",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2025-12-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserStrikeRequest"
              },
              "example": {
                "email": "user@example.com",
                "external_session_id": "conversation_456",
                "policy_id": "01930000-0000-7000-8000-000000000001",
                "severity_level_id": "01930000-0000-7000-8000-000000000009"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUserStrikeResponse"
                },
                "example": {
                  "strike": {
                    "points": 3,
                    "created_at": "2026-06-01T12:00:00Z",
                    "expires_at": "2026-09-01T12:00:00Z",
                    "reason": "Manually recorded policy violation",
                    "internal_session_id": "c3d4e5f6-a7b8-4012-cdef-345678901234",
                    "external_session_id": "conversation_456",
                    "policy": {
                      "id": "01930000-0000-7000-8000-000000000001",
                      "name": "PII disclosure",
                      "severity": "high"
                    }
                  },
                  "action": "warn",
                  "action_expires_at": "2026-06-08T12:00:00Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/user/strike/appeal": {
      "get": {
        "tags": [
          "User"
        ],
        "operationId": "get_strike_appeal_v3",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2025-12-01"
          },
          {
            "name": "strike_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "appeal_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserStrikeAppealResponse"
                },
                "example": {
                  "appeal_id": "01930000-0000-7000-8000-00000000000b",
                  "status": "approved",
                  "current_level": "warned",
                  "current_points": 0,
                  "updated_by": "reviewer@example.com"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "User"
        ],
        "operationId": "create_strike_appeal_v3",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2025-12-01"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserStrikeAppealRequest"
              },
              "example": {
                "strike_id": "01930000-0000-7000-8000-00000000000a",
                "reason": "The flagged message was quoting a policy for educational purposes."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUserStrikeAppealResponse"
                },
                "example": {
                  "appeal_id": "01930000-0000-7000-8000-00000000000b",
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/usage": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "usage_v1",
        "parameters": [
          {
            "name": "whitecircle-version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2026-06-01"
          },
          {
            "name": "period",
            "in": "query",
            "description": "Trailing window in days (1–365). Mutually exclusive with `from`/`to`. Defaults to 30.",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 1,
              "maximum": 365
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive start day (YYYY-MM-DD). Requires `to`. Mutually exclusive with `period`.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Inclusive end day (YYYY-MM-DD). Requires `from`. Mutually exclusive with `period`.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReport"
                },
                "example": {
                  "from": "2026-05-03",
                  "to": "2026-06-01",
                  "message": {
                    "count": 1280,
                    "cost_micros": 12800
                  },
                  "artifact": {
                    "image": {
                      "count": 340,
                      "cost_micros": 34000
                    },
                    "video": {
                      "count": 12,
                      "cost_micros": 0
                    },
                    "website": {
                      "count": 5,
                      "cost_micros": 0
                    }
                  },
                  "tool": {
                    "count": 210,
                    "cost_micros": 2100
                  },
                  "agent": {
                    "count": 64,
                    "cost_micros": 1280
                  },
                  "function": {
                    "count": 88,
                    "cost_micros": 880
                  },
                  "reasoning": {
                    "count": 41,
                    "cost_micros": 410
                  },
                  "total_micros": 51470
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ArtifactCheckRequest": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "$ref": "#/components/schemas/ArtifactContent"
          },
          "deployment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_artifact_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "trace_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "span_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IndexMap"
              }
            ]
          }
        }
      },
      "ArtifactCheckResponse": {
        "type": "object",
        "required": [
          "status",
          "kind",
          "internal_artifact_id",
          "policies"
        ],
        "properties": {
          "flagged": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "internal_artifact_id": {
            "type": "string"
          },
          "external_artifact_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "policies": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ArtifactPolicyStatus"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "created_at": "2026-06-01T12:00:00Z",
          "external_artifact_id": "product_photo_42",
          "flagged": true,
          "internal_artifact_id": "019f0000-0000-7000-8000-0000000000ab",
          "kind": "image",
          "policies": {
            "4d7543e2-d106-4cac-b0a4-87b27e473813": {
              "flagged": true,
              "name": "No Explicit Content"
            },
            "d54a96f1-ccac-4967-9101-46e68eab415e": {
              "flagged": false,
              "name": "No Violence"
            }
          },
          "status": "completed"
        }
      },
      "ArtifactContent": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ArtifactGetByExternalIdQueryV4": {
        "type": "object",
        "required": [
          "external_artifact_id"
        ],
        "properties": {
          "external_artifact_id": {
            "type": "string"
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ArtifactGetByIdPathV4": {
        "type": "object",
        "required": [
          "internal_artifact_id"
        ],
        "properties": {
          "internal_artifact_id": {
            "type": "string"
          }
        }
      },
      "ArtifactGetByIdQueryV4": {
        "type": "object",
        "properties": {
          "environment_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ArtifactPolicyStatus": {
        "type": "object",
        "required": [
          "flagged",
          "name"
        ],
        "properties": {
          "flagged": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "enabled_by_conditions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/EnabledByCondition"
            },
            "description": "The Conditions that selected this Policy for this artifact, which is why\nit was evaluated at all."
          }
        }
      },
      "AssistantInfoV3": {
        "type": "object",
        "properties": {
          "model_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "latency": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "CheckRequestV5": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestChatMessageV3"
            }
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "include_context": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "include_shadow": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {},
              "propertyNames": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "environment_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "environment_id": "env_123",
          "external_session_id": "user-session-123",
          "include_context": true,
          "messages": [
            {
              "content": "Hello, can you help me with something?",
              "metadata": {
                "message": {
                  "id": "msg-123"
                },
                "user": {
                  "email": "user@example.com",
                  "id": "user-456"
                }
              },
              "role": "user"
            }
          ],
          "metadata": {
            "user": {
              "age": 17,
              "region": "eu"
            }
          }
        }
      },
      "CheckResponseV4": {
        "type": "object",
        "required": [
          "flagged",
          "internal_session_id",
          "policies"
        ],
        "properties": {
          "flagged": {
            "type": "boolean"
          },
          "internal_session_id": {
            "type": "string"
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "policies": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PolicyStatusV3"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "example": {
          "flagged": true,
          "internal_session_id": "123e4567-e89b-12d3-a456-426614174000",
          "external_session_id": "user-session-001",
          "policies": {
            "70289e06-9111-463e-b121-7247c2b7bfbd": {
              "flagged": true,
              "flagged_source": [
                "text"
              ],
              "name": "No PII Sharing"
            }
          }
        }
      },
      "CheckedEvent": {
        "type": "object",
        "description": "The Event a single check was run against. Identity and status only; the\nverdict lives on the response so it is stated exactly once.",
        "required": [
          "type",
          "status",
          "event_id"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EventType",
            "description": "Kind of Event that was submitted."
          },
          "status": {
            "$ref": "#/components/schemas/EventResultStatus",
            "description": "Outcome for this Event."
          },
          "event_id": {
            "type": "string",
            "description": "Your `event_id`, or the generated one when you omitted it."
          },
          "internal_event_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "White Circle's ID for this saved result. Use it with `GET /api/event/{internal_event_id}`. Each check gets a new value, even when `run_id` and `event_id` repeat."
          }
        }
      },
      "CreateConditionRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "conditions": {},
          "environment_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "policy_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "metric_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "state": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicConditionState"
              }
            ]
          }
        }
      },
      "CreatePolicyRequestV2": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "rules": {
            "type": [
              "array",
              "null"
            ],
            "description": "Rules defining content to flag or allow. Each rule must set exactly one of `flagged_content` or `allowed_content`, and at least one rule must set `flagged_content`.",
            "items": {
              "$ref": "#/components/schemas/CreatePolicyRule"
            }
          },
          "content_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicContentType"
              }
            ]
          },
          "event_selector_list": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/PolicyEventSelector"
            }
          },
          "role_list": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/PolicyRole"
            }
          },
          "applies_to": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicAppliesTo"
              }
            ]
          },
          "mode": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicPolicyMode"
              }
            ]
          },
          "country_codes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "severity_level_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "CreatePolicyRule": {
        "type": "object",
        "description": "A new rule defining either content to flag or content to allow.",
        "properties": {
          "flagged_content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content that triggers a policy violation. Do not set this when `allowed_content` is set."
          },
          "allowed_content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content that the policy must allow. Do not set this when `flagged_content` is set."
          }
        },
        "additionalProperties": false
      },
      "CreateUserStrikeAppealRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "strike_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "CreateUserStrikeAppealResponse": {
        "type": "object",
        "required": [
          "appeal_id",
          "status"
        ],
        "properties": {
          "appeal_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "CreateUserStrikeRequest": {
        "type": "object",
        "required": [
          "policy_id",
          "severity_level_id"
        ],
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "policy_id": {
            "type": "string"
          },
          "severity_level_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "CreateUserStrikeResponse": {
        "type": "object",
        "required": [
          "strike"
        ],
        "properties": {
          "strike": {
            "$ref": "#/components/schemas/PublicStrikeItem"
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "action_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DeleteConditionPublicRequest": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeletePolicyRequestV2": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EnabledByCondition": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EventContentField": {
        "type": "string",
        "enum": [
          "content",
          "delta",
          "arguments",
          "output",
          "definition",
          "input",
          "instructions",
          "state"
        ],
        "description": "The content field an Event was checked on."
      },
      "EventGraphEdge": {
        "type": "object",
        "required": [
          "kind",
          "source",
          "target"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/EventGraphEdgeKind",
            "description": "Relationship type."
          },
          "source": {
            "$ref": "#/components/schemas/EventGraphNodeRef",
            "description": "The Event that declared the relationship."
          },
          "target": {
            "$ref": "#/components/schemas/EventGraphNodeRef",
            "description": "The parent or linked Event."
          }
        },
        "description": "A relationship declared by the `source` Event."
      },
      "EventGraphEdgeKind": {
        "type": "string",
        "enum": [
          "parent",
          "link"
        ],
        "description": "`parent`: the source's single structural parent, from `parent_event_id`. `link`: a causal input, from `links`."
      },
      "EventGraphNode": {
        "type": "object",
        "required": [
          "run_id",
          "event_id",
          "environment_id",
          "type"
        ],
        "properties": {
          "run_id": {
            "type": "string",
            "description": "Run of the Event."
          },
          "event_id": {
            "type": "string",
            "description": "Your ID for the Event."
          },
          "internal_event_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "White Circle's ID for the latest attempt. `null` when the Event has not been stored yet."
          },
          "environment_id": {
            "type": "string",
            "description": "Environment of the Event."
          },
          "type": {
            "type": "string",
            "description": "Kind of Event, or `unknown` for a target that has not been stored yet."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tool, function, agent, or artifact name sent with the Event."
          },
          "content_field": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EventContentField"
              }
            ],
            "description": "Content field the Event was checked on."
          },
          "call_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tool or function invocation ID sent with the Event."
          },
          "stream_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stream ID sent with the Event."
          },
          "sequence": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Stream position sent with the Event."
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "Role the Event was checked with."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Outcome of the latest attempt."
          },
          "violation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the initial check flagged the Event."
          },
          "effective_violation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Final verdict after White Circle's secondary review. Prefer it over `violation`."
          },
          "not_sure": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` when the check could not reach a confident verdict."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the latest attempt was saved. ISO 8601 timestamp."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the latest attempt last changed. ISO 8601 timestamp."
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Session the Event belongs to."
          }
        },
        "description": "The latest attempt of one Event. For an edge target that has not been stored yet, only `run_id`, `event_id`, and `environment_id` are set, `internal_event_id` is `null`, and `type` is `unknown`."
      },
      "EventGraphNodeRef": {
        "type": "object",
        "required": [
          "run_id",
          "event_id"
        ],
        "properties": {
          "run_id": {
            "type": "string",
            "description": "Run of the referenced Event."
          },
          "event_id": {
            "type": "string",
            "description": "`event_id` of the referenced Event."
          }
        }
      },
      "EventGraphResponse": {
        "type": "object",
        "required": [
          "nodes",
          "edges",
          "has_more"
        ],
        "properties": {
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventGraphNode"
            },
            "description": "Events in this page, plus every edge target, including targets in other runs or not stored yet."
          },
          "edges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventGraphEdge"
            },
            "description": "Parent and link relationships declared by Events in this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `after` to load the next page. `null` on the last page."
          },
          "has_more": {
            "type": "boolean",
            "description": "`true` if more Events remain after this page."
          }
        },
        "example": {
          "edges": [
            {
              "kind": "parent",
              "source": {
                "event_id": "evt_user_001",
                "run_id": "run_refund_123"
              },
              "target": {
                "event_id": "evt_tool_output_001",
                "run_id": "run_refund_123"
              }
            }
          ],
          "has_more": false,
          "next_cursor": null,
          "nodes": [
            {
              "content_field": "content",
              "created_at": "2026-06-01T12:00:00Z",
              "environment_id": "5d1e6f70-6f31-4c1e-9a2b-1f4d0d4c9a10",
              "event_id": "evt_user_001",
              "internal_event_id": "11111111-1111-4111-8111-111111111111",
              "role": "user",
              "run_id": "run_refund_123",
              "status": "completed",
              "type": "message",
              "violation": false
            },
            {
              "content_field": "output",
              "created_at": "2026-06-01T12:00:01Z",
              "environment_id": "5d1e6f70-6f31-4c1e-9a2b-1f4d0d4c9a10",
              "event_id": "evt_tool_output_001",
              "internal_event_id": "22222222-2222-4222-8222-222222222222",
              "name": "lookup_order",
              "run_id": "run_refund_123",
              "status": "completed",
              "type": "tool",
              "violation": false
            }
          ]
        },
        "description": "One page of a run graph: the latest attempt of each Event plus parent and link edges."
      },
      "EventLink": {
        "type": "object",
        "required": [
          "event_id"
        ],
        "properties": {
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Run of the linked Event. Omit for an Event in the same run. Links can point to any run in the same Environment."
          },
          "event_id": {
            "type": "string",
            "description": "`event_id` of the linked Event. The target does not have to exist yet."
          }
        },
        "description": "A causal input to this Event, such as a sub-agent result it consumed."
      },
      "EventPayload": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EventType",
            "description": "Kind of Event. Determines which content fields are allowed and which Policies can apply."
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who produced the content: `user`, `assistant`, `system`, `developer`, or `tool`. Required for `message` Events with content unless the request sets a top-level `role`. Overrides the Policy direction of other Event types; when omitted, White Circle picks it from the type and field, for example `tool.output` as `assistant`."
          },
          "content": {
            "description": "Content to check for `message`, `artifact`, and `reasoning` Events. Messages and reasoning take text; artifacts take an image object."
          },
          "delta": {
            "description": "An incremental chunk of a streamed `message` or `reasoning` Event. Each delta is checked as its own Event; White Circle does not join deltas, so send chunks large enough to judge, such as every N tokens or sentences."
          },
          "arguments": {
            "description": "Arguments of a `tool` or `function` call. Accepts any JSON value; White Circle keeps its shape."
          },
          "output": {
            "description": "Result of a `tool`, `function`, or `agent`. Accepts any JSON value."
          },
          "definition": {
            "description": "Schema or description of a `tool` or `function`, such as an OpenAI tool definition. Accepts any JSON value."
          },
          "input": {
            "description": "Task or input given to an `agent`, checked as user-direction content."
          },
          "instructions": {
            "description": "System instructions given to an `agent`. Enters context with the `system` role."
          },
          "state": {
            "description": "Snapshot of an `agent`'s internal state."
          },
          "event_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your ID for this Event. Required for reference-only Events. Generated when omitted for Events with content. Not a retry key: sending the same `run_id` and `event_id` again runs a new check. Up to 128 characters: letters, numbers, `.`, `_`, `:`, and `-`."
          },
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Run for this Event. Overrides the top-level `run_id`. Up to 128 characters: letters, numbers, `.`, `_`, `:`, and `-`."
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Session for this Event. Overrides the top-level `external_session_id`. Up to 256 characters."
          },
          "parent_event_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "`event_id` of this Event's structural parent in the same run, such as the agent step that produced it. Appears as a `parent` edge in the run graph and pairs a tool or function `output` with the call that has this `event_id` when you send no `call_id`. Not allowed on reference-only Events. Up to 128 characters: letters, numbers, `.`, `_`, `:`, and `-`."
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventLink"
            },
            "description": "Causal inputs this Event consumed, in this run or in other runs of the same Environment. Each appears as a `link` edge in the run graph. Up to 50 per Event. Not allowed on reference-only Events."
          },
          "external_artifact_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your ID for the image in an `artifact` Event. Used as the `event_id` when you omit `event_id`. Up to 256 characters."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the tool, function, agent, or artifact, such as `lookup_order`. Up to 256 characters."
          },
          "call_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your ID for one tool or function invocation. Send the same `call_id` on the `arguments` and `output` Events so the model sees them as one call. Up to 256 characters."
          },
          "stream_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your ID for the stream a `delta` belongs to. Stored and returned in the run graph; does not change how deltas are checked. Up to 256 characters."
          },
          "sequence": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Position of this chunk in its stream. Stored and returned in the run graph."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-form label for the content format, such as `markdown`. Stored only. Up to 256 characters."
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the work behind this Event started in your system, as RFC 3339. Shown on the Event with `finished_at` as its duration. Display only: it does not change Event ordering or `created_at`."
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the work behind this Event finished in your system, as RFC 3339. Must not be earlier than `started_at`. Display only: it does not change Event ordering or `created_at`."
          },
          "metadata": {
            "description": "Custom JSON object, up to 256 KiB. Conditions match against it to select Policies and Metrics for this Event."
          }
        },
        "description": "One Event to check, or a reference to an existing Event. Provide exactly one content field to check it. Omit every content field to reference the latest result with the same `run_id` and `event_id`."
      },
      "EventPolicyResult": {
        "type": "object",
        "required": [
          "flagged",
          "name"
        ],
        "properties": {
          "flagged": {
            "type": "boolean",
            "description": "Whether this Event violated the Policy."
          },
          "name": {
            "type": "string",
            "description": "Human-readable Policy name."
          },
          "enabled_by_conditions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/EnabledByCondition"
            },
            "description": "The Conditions that selected this Policy for this Event, which is why it\nwas evaluated at all."
          },
          "shadow": {
            "type": "boolean",
            "description": "Present and `true` only for shadow policies surfaced via `include_shadow`. A shadow result never affects the top-level verdict."
          }
        }
      },
      "EventRequestEnvelope": {
        "type": "object",
        "required": [
          "environment_id",
          "event"
        ],
        "properties": {
          "environment_id": {
            "type": "string",
            "description": "Environment whose Conditions, Policies, and Metrics apply. Required on every request."
          },
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your ID for a group of related Events, such as one agent run. Defaults to `external_session_id` when omitted. `parent_event_id` and same-run `links` resolve inside this run. Up to 128 characters: letters, numbers, `.`, `_`, `:`, and `-`."
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your conversation or session ID. Reuse it for every Event in the same conversation. See [Event Context](/latest/events/context). Up to 256 characters."
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default role for `message` and `artifact` Events that do not set their own `role`. Other Event types ignore it."
          },
          "event": {
            "$ref": "#/components/schemas/EventPayload",
            "description": "The Event to check or reference."
          },
          "include_shadow": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict."
          }
        }
      },
      "EventResponseEnvelope": {
        "type": "object",
        "required": [
          "event",
          "run_id"
        ],
        "properties": {
          "flagged": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Absent when no check ran, such as a reference, a failure, or an Event\nno Condition selected policies for."
          },
          "policies": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/EventPolicyResult"
            },
            "propertyNames": {
              "type": "string"
            },
            "description": "Policy results keyed by Policy ID. Present only when `status` is `completed`. Contains only the Policies that Conditions selected for this Event."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no verdict was produced: no Condition selected a Policy or Metric, a reference did not resolve, or the Event failed validation or checking."
          },
          "event": {
            "$ref": "#/components/schemas/CheckedEvent",
            "description": "Identity and status of the Event that was submitted."
          },
          "run_id": {
            "type": "string",
            "description": "Run the Event was recorded in."
          }
        },
        "example": {
          "flagged": true,
          "policies": {
            "70289e06-9111-463e-b121-7247c2b7bfbd": {
              "flagged": true,
              "name": "No PII Sharing",
              "enabled_by_conditions": [
                {
                  "id": "019f0000-0000-7000-8000-000000000001",
                  "name": "EU users"
                }
              ]
            }
          },
          "event": {
            "event_id": "evt_user_001",
            "internal_event_id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890",
            "status": "completed",
            "type": "message"
          },
          "run_id": "run_refund_123"
        }
      },
      "EventResult": {
        "type": "object",
        "required": [
          "type",
          "status",
          "event_id"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EventType",
            "description": "Kind of Event that was submitted."
          },
          "status": {
            "$ref": "#/components/schemas/EventResultStatus",
            "description": "Outcome for this Event."
          },
          "flagged": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` if this Event violated at least one Policy. Absent when no check ran."
          },
          "policies": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/EventPolicyResult"
            },
            "propertyNames": {
              "type": "string"
            },
            "description": "Policy results keyed by Policy ID. Present only when `status` is `completed`. Contains only the Policies that Conditions selected for this Event."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no verdict was produced: no Condition selected a Policy or Metric, a reference did not resolve, or the Event failed validation or checking."
          },
          "event_id": {
            "type": "string",
            "description": "Your `event_id`, or the generated one when you omitted it."
          },
          "internal_event_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "White Circle's ID for this saved result. Use it with `GET /api/event/{internal_event_id}`. Each check gets a new value, even when `run_id` and `event_id` repeat."
          }
        },
        "description": "Result for one Event in a batch."
      },
      "EventResultStatus": {
        "type": "string",
        "enum": [
          "completed",
          "failed",
          "referenced",
          "not_found"
        ],
        "description": "Outcome for one Event. `completed`: the Event was checked and has a verdict. `failed`: validation or checking failed; see `note`. `referenced`: a reference-only Event resolved to an existing result. `not_found`: a reference-only Event did not resolve, or the latest match has a different `type`."
      },
      "EventType": {
        "type": "string",
        "enum": [
          "message",
          "artifact",
          "tool",
          "function",
          "agent",
          "reasoning"
        ],
        "description": "Kind of Event. Each type accepts its own content fields: `message` and `reasoning` accept `content` or `delta`; `artifact` accepts `content`; `tool` and `function` accept `arguments`, `output`, or `definition`; `agent` accepts `input`, `instructions`, `output`, or `state`."
      },
      "EventsRequestEnvelope": {
        "type": "object",
        "required": [
          "environment_id",
          "events"
        ],
        "properties": {
          "environment_id": {
            "type": "string",
            "description": "Environment whose Conditions, Policies, and Metrics apply. Required on every request."
          },
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your ID for a group of related Events, such as one agent run. Defaults to `external_session_id` when omitted. `parent_event_id` and same-run `links` resolve inside this run. Up to 128 characters: letters, numbers, `.`, `_`, `:`, and `-`. Applies to every Event that does not set its own."
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your conversation or session ID. Reuse it for every Event in the same conversation. See [Event Context](/latest/events/context). Up to 256 characters. Applies to every Event that does not set its own."
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default role for `message` and `artifact` Events that do not set their own `role`. Other Event types ignore it."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventPayload"
            },
            "maxItems": 50,
            "minItems": 1,
            "description": "1 to 50 Events. List them in the order they happened: each Event is checked against the Events listed before it."
          },
          "include_shadow": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Also return shadow-policy results (each marked `shadow: true`). Shadow results never affect the top-level `flagged`/`violation` verdict."
          }
        }
      },
      "EventsResponseEnvelope": {
        "type": "object",
        "required": [
          "flagged",
          "messages",
          "artifacts",
          "tools",
          "functions",
          "agents",
          "reasoning",
          "run_id"
        ],
        "properties": {
          "flagged": {
            "type": "boolean",
            "description": "`true` if any Event in the batch violated at least one Policy."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventResult"
            },
            "description": "Results for `message` Events, in request order."
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventResult"
            },
            "description": "Results for `artifact` Events, in request order."
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventResult"
            },
            "description": "Results for `tool` Events, in request order."
          },
          "functions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventResult"
            },
            "description": "Results for `function` Events, in request order."
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventResult"
            },
            "description": "Results for `agent` Events, in request order."
          },
          "reasoning": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventResult"
            },
            "description": "Results for `reasoning` Events, in request order."
          },
          "run_id": {
            "type": "string",
            "description": "Top-level run of the batch. Events that set their own `run_id` keep it."
          }
        },
        "example": {
          "flagged": false,
          "agents": [],
          "artifacts": [],
          "functions": [],
          "messages": [
            {
              "event_id": "evt_user_001",
              "flagged": false,
              "internal_event_id": "11111111-1111-4111-8111-111111111111",
              "policies": {},
              "status": "completed",
              "type": "message"
            }
          ],
          "reasoning": [],
          "run_id": "run_refund_123",
          "tools": [
            {
              "event_id": "evt_tool_output_001",
              "flagged": false,
              "internal_event_id": "22222222-2222-4222-8222-222222222222",
              "policies": {},
              "status": "completed",
              "type": "tool"
            }
          ]
        }
      },
      "GetByExternalIdQueryV4": {
        "type": "object",
        "required": [
          "external_session_id"
        ],
        "properties": {
          "deployment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional deployment ID to validate session ownership"
          },
          "external_session_id": {
            "type": "string",
            "description": "Find the latest session by your external session ID within the deployment"
          }
        }
      },
      "GetByIdPathV4": {
        "type": "object",
        "required": [
          "internal_session_id"
        ],
        "properties": {
          "internal_session_id": {
            "type": "string",
            "description": "Find a session by its internal session ID"
          }
        }
      },
      "GetByIdQueryV4": {
        "type": "object",
        "properties": {
          "deployment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional deployment ID to validate session ownership"
          }
        }
      },
      "IndexMap": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number",
                "format": "double"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "propertyNames": {
            "type": "string"
          }
        },
        "propertyNames": {
          "type": "string"
        }
      },
      "MessageInfoV3": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MessageMetadataV3": {
        "type": "object",
        "properties": {
          "message": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MessageInfoV3"
              }
            ]
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserInfoV3"
              }
            ]
          },
          "assistant": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AssistantInfoV3"
              }
            ]
          }
        }
      },
      "PolicyEventSelector": {
        "type": "object",
        "description": "Structured policy selector used by Events-aware policy matching.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/PolicyEventSelectorType"
          },
          "field": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PolicyEventSelectorType": {
        "type": "string",
        "description": "Runtime surface selected by a policy for Events-aware matching.",
        "enum": [
          "message",
          "tool",
          "function",
          "agent",
          "artifact",
          "reasoning"
        ]
      },
      "PolicyRole": {
        "type": "string",
        "description": "Role restriction used by the new policy targeting model. Empty role lists mean any role.",
        "enum": [
          "user",
          "assistant"
        ]
      },
      "PolicyRule": {
        "type": "object",
        "description": "An existing rule defining either content to flag or content to allow.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "flagged_content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content that triggers a policy violation. Do not set this when `allowed_content` is set."
          },
          "allowed_content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content that the policy must allow. Do not set this when `flagged_content` is set."
          }
        }
      },
      "PolicyStatusV3": {
        "type": "object",
        "required": [
          "flagged",
          "flagged_source",
          "name"
        ],
        "properties": {
          "flagged": {
            "type": "boolean"
          },
          "flagged_source": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViolationSource"
            }
          },
          "name": {
            "type": "string"
          },
          "enabled_by_conditions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/EnabledByCondition"
            }
          },
          "shadow": {
            "type": "boolean",
            "description": "Present and `true` only for shadow policies surfaced via `include_shadow`. A shadow result never affects the top-level verdict."
          }
        }
      },
      "PublicAppliesTo": {
        "type": "string",
        "enum": [
          "input",
          "output",
          "any"
        ],
        "example": "input"
      },
      "PublicCondition": {
        "type": "object",
        "required": [
          "id",
          "revision_id",
          "name",
          "description",
          "conditions",
          "state",
          "created_at",
          "updated_at",
          "environment_ids",
          "policy_ids",
          "metric_ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "revision_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "conditions": {},
          "state": {
            "$ref": "#/components/schemas/PublicConditionState"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "environment_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "policy_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metric_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "conditions": {
            "conditions": [
              {
                "field": "user.region",
                "operator": "eq",
                "type": "condition",
                "value": "eu"
              }
            ],
            "op": "and",
            "type": "group"
          },
          "created_at": "2026-06-01T12:00:00Z",
          "description": "Applies stricter Policies to users in the EU",
          "environment_ids": [
            "117b391d-569a-4b55-8241-9f172b17a63d"
          ],
          "id": "019f0000-0000-7000-8000-000000000001",
          "metric_ids": [
            "6c0710ea-d669-49b9-9465-e52aebf95b66"
          ],
          "name": "EU users",
          "policy_ids": [
            "70289e06-9111-463e-b121-7247c2b7bfbd"
          ],
          "revision_id": "019f0000-0000-7000-8000-0000000000f1",
          "state": "Active",
          "updated_at": "2026-06-01T12:00:00Z"
        }
      },
      "PublicConditionState": {
        "type": "string",
        "enum": [
          "Active",
          "Inactive",
          "Draft"
        ]
      },
      "PublicContentType": {
        "type": "string",
        "enum": [
          "session",
          "artifact",
          "any"
        ],
        "example": "session"
      },
      "PublicEventByIdPath": {
        "type": "object",
        "required": [
          "internal_event_id"
        ],
        "properties": {
          "internal_event_id": {
            "type": "string"
          }
        }
      },
      "PublicEventDetailItem": {
        "type": "object",
        "required": [
          "internal_event_id",
          "event_id",
          "external_session_id",
          "type",
          "status",
          "created_at"
        ],
        "properties": {
          "internal_event_id": {
            "type": "string",
            "description": "White Circle's ID for this saved result. Use it with `GET /api/event/{internal_event_id}`. Each check gets a new value, even when `run_id` and `event_id` repeat."
          },
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Run the Event was recorded in."
          },
          "event_id": {
            "type": "string",
            "description": "Your ID for the Event."
          },
          "external_session_id": {
            "type": "string",
            "description": "Session the Event belongs to."
          },
          "type": {
            "type": "string",
            "description": "Kind of Event."
          },
          "status": {
            "type": "string",
            "description": "Outcome of the check, such as `completed` or `failed`."
          },
          "created_at": {
            "type": "string",
            "description": "When White Circle saved the result. ISO 8601 timestamp."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the result last changed. ISO 8601 timestamp."
          }
        }
      },
      "PublicEventDetailResponse": {
        "type": "object",
        "required": [
          "event",
          "flagged",
          "policies"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/PublicEventDetailItem",
            "description": "Identity and status of the saved Event."
          },
          "flagged": {
            "type": "boolean",
            "description": "`true` if the Event violated at least one Policy."
          },
          "policies": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/EventPolicyResult"
            },
            "propertyNames": {
              "type": "string"
            },
            "description": "Policy results keyed by Policy ID."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no verdict was produced: no Condition selected a Policy or Metric, a reference did not resolve, or the Event failed validation or checking."
          },
          "metadata": {
            "description": "The `metadata` object sent with the Event."
          }
        },
        "example": {
          "flagged": true,
          "policies": {
            "70289e06-9111-463e-b121-7247c2b7bfbd": {
              "flagged": true,
              "name": "No PII Sharing",
              "enabled_by_conditions": [
                {
                  "id": "019f0000-0000-7000-8000-000000000001",
                  "name": "EU users"
                }
              ]
            }
          },
          "event": {
            "type": "message",
            "status": "completed",
            "updated_at": null,
            "created_at": "2026-06-01T12:00:00Z",
            "event_id": "evt_user_001",
            "external_session_id": "conversation_456",
            "internal_event_id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890",
            "run_id": "run_refund_123"
          },
          "metadata": {
            "user": {
              "region": "eu"
            }
          }
        }
      },
      "PublicEventLatestQuery": {
        "type": "object",
        "required": [
          "environment_id",
          "run_id",
          "event_id"
        ],
        "properties": {
          "environment_id": {
            "type": "string",
            "description": "Required environment selector."
          },
          "run_id": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PublicPolicyV2": {
        "type": "object",
        "required": [
          "id",
          "name",
          "rules",
          "content_type",
          "event_selector_list",
          "role_list",
          "applies_to",
          "mode",
          "created_at",
          "state",
          "country_codes"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rules": {
            "type": "array",
            "description": "Rules defining content to flag or allow. At least one rule contains `flagged_content`.",
            "items": {
              "$ref": "#/components/schemas/PublicPolicyRuleV2"
            }
          },
          "content_type": {
            "$ref": "#/components/schemas/PublicContentType"
          },
          "event_selector_list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PolicyEventSelector"
            }
          },
          "role_list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PolicyRole"
            }
          },
          "applies_to": {
            "$ref": "#/components/schemas/PublicAppliesTo"
          },
          "mode": {
            "$ref": "#/components/schemas/PublicPolicyMode"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "$ref": "#/components/schemas/PublicPolicyState"
          },
          "country_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "severity_level_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "example": {
          "id": "01930000-0000-7000-8000-000000000001",
          "name": "No medical advice",
          "rules": [
            {
              "id": "01930000-0000-7000-8000-000000000010",
              "flagged_content": "Specific medical diagnoses or treatment recommendations"
            },
            {
              "id": "01930000-0000-7000-8000-000000000011",
              "allowed_content": "General wellness information and encouragement to consult a professional"
            }
          ],
          "content_type": "any",
          "event_selector_list": [],
          "role_list": [],
          "applies_to": "any",
          "mode": "prod",
          "created_at": "2026-06-01T12:00:00Z",
          "state": "active",
          "country_codes": []
        }
      },
      "PublicPolicyMode": {
        "type": "string",
        "enum": [
          "prod",
          "shadow"
        ],
        "example": "prod"
      },
      "PublicPolicyRuleV2": {
        "type": "object",
        "description": "A rule defining either content to flag or content to allow.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "flagged_content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content that triggers a policy violation."
          },
          "allowed_content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content that the policy must allow."
          }
        }
      },
      "PublicPolicyState": {
        "type": "string",
        "enum": [
          "active",
          "inactive",
          "draft"
        ],
        "example": "active"
      },
      "PublicStrikeAppeal": {
        "type": "object",
        "required": [
          "time",
          "status"
        ],
        "properties": {
          "time": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "PublicStrikeItem": {
        "type": "object",
        "required": [
          "points",
          "created_at",
          "reason",
          "internal_session_id",
          "policy"
        ],
        "properties": {
          "points": {
            "type": "integer",
            "format": "int32"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          },
          "internal_session_id": {
            "type": "string"
          },
          "external_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "appeal": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicStrikeAppeal"
              }
            ]
          },
          "policy": {
            "$ref": "#/components/schemas/PublicStrikePolicy"
          }
        }
      },
      "PublicStrikePolicy": {
        "type": "object",
        "required": [
          "id",
          "name",
          "severity"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          }
        }
      },
      "RequestChatContent": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestContentPart"
            }
          }
        ]
      },
      "RequestChatMessageV3": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string"
          },
          "content": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RequestChatContent"
              }
            ]
          },
          "metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MessageMetadataV3"
              }
            ]
          }
        }
      },
      "RequestChatRole": {
        "type": "string",
        "enum": [
          "system",
          "assistant",
          "user",
          "tool",
          "developer"
        ]
      },
      "RequestContentPart": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "text",
              "type"
            ],
            "properties": {
              "text": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "text",
              "type"
            ],
            "properties": {
              "text": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "input_text"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "internal_artifact_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_artifact_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "content": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ArtifactContent"
                  }
                ]
              },
              "type": {
                "type": "string",
                "enum": [
                  "artifact"
                ]
              }
            }
          }
        ]
      },
      "RequestImageUrl": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RiskLevel": {
        "type": "string",
        "enum": [
          "normal",
          "elevated",
          "severe"
        ]
      },
      "SessionEnvelopeV4": {
        "type": "object",
        "required": [
          "session",
          "artifacts"
        ],
        "properties": {
          "session": {
            "$ref": "#/components/schemas/CheckResponseV4"
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtifactCheckResponse"
            }
          }
        },
        "example": {
          "artifacts": [
            {
              "flagged": true,
              "kind": "image",
              "created_at": "2026-04-15T12:00:00Z",
              "external_artifact_id": "artifact-001",
              "external_session_id": "user-session-001",
              "internal_artifact_id": "223e4567-e89b-12d3-a456-426614174000",
              "internal_session_id": "123e4567-e89b-12d3-a456-426614174000",
              "policies": {
                "70289e06-9111-463e-b121-7247c2b7bfbd": {
                  "flagged": true,
                  "flagged_source": [
                    "image"
                  ],
                  "name": "No PII Sharing"
                }
              },
              "status": "completed"
            }
          ],
          "session": {
            "external_session_id": "user-session-001",
            "flagged": true,
            "internal_session_id": "123e4567-e89b-12d3-a456-426614174000",
            "policies": {
              "70289e06-9111-463e-b121-7247c2b7bfbd": {
                "flagged": true,
                "flagged_source": [
                  "text"
                ],
                "name": "No PII Sharing"
              }
            }
          }
        }
      },
      "UpdateConditionRequest": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "conditions": {},
          "environment_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "policy_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "metric_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "state": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicConditionState"
              }
            ]
          }
        }
      },
      "UpdatePolicyRequestV2": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "rules": {
            "type": [
              "array",
              "null"
            ],
            "description": "Replacement rules for the policy. Each rule must set exactly one of `flagged_content` or `allowed_content`, and at least one rule must set `flagged_content`.",
            "items": {
              "$ref": "#/components/schemas/PolicyRule"
            }
          },
          "content_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicContentType"
              }
            ]
          },
          "event_selector_list": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/PolicyEventSelector"
            }
          },
          "role_list": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/PolicyRole"
            }
          },
          "applies_to": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicAppliesTo"
              }
            ]
          },
          "mode": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicPolicyMode"
              }
            ]
          },
          "country_codes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "severity_level_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "UserInfoV3": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "User's IP address for geolocation lookup",
            "example": "8.8.8.8"
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB')",
            "example": "US"
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full country name",
            "example": "United States"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "State/province name or code",
            "example": "California"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": "City name",
            "example": "San Francisco"
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Latitude coordinate",
            "example": 37.7749
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Longitude coordinate",
            "example": -122.4194
          }
        }
      },
      "UserRiskQuery": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "User email address (provide exactly one of email or id)"
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "External user ID (provide exactly one of email or id)"
          }
        },
        "additionalProperties": false
      },
      "UserRiskResponse": {
        "type": "object",
        "properties": {
          "total_strike_points": {
            "type": "integer",
            "format": "int32"
          },
          "strikes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicStrikeItem"
            }
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "action_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "example": {
          "action": null,
          "action_expires_at": null,
          "strikes": [],
          "total_strike_points": 0
        }
      },
      "UserStrikeAppealResponse": {
        "type": "object",
        "required": [
          "appeal_id",
          "status",
          "current_points"
        ],
        "properties": {
          "appeal_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "current_level": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_points": {
            "type": "integer",
            "format": "int32"
          },
          "updated_by": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ViolationSource": {
        "type": "string",
        "enum": [
          "text",
          "image"
        ]
      },
      "UsageReport": {
        "type": "object",
        "required": [
          "from",
          "to",
          "message",
          "artifact",
          "tool",
          "agent",
          "function",
          "reasoning",
          "total_micros"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date",
            "description": "Inclusive first day covered (YYYY-MM-DD)."
          },
          "to": {
            "type": "string",
            "format": "date",
            "description": "Inclusive last day covered (YYYY-MM-DD)."
          },
          "message": {
            "$ref": "#/components/schemas/UsageAmount"
          },
          "artifact": {
            "$ref": "#/components/schemas/ArtifactAmount"
          },
          "tool": {
            "$ref": "#/components/schemas/UsageAmount"
          },
          "agent": {
            "$ref": "#/components/schemas/UsageAmount"
          },
          "function": {
            "$ref": "#/components/schemas/UsageAmount"
          },
          "reasoning": {
            "$ref": "#/components/schemas/UsageAmount"
          },
          "total_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Total cost across all categories, in millionths of one USD."
          }
        }
      },
      "UsageAmount": {
        "type": "object",
        "required": [
          "count",
          "cost_micros"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of checks in this category.",
            "minimum": 0
          },
          "cost_micros": {
            "type": "integer",
            "format": "int64",
            "description": "Cost in millionths of one USD (divide by 1,000,000 for dollars)."
          }
        }
      },
      "ArtifactAmount": {
        "type": "object",
        "required": [
          "image",
          "video",
          "website"
        ],
        "properties": {
          "image": {
            "$ref": "#/components/schemas/UsageAmount"
          },
          "video": {
            "$ref": "#/components/schemas/UsageAmount",
            "description": "Video artifact checks are counted but not billed."
          },
          "website": {
            "$ref": "#/components/schemas/UsageAmount",
            "description": "Website artifact checks are counted but not billed."
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "API Key required. Format: Bearer wc-your-api-key"
      }
    }
  },
  "tags": [
    {
      "name": "Session",
      "description": "Session-based content checking and moderation"
    },
    {
      "name": "User",
      "description": "User risk assessment and scoring"
    },
    {
      "name": "Policy",
      "description": "Policy management CRUD"
    },
    {
      "name": "Metric",
      "description": "Metric management CRUD"
    },
    {
      "name": "Artifact",
      "description": "Standalone artifact moderation"
    },
    {
      "name": "Events",
      "description": "Append-only event ingestion and public event lookup"
    },
    {
      "name": "Condition",
      "description": "Metadata-driven policy routing"
    },
    {
      "name": "Billing",
      "description": "Usage and cost reporting"
    }
  ]
}
