Tawa docs
Rag

Scan an entire retrieved set

Scan a whole retrieved set in one call — a per-chunk verdict plus an aggregate.

POST
/rag/retrieval

Scan a whole retrieved set in one call — a per-chunk verdict plus an aggregate.

Authorization

AuthorizationBearer <token>

Your API key as a bearer token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/rag/retrieval" \  -H "Content-Type: application/json" \  -d '{    "query": "string",    "chunks": [      {        "chunk_id": "string",        "text": "string"      }    ]  }'
{
  "per_chunk": [
    {
      "job_id": "string",
      "decision": {
        "action": "ALLOW",
        "engine_action": "ALLOW",
        "needs_review": true,
        "confidence": 0.98,
        "suggestion": "ALLOW",
        "rationale": "Prompt-injection pattern detected.",
        "score_breakdown": {}
      },
      "policy": {
        "directives": [
          "string"
        ],
        "matched_rule_ids": [
          "string"
        ]
      },
      "language": {
        "language": "string",
        "detected": "string",
        "confidence": 0,
        "source": "string",
        "hint_agrees": true,
        "support_status": "string",
        "model_set": "string",
        "degraded": true,
        "message": "string"
      },
      "chunk_id": "string",
      "source": "rag_chunk"
    }
  ],
  "aggregate": {
    "worst_action": "string",
    "aggregate_risk": 0,
    "flagged_chunk_ids": [
      "string"
    ],
    "needs_review": true,
    "review_chunk_ids": [
      "string"
    ]
  }
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}