API · 16 operationer
rag-api
Genererad ur services/rag-api/openapi.json, kontraktsversion 0.1.0. Auth-modell och anropare står i atlasen.
GET /gdpr/users/{user_id_hash}/authoring/export
Export Subject Authoring
| Parameter | I | Typ | Krävs |
|---|---|---|---|
user_id_hash | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | any application/json |
422 | Validation Error | HTTPValidationError application/json |
GET /healthz
Healthz
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | { [nyckel]: string } application/json |
GET /readyz
Readyz
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | { [nyckel]: string } application/json |
GET /v1/collections
List Collections
| Parameter | I | Typ | Krävs |
|---|---|---|---|
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | CollectionOut[] application/json |
422 | Validation Error | HTTPValidationError application/json |
POST /v1/collections
Create Collection
| Parameter | I | Typ | Krävs |
|---|---|---|---|
authorization | header | string | null | nej |
Kropp: CollectionCreate application/json
| Svar | Beskrivning | Kropp |
|---|---|---|
201 | Successful Response | CollectionOut application/json |
422 | Validation Error | HTTPValidationError application/json |
GET /v1/collections/{collection_id}
Get Collection
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | CollectionOut application/json |
422 | Validation Error | HTTPValidationError application/json |
PATCH /v1/collections/{collection_id}
Patch Collection
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
Kropp: CollectionPatch application/json
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | CollectionOut application/json |
422 | Validation Error | HTTPValidationError application/json |
GET /v1/collections/{collection_id}/documents
List Documents
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | DocumentOut[] application/json |
422 | Validation Error | HTTPValidationError application/json |
POST /v1/collections/{collection_id}/documents
Create Document
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
Kropp: DocumentCreate application/json
| Svar | Beskrivning | Kropp |
|---|---|---|
201 | Successful Response | DocumentOut application/json |
422 | Validation Error | HTTPValidationError application/json |
DELETE /v1/collections/{collection_id}/documents/{doc_id}
Delete Document
Hård radering av dokumentet och alla dess versioner (F11, spec B5.1). Chunkar och ingest-jobb följer med via ON DELETE CASCADE. Går inte att ångra.
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
doc_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
204 | Successful Response | — |
422 | Validation Error | HTTPValidationError application/json |
GET /v1/collections/{collection_id}/documents/{doc_id}
Get Document
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
doc_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | DocumentOut application/json |
422 | Validation Error | HTTPValidationError application/json |
PATCH /v1/collections/{collection_id}/documents/{doc_id}
Patch Document
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
doc_id | path | string (uuid) | ja |
if-match | header | string | null | nej |
authorization | header | string | null | nej |
Kropp: DocumentDraft application/json
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | DocumentOut application/json |
422 | Validation Error | HTTPValidationError application/json |
GET /v1/collections/{collection_id}/documents/{doc_id}/ingest-status
Ingest Status
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
doc_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | IngestStatusOut application/json |
422 | Validation Error | HTTPValidationError application/json |
POST /v1/collections/{collection_id}/documents/{doc_id}/sections/{anchor}/verify
Verify Section
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
doc_id | path | string (uuid) | ja |
anchor | path | string | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | DocumentOut application/json |
422 | Validation Error | HTTPValidationError application/json |
GET /v1/collections/{collection_id}/documents/{doc_id}/versions
List Versions
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
doc_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | DocumentVersionOut[] application/json |
422 | Validation Error | HTTPValidationError application/json |
POST /v1/collections/{collection_id}/query
Query Collection
| Parameter | I | Typ | Krävs |
|---|---|---|---|
collection_id | path | string (uuid) | ja |
authorization | header | string | null | nej |
Kropp: QueryRequest application/json
| Svar | Beskrivning | Kropp |
|---|---|---|
200 | Successful Response | object application/json |
422 | Validation Error | HTTPValidationError application/json |
Scheman
AmountBlockOut
| Fält | Typ | Krävs |
|---|---|---|
content | string | ja |
id | string | ja |
valid_until | string | null | ja |
ClassSpan
| Fält | Typ | Krävs |
|---|---|---|
max | "gron" | "gul" | "rod" | ja |
min | "gron" | "gul" | "rod" | ja |
CollectionCreate
| Fält | Typ | Krävs |
|---|---|---|
domain | string | ja |
mcp_tool_name | string | nej |
name | string | ja |
not_shared_covered | boolean | nej |
owner | string | ja |
retrieval_mode | "full_prompt" | "retrieval" | ja |
source_type | "platform" | "mcp" | ja |
CollectionOut
| Fält | Typ | Krävs |
|---|---|---|
class_span | ClassSpan | null | ja |
created_at | string (date-time) | ja |
document_count | integer | ja |
domain | string | ja |
health | "ok" | "syncing" | "error" | ja |
id | string (uuid) | ja |
mcp_tool_name | string | ja |
name | string | ja |
owner | string | ja |
retrieval_mode | "full_prompt" | "retrieval" | ja |
source_type | "platform" | "mcp" | ja |
tenant_id | string (uuid) | ja |
unclassified_count | integer | ja |
updated_at | string (date-time) | ja |
CollectionPatch
| Fält | Typ | Krävs |
|---|---|---|
mcp_tool_name | string | null | nej |
owner | string | null | nej |
retrieval_mode | "full_prompt" | "retrieval" | null | nej |
DocumentCreate
Filvägen (spec §3.3): BFF sätter källmetadata när dokumentet kommer ur en fil. Alla fyra eller inget — ett halvt satt ursprung går inte att spåra.
| Fält | Typ | Krävs |
|---|---|---|
content_markdown | string | ja |
extractor_version | string | null | nej |
information_class | "gron" | "gul" | "rod" | null | nej |
source_filename | string | null | nej |
source_format | "pdf" | "docx" | "xlsx" | "pptx" | null | nej |
source_sha256 | string | null | nej |
status | "draft" | "published" | ja |
title | string | ja |
DocumentDraft
| Fält | Typ | Krävs |
|---|---|---|
content_markdown | string | ja |
information_class | "gron" | "gul" | "rod" | null | nej |
status | "draft" | "published" | ja |
title | string | ja |
DocumentOut
| Fält | Typ | Krävs |
|---|---|---|
amount_blocks | AmountBlockOut[] | ja |
classified_by | string | null | ja |
collection_id | string (uuid) | ja |
content_markdown | string | ja |
extractor_version | string | null | ja |
id | string (uuid) | ja |
information_class | "gron" | "gul" | "rod" | null | ja |
sections | DocumentSectionOut[] | ja |
source_filename | string | null | ja |
source_format | "pdf" | "docx" | "xlsx" | "pptx" | null | ja |
source_sha256 | string | null | ja |
status | "draft" | "published" | ja |
title | string | ja |
updated_at | string (date-time) | ja |
updated_by | string | ja |
version | integer | ja |
DocumentSectionOut
| Fält | Typ | Krävs |
|---|---|---|
anchor | string | ja |
title | string | ja |
verified_at | string | null | ja |
DocumentVersionOut
| Fält | Typ | Krävs |
|---|---|---|
content_markdown | string | ja |
updated_at | string (date-time) | ja |
updated_by | string | ja |
version | integer | ja |
HTTPValidationError
| Fält | Typ | Krävs |
|---|---|---|
detail | ValidationError[] | nej |
IngestStatusOut
| Fält | Typ | Krävs |
|---|---|---|
chunk_count | integer | null | ja |
document_id | string (uuid) | ja |
embedding_dims | integer | null | ja |
embedding_model | string | null | ja |
error_code | string | null | ja |
last_indexed_at | string (date-time) | null | ja |
state | "pending" | "chunking" | "embedding" | "indexed" | "failed" | "not_applicable" | ja |
QueryRequest
| Fält | Typ | Krävs |
|---|---|---|
assistant_id | string (uuid) | ja |
include_drafts | boolean | nej |
limit | integer | null | nej |
query | string | ja |
trace_id | string | ja |
user_context | UserContext | ja |
UserContext
| Fält | Typ | Krävs |
|---|---|---|
user_groups | string[] | nej |
user_id_hashPersonens identitet, injicerad av mcp-gateway: aktörsvärdet `sha256(canonical_json("platform:" + sub))` (D-113), inte `auth.users.id`. Namnet är historiskt och delas med policy-enginens beslutskontrakt, där samma fält också kan bära `auth.users.id`-UUID:t orört (P43). | string | null | nej |
user_role | string | null | nej |
ValidationError
| Fält | Typ | Krävs |
|---|---|---|
ctx | object | nej |
input | any | nej |
loc | string | integer[] | ja |
msg | string | ja |
type | string | ja |