Doc Extract API¶
Port : 8000 | NodePort : 30002 | Repo : solyntek/djinn/services/djinn-doc-extract
Extraction de données structurées depuis factures, reçus, CV et pièces d'identité via OCR + LLM.
Endpoints¶
| Méthode | Route | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/v1/schemas |
Schémas des types de documents supportés |
POST |
/v1/extract |
Extraction depuis un fichier unique |
POST |
/v1/extract/batch |
Extraction batch depuis plusieurs fichiers |
Types de documents¶
| Type | Données extraites |
|---|---|
invoice |
vendor, numéro, date, lignes, totaux, TVA, IBAN |
receipt |
vendor, date, lignes, totaux, mode de paiement |
resume |
nom, email, skills, expériences, diplômes, certifications |
id_card |
nom, date naissance, nationalité, numéro document |
Exemple¶
{
"document_type": "resume",
"data": {
"firstname": "Jean",
"lastname": "Dupont",
"skills": ["Python", "Go", "Docker"],
"experiences": [{"company": "Acme", "title": "Senior Dev"}]
},
"confidence": 0.87
}
Référence interactive¶
Générée à chaque build depuis la spec versionnée openapi/doc-extract-v1.json (ADR-011) — aucune route documentée à la main.
Djinn Document Extract 0.2.0¶
Extraction de données structurées depuis factures, reçus, CVs et IDs
Endpoints¶
GET /health¶
Health
Description
Health check endpoint.
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
GET /v1/schemas¶
Schemas
Description
List all supported document schemas with their fields.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /v1/extract¶
Extract
Description
Extract structured data from a single uploaded file.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
document_type |
query | No | |||
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Responses
{
"document_type": "invoice",
"data": null,
"text_source": null,
"raw_text": "string",
"confidence": 10.12,
"field_confidences": [
{
"field": "string",
"score": 10.12,
"reason": null
}
],
"pii_detected": null,
"error": null
}
Schema of the response body
{
"properties": {
"document_type": {
"$ref": "#/components/schemas/DocumentType"
},
"data": {
"anyOf": [
{
"$ref": "#/components/schemas/InvoiceData"
},
{
"$ref": "#/components/schemas/ReceiptData"
},
{
"$ref": "#/components/schemas/ResumeData"
},
{
"$ref": "#/components/schemas/IDCardData"
},
{
"type": "null"
}
],
"title": "Data"
},
"text_source": {
"anyOf": [
{
"$ref": "#/components/schemas/TextSource"
},
{
"type": "null"
}
]
},
"raw_text": {
"type": "string",
"title": "Raw Text"
},
"confidence": {
"type": "number",
"maximum": 1.0,
"minimum": 0.0,
"title": "Confidence"
},
"field_confidences": {
"items": {
"$ref": "#/components/schemas/FieldConfidence"
},
"type": "array",
"title": "Field Confidences"
},
"pii_detected": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Pii Detected"
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"required": [
"document_type",
"raw_text",
"confidence"
],
"title": "ExtractionResult"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /v1/extract/batch¶
Extract Batch
Description
Extract structured data from multiple uploaded files.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
document_type |
query | No | |||
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Responses
[
{
"document_type": "invoice",
"data": null,
"text_source": null,
"raw_text": "string",
"confidence": 10.12,
"field_confidences": [
{
"field": "string",
"score": 10.12,
"reason": null
}
],
"pii_detected": null,
"error": null
}
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schemas¶
Body_extract_batch_v1_extract_batch_post¶
| Name | Type | Description |
|---|---|---|
files |
Array<string> |
Body_extract_v1_extract_post¶
| Name | Type | Description |
|---|---|---|
file |
string |
Certification¶
| Name | Type | Description |
|---|---|---|
name |
||
provider |
||
year |
Diploma¶
| Name | Type | Description |
|---|---|---|
degree |
||
end_date |
||
field_of_study |
||
school |
||
start_date |
DocumentType¶
Type: string
Experience¶
| Name | Type | Description |
|---|---|---|
company |
||
description |
||
end_date |
YYYY-MM, YYYY, or 'Present' | |
location |
||
start_date |
YYYY-MM or YYYY | |
title |
ExtractionResult¶
| Name | Type | Description |
|---|---|---|
confidence |
number | |
data |
||
document_type |
DocumentType | |
error |
||
field_confidences |
Array<FieldConfidence> | |
pii_detected |
||
raw_text |
string | |
text_source |
FieldConfidence¶
| Name | Type | Description |
|---|---|---|
field |
string | |
reason |
||
score |
number |
HealthResponse¶
| Name | Type | Description |
|---|---|---|
status |
string | |
version |
string |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
IDCardData¶
| Name | Type | Description |
|---|---|---|
birth_date |
||
birth_place |
||
document_number |
||
expiry_date |
||
first_name |
||
gender |
M or F | |
issue_date |
||
last_name |
||
nationality |
InvoiceData¶
| Name | Type | Description |
|---|---|---|
currency |
ISO 4217 code (EUR, USD, ...) | |
due_date |
||
invoice_date |
||
invoice_number |
||
line_items |
Array<LineItem> | |
payment_method |
||
payment_reference |
IBAN or payment reference | |
subtotal |
||
total_amount |
||
vat_amount |
||
vendor_address |
||
vendor_name |
||
vendor_tax_id |
SIRET / tax ID |
LineItem¶
| Name | Type | Description |
|---|---|---|
amount |
||
description |
||
quantity |
||
unit_price |
||
vat_rate |
ReceiptData¶
| Name | Type | Description |
|---|---|---|
currency |
||
line_items |
Array<LineItem> | |
payment_method |
||
receipt_date |
||
subtotal |
||
total_amount |
||
vat_amount |
||
vendor_address |
||
vendor_name |
ResumeData¶
| Name | Type | Description |
|---|---|---|
certifications |
Array<Certification> | |
diplomas |
Array<Diploma> | |
email |
||
experiences |
Array<Experience> | |
firstname |
||
languages |
Array<string> | |
lastname |
||
linkedin |
||
location |
||
phone |
||
skills |
Array<string> |
SchemaField¶
| Name | Type | Description |
|---|---|---|
description |
||
name |
string | |
type |
string |
SchemaInfo¶
| Name | Type | Description |
|---|---|---|
document_type |
string | |
fields |
Array<SchemaField> |
TextSource¶
Type: string
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |