{"openapi":"3.1.0","info":{"title":"Mindee API","summary":"The Mindee REST API","version":"2.0.0"},"servers":[{"url":"https://api-v2.mindee.net"}],"paths":{"/v2/products/classification/enqueue":{"post":{"tags":["Products","Classification Product"],"summary":"Send a file for a classification utility inference.","description":"Send a file to the asynchronous processing queue for a classification utility inference.\n\nResults can be retrieved in two ways:\n* Loop on the `polling_url` endpoint in the response until the status\n  is `Processed` or `Failed` (polling).\n* Use a webhook to be notified when the inference is finished.\n  Webhooks can be configured on the platform on a per-model basis.\n\nInferences taking longer than 590 seconds will time out.","operationId":"Enqueue_Classification_Product_Inference_v2_products_classification_enqueue_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UtilityEnqueueForm"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v2/products/classification/results/{inference_id}":{"get":{"tags":["Products","Classification Product"],"summary":"Get the result of a completed classification product inference.","description":"Get the result of a classification utility inference that was previously enqueued.\n\nThe inference will only be available after it has finished processing.\n\nIf you are using webhooks there is no need to call this route.<br/>\nHowever, the JSON payload described here is what will be sent to each specified webhook's URL.\n\nIf you activated the \"Delete extracted data when fetched\" option for the model,\nthe inference will be deleted after this route completes.<br>\nAny further requests to the same inference ID will return a 404.","operationId":"Get_classification_Product_Result_v2_products_classification_results__inference_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Inference ID","description":"UUID of the inference to retrieve"},"description":"UUID of the inference to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassificationResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"}}}},"/v2/products/crop/enqueue":{"post":{"tags":["Products","Crop Product"],"summary":"Send a file for a crop utility inference.","description":"Send a file to the asynchronous processing queue for a crop utility inference.\n\nResults can be retrieved in two ways:\n* Loop on the `polling_url` endpoint in the response until the status\n  is `Processed` or `Failed` (polling).\n* Use a webhook to be notified when the inference is finished.\n  Webhooks can be configured on the platform on a per-model basis.\n\nInferences taking longer than 590 seconds will time out.","operationId":"Enqueue_Crop_Product_Inference_v2_products_crop_enqueue_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UtilityEnqueueForm"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v2/products/crop/results/{inference_id}":{"get":{"tags":["Products","Crop Product"],"summary":"Get the result of a completed crop product inference.","description":"Get the result of a crop utility inference that was previously enqueued.\n\nThe inference will only be available after it has finished processing.\n\nIf you are using webhooks there is no need to call this route.<br/>\nHowever, the JSON payload described here is what will be sent to each specified webhook's URL.\n\nIf you activated the \"Delete extracted data when fetched\" option for the model,\nthe inference will be deleted after this route completes.<br>\nAny further requests to the same inference ID will return a 404.","operationId":"Get_Crop_Product_Result_v2_products_crop_results__inference_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Inference ID","description":"UUID of the inference to retrieve"},"description":"UUID of the inference to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CropResponse-Output"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"}}}},"/v2/products/extraction/enqueue":{"post":{"tags":["Products","Extraction Product"],"summary":"Send a file for an extraction product inference.","description":"Send a file to the asynchronous processing queue for an extraction inference.\n\nResults can be retrieved in two ways:\n* Loop on the `polling_url` endpoint in the response until the status\n  is `Processed` or `Failed` (polling).\n* Use a webhook to be notified when the inference is finished.\n  Webhooks can be configured on the platform on a per-model basis.\n\nInferences taking longer than 590 seconds will time out.","operationId":"Enqueue_Extraction_Product_Inference_v2_products_extraction_enqueue_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ExtractionEnqueueForm"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v2/inferences/enqueue":{"post":{"tags":["Products","Extraction Product"],"summary":"Send a file for an inference.","description":"Send a file to the asynchronous processing queue for an extraction inference.\n\nResults can be retrieved in two ways:\n* Loop on the `polling_url` endpoint in the response until the status\n  is `Processed` or `Failed` (polling).\n* Use a webhook to be notified when the inference is finished.\n  Webhooks can be configured on the platform on a per-model basis.\n\nInferences taking longer than 590 seconds will time out.","operationId":"Enqueue_Extraction_Inference_v2_inferences_enqueue_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ExtractionEnqueueForm"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"deprecated":true,"security":[{"APIKeyHeader":[]}]}},"/v2/products/extraction/results/{inference_id}":{"get":{"tags":["Products","Extraction Product"],"summary":"Get the result of a completed extraction product inference.","description":"Get the result of an extraction inference that was previously enqueued.\n\nThe inference will only be available after it has finished processing.\n\nIf you are using webhooks there is no need to call this route.<br/>\nHowever, the JSON payload described here is what will be sent to each specified webhook's URL.\n\nIf you activated the \"Delete extracted data when fetched\" option for the model,\nthe inference will be deleted after this route completes.<br>\nAny further requests to the same inference ID will return a 404.","operationId":"Get_Extraction_Product_Result_v2_products_extraction_results__inference_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Inference ID","description":"UUID of the inference to retrieve"},"description":"UUID of the inference to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionResponse-Output"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"}}}},"/v2/inferences/{inference_id}":{"get":{"tags":["Products","Extraction Product"],"summary":"Get the result of a completed extraction inference.","description":"Get the result of an extraction inference that was previously enqueued.\n\nThe inference will only be available after it has finished processing.\n\nIf you are using webhooks there is no need to call this route.<br/>\nHowever, the JSON payload described here is what will be sent to each specified webhook's URL.\n\nIf you activated the \"Delete extracted data when fetched\" option for the model,\nthe inference will be deleted after this route completes.<br>\nAny further requests to the same inference ID will return a 404.","operationId":"Get_Extraction_Inference_Result_v2_inferences__inference_id__get","deprecated":true,"security":[{"APIKeyHeader":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Inference ID","description":"UUID of the inference to retrieve"},"description":"UUID of the inference to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionResponse-Output"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"}}}},"/v2/products/ocr/enqueue":{"post":{"tags":["Products","OCR Product"],"summary":"Send a file for an ocr utility inference.","description":"Send a file to the asynchronous processing queue for an ocr utility inference.\n\nResults can be retrieved in two ways:\n* Loop on the `polling_url` endpoint in the response until the status\n  is `Processed` or `Failed` (polling).\n* Use a webhook to be notified when the inference is finished.\n  Webhooks can be configured on the platform on a per-model basis.\n\nInferences taking longer than 590 seconds will time out.","operationId":"Enqueue_OCR_Product_Inference_v2_products_ocr_enqueue_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UtilityEnqueueForm"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v2/products/ocr/results/{inference_id}":{"get":{"tags":["Products","OCR Product"],"summary":"Get the result of a completed ocr product inference.","description":"Get the result of an ocr utility inference that was previously enqueued.\n\nThe inference will only be available after it has finished processing.\n\nIf you are using webhooks there is no need to call this route.<br/>\nHowever, the JSON payload described here is what will be sent to each specified webhook's URL.\n\nIf you activated the \"Delete extracted data when fetched\" option for the model,\nthe inference will be deleted after this route completes.<br>\nAny further requests to the same inference ID will return a 404.","operationId":"Get_OCR_Product_Result_v2_products_ocr_results__inference_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Inference ID","description":"UUID of the inference to retrieve"},"description":"UUID of the inference to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OCRResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"}}}},"/v2/products/split/enqueue":{"post":{"tags":["Products","Split Product"],"summary":"Send a file for a split utility inference.","description":"Send a file to the asynchronous processing queue for a split utility inference.\n\nResults can be retrieved in two ways:\n* Loop on the `polling_url` endpoint in the response until the status\n  is `Processed` or `Failed` (polling).\n* Use a webhook to be notified when the inference is finished.\n  Webhooks can be configured on the platform on a per-model basis.\n\nInferences taking longer than 590 seconds will time out.","operationId":"Enqueue_Split_Product_Inference_v2_products_split_enqueue_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UtilityEnqueueForm"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v2/products/split/results/{inference_id}":{"get":{"tags":["Products","Split Product"],"summary":"Get the result of a completed split product inference.","description":"Get the result of a split utility inference that was previously enqueued.\n\nThe inference will only be available after it has finished processing.\n\nIf you are using webhooks there is no need to call this route.<br/>\nHowever, the JSON payload described here is what will be sent to each specified webhook's URL.\n\nIf you activated the \"Delete extracted data when fetched\" option for the model,\nthe inference will be deleted after this route completes.<br>\nAny further requests to the same inference ID will return a 404.","operationId":"Get_Split_Product_Result_v2_products_split_results__inference_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Inference ID","description":"UUID of the inference to retrieve"},"description":"UUID of the inference to retrieve"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitResponse"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"}}}},"/v2/jobs/{job_id}":{"get":{"tags":["Polling"],"summary":"Get the status of a file's processing.","description":"Get the status of an inference that was previously enqueued.\n\nIf you are using webhooks there is no need to call this route.\n\nWhen the job `status` is `Processing` or `Failed` the return code will be HTTP 200.\n\nWhen the job `status` is `Processed` the return code will be HTTP 302.\n\nThe processing result can then be retrieved in two ways:\n* **Recommended:** Using a GET on the URL specified in the `result_url` field of the response\n* Allowing your client to redirect on the `Location` header of the response\n\nNote: set the `redirect` parameter to `false` to disable the redirection behavior, and always return HTTP 200.","operationId":"Get_Job_Status_v2_jobs__job_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid4","title":"Job ID","description":"UUID of the job to retrieve"},"description":"UUID of the job to retrieve"},{"name":"redirect","in":"query","required":false,"schema":{"type":"boolean","description":"Automatically redirect to the result URL","default":true,"title":"Redirect"},"description":"Automatically redirect to the result URL"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"302":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}},"description":"Found"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}}},"webhooks":{"extraction-processed":{"post":{"summary":"Extraction Processed","description":"When an extraction inference is processed, this payload is sent to the specified webhooks.\n\nWebhooks are specified in the `webhooks_ids` parameter when enqueuing an extraction inference.","operationId":"extraction_processedextraction_processed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionResponse-Input"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"crop-utility-processed":{"post":{"summary":"Crop Utility Processed","description":"When a crop utility inference is processed, this payload is sent to the specified webhooks.\n\nWebhooks are specified in the `webhooks_ids` parameter when enqueuing a crop utility inference.","operationId":"crop_utility_processedcrop_utility_processed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CropResponse-Input"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BaseJob":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Job."}},"type":"object","required":["id"],"title":"BaseJob","description":"Base class for Job."},"ClassificationInference":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/ClassificationResult"}},"type":"object","required":["id","job","model","file","result"],"title":"ClassificationInference","description":"The inference result for a classification utility request."},"ClassificationResponse":{"properties":{"inference":{"$ref":"#/components/schemas/ClassificationInference"}},"type":"object","required":["inference"],"title":"ClassificationResponse","description":"Response for a classification utility inference."},"ClassificationResult":{"properties":{"classification":{"$ref":"#/components/schemas/Classifier","title":"Document","description":"Classification of document type from the source file."}},"type":"object","required":["classification"],"title":"ClassificationResult","description":"Result of the document classifier inference."},"Classifier":{"properties":{"document_type":{"type":"string","title":"Document Type","description":"The document type, as identified on given classification values."}},"type":"object","required":["document_type"],"title":"Classifier","description":"Document level classification."},"Crop":{"properties":{"object_type":{"type":"string","title":"Object Type","description":"Type or classification of the detected object."},"location":{"$ref":"#/components/schemas/FieldLocation","title":"Location","description":"Location which includes cropping coordinates for the detected object, within the source document."}},"type":"object","required":["object_type","location"],"title":"Crop","description":"Result of a cropped document region."},"CropInference-Input":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/CropResult-Input"}},"type":"object","required":["id","job","model","file","result"],"title":"CropInference","description":"The inference result for a crop utility request."},"CropInference-Output":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/CropResult-Output"}},"type":"object","required":["id","job","model","file","result"],"title":"CropInference","description":"The inference result for a crop utility request."},"CropResponse-Input":{"properties":{"inference":{"$ref":"#/components/schemas/CropInference-Input"}},"type":"object","required":["inference"],"title":"CropResponse","description":"Response for a crop utility inference."},"CropResponse-Output":{"properties":{"inference":{"$ref":"#/components/schemas/CropInference-Output"}},"type":"object","required":["inference"],"title":"CropResponse","description":"Response for a crop utility inference."},"CropResult-Input":{"properties":{"crops":{"items":{"$ref":"#/components/schemas/Crop"},"type":"array","title":"Crops","description":"List of objects and their cropping coordinates identified in the source document."}},"type":"object","required":["crops"],"title":"CropResult","description":"Result of a crop utility inference."},"CropResult-Output":{"properties":{"crops":{"items":{"$ref":"#/components/schemas/Crop"},"type":"array","title":"Crops","description":"List of objects and their cropping coordinates identified in the source document."}},"type":"object","required":["crops"],"title":"CropResult","description":"Result of a crop utility inference."},"DataSchemaActiveOption":{"properties":{"replace":{"type":"boolean","title":"Replace","description":"Whether the data schema was replaced for the inference."}},"type":"object","required":["replace"],"title":"DataSchemaActiveOption","description":"Data schema options activated during the inference."},"DynamicDataSchema":{"properties":{"replace":{"anyOf":[{"$ref":"#/components/schemas/ExtractionDataSchema"},{"type":"null"}],"description":"If set, completely replaces the data schema of the model."}},"type":"object","title":"DynamicDataSchema","description":"Dynamic changes to the Data Schema of the model."},"ErrorItem":{"properties":{"pointer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pointer","description":"A JSON Pointer to the location of the body property.","examples":["#/model_id"]},"detail":{"type":"string","title":"Detail","description":"Explicit information on the issue.","examples":["'model_id' must be a valid UUID format"]}},"type":"object","required":["pointer","detail"],"title":"ErrorItem","description":"Explicit details on a problem."},"ErrorResponse":{"properties":{"status":{"type":"integer","maximum":599.0,"minimum":100.0,"title":"Status","description":"The HTTP status code returned by the server.","examples":[422]},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to the occurrence of the problem.","examples":["One or more fields failed validation."]},"title":{"type":"string","title":"Title","description":"A short, human-readable summary of the problem.","examples":["Invalid fields in form"]},"code":{"type":"string","title":"Code","description":"A machine-readable code specific to the occurrence of the problem.","examples":["422-001"]},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","description":"A list of explicit details on the problem.","default":[]}},"type":"object","required":["status","detail","title","code"],"title":"ErrorResponse","description":"Error response detailing a problem. The format adheres to RFC 9457."},"ExtractionDataSchema":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/FieldSchema"},"type":"array","title":"Fields","description":"All fields in the Data Schema."}},"type":"object","required":["fields"],"title":"ExtractionDataSchema","description":"The JSON structure of an extraction model's data schema."},"ExtractionEnqueueForm":{"properties":{"model_id":{"type":"string","format":"uuid4","title":"Model Id","description":"Model ID to use for the inference."},"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File","description":"Upload a file as bytes. Required if `url` is not provided."},"url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url","description":"Download the file from a URL, must be secure (HTTPS) and publicly available. Required if `file` is not provided."},"file_base64":{"anyOf":[{"type":"string","minLength":15},{"type":"null"}],"title":"File Base64","description":"Upload a file as a base 64 string. Used as an alternative to `file`. *Not recommended*, for specific use only.","examples":["Base64String=="]},"webhook_ids":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Webhook Ids","description":"Webhook IDs to call after all processing is finished. If empty, no webhooks will be used."},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Use an alias to link the file to your own DB. If empty, no alias will be used.","examples":["my_file_alias"]},"raw_text":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Raw Text","description":"Extract the entire text from the document as strings, and fill the `raw_text` attribute."},"polygon":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Polygon","description":"Calculate bounding box polygons for values, and fill the `locations` attribute of fields"},"confidence":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Confidence","description":"Calculate confidence scores for values, and fill the `confidence` attribute of fields. Useful for automation."},"rag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rag","description":"Use Retrieval-Augmented Generation during inference."},"text_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Context","description":"Pass additional context for use by the model, for this inference.","examples":["This document is a receipt from a grocery store."]},"data_schema":{"anyOf":[{"type":"string","contentMediaType":"application/json","contentSchema":{"$ref":"#/components/schemas/DynamicDataSchema"}},{"type":"null"}],"title":"Data Schema","description":"Dynamically change the data schema of the model, for this inference."}},"type":"object","required":["model_id"],"title":"ExtractionEnqueueForm","description":"Form to enqueue an inference for extraction models."},"ExtractionInference-Input":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/ExtractionResult-Input"},"active_options":{"$ref":"#/components/schemas/InferenceActiveOptions"}},"type":"object","required":["id","job","model","file","result","active_options"],"title":"ExtractionInference","description":"The inference result for an extraction request."},"ExtractionInference-Output":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/ExtractionResult-Output"},"active_options":{"$ref":"#/components/schemas/InferenceActiveOptions"}},"type":"object","required":["id","job","model","file","result","active_options"],"title":"ExtractionInference","description":"The inference result for an extraction request."},"ExtractionResponse-Input":{"properties":{"inference":{"$ref":"#/components/schemas/ExtractionInference-Input"}},"type":"object","required":["inference"],"title":"ExtractionResponse","description":"Response for an extraction inference."},"ExtractionResponse-Output":{"properties":{"inference":{"$ref":"#/components/schemas/ExtractionInference-Output"}},"type":"object","required":["inference"],"title":"ExtractionResponse","description":"Response for an extraction inference."},"ExtractionResult-Input":{"properties":{"fields":{"additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/SimpleField"},{"$ref":"#/components/schemas/ObjectField-Input"},{"$ref":"#/components/schemas/ListField-Input"}]},"propertyNames":{"description":"Name of the field in the data schema.","examples":["my_simple_field"]},"type":"object","title":"Fields","description":"Extracted fields, the key corresponds to the field's name in the data schema."},"raw_text":{"anyOf":[{"$ref":"#/components/schemas/RawText"},{"type":"null"}],"title":"Raw Text","description":"If `raw_text` was activated, contains the extracted text of the document."},"rag":{"anyOf":[{"$ref":"#/components/schemas/Rag"},{"type":"null"}],"title":"RAG","description":"If `rag` was activated, contains metadata about the RAG operation."}},"type":"object","required":["fields"],"title":"ExtractionResult","description":"Result of an extraction inference."},"ExtractionResult-Output":{"properties":{"fields":{"additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/SimpleField"},{"$ref":"#/components/schemas/ObjectField-Output"},{"$ref":"#/components/schemas/ListField-Output"}]},"propertyNames":{"description":"Name of the field in the data schema.","examples":["my_simple_field"]},"type":"object","title":"Fields","description":"Extracted fields, the key corresponds to the field's name in the data schema."},"raw_text":{"anyOf":[{"$ref":"#/components/schemas/RawText"},{"type":"null"}],"title":"Raw Text","description":"If `raw_text` was activated, contains the extracted text of the document."},"rag":{"anyOf":[{"$ref":"#/components/schemas/Rag"},{"type":"null"}],"title":"RAG","description":"If `rag` was activated, contains metadata about the RAG operation."}},"type":"object","required":["fields"],"title":"ExtractionResult","description":"Result of an extraction inference."},"FieldConfidence":{"type":"string","enum":["Certain","High","Medium"],"title":"FieldConfidence","description":"Confidence level of a field."},"FieldLocation":{"properties":{"polygon":{"items":{"prefixItems":[{"type":"number","maximum":1.0,"minimum":0.0,"title":"Coordinate","description":"Coordinate value relative to document edge."},{"type":"number","maximum":1.0,"minimum":0.0,"title":"Coordinate","description":"Coordinate value relative to document edge."}],"type":"array","maxItems":2,"minItems":2,"title":"Point","description":"Relative coordinates of a point in [X,Y] notation."},"type":"array","minItems":3,"title":"Polygon","description":"Position information as a list of points in clockwise order."},"page":{"type":"integer","minimum":0.0,"title":"Page","description":"0-based page index of where the polygon is located."}},"type":"object","required":["polygon","page"],"title":"FieldLocation","description":"A field's location on the document."},"FieldSchema":{"properties":{"classification_values":{"items":{"type":"string"},"type":"array","title":"Classification Values","description":"Allowed values when type is `classification`. Leave empty for other types."},"title":{"type":"string","title":"Title","description":"Display name for the field, also impacts inference results."},"name":{"type":"string","title":"Field Name","description":"Name of the field in the data schema.","examples":["my_simple_field"]},"is_array":{"type":"boolean","title":"Is Array","description":"Whether this field can contain multiple values"},"unique_values":{"type":"boolean","title":"Unique Values","description":"Whether to remove duplicate values in the array. Only applicable if `is_array` is True.","default":false},"description":{"type":"string","title":"Description","description":"Detailed description of what the field represents."},"guidelines":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidelines","description":"Optional extraction guidelines."},"type":{"$ref":"#/components/schemas/FieldType","description":"Data type of the field"},"nested_fields":{"items":{"$ref":"#/components/schemas/SubFieldSchema"},"type":"array","title":"Nested Fields","description":"Subfields when type is `nested_object`. Leave empty for other types"}},"type":"object","required":["title","name","is_array","description","type"],"title":"FieldSchema","description":"A field in the data schema."},"FieldType":{"type":"string","enum":["string","number","date","boolean","classification","nested_object","object_detection","barcode"],"title":"FieldType","description":"Enumeration of valid field types for data schema fields."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InferenceActiveOptions":{"properties":{"raw_text":{"type":"boolean","title":"Raw Text","description":"Whether the Raw Text feature was activated.\nWhen this feature is activated, the raw text extracted from the document is returned in the result."},"polygon":{"type":"boolean","title":"Polygon","description":"Whether the polygon feature was activated.\nWhen this feature is activated, the bounding-box polygon(s) for each field is returned in the result."},"confidence":{"type":"boolean","title":"Confidence","description":"Whether the confidence feature was activated.\nWhen this feature is activated, a confidence score for each field is returned in the result."},"rag":{"type":"boolean","title":"RAG","description":"Whether the Retrieval-Augmented Generation feature was activated.\nWhen this feature is activated, the RAG pipeline is used to increase result accuracy."},"multipage_context":{"type":"boolean","title":"Multipage Context","description":"Whether the multipage context feature was activated.\nWhen this feature is activated, the model has access to all the other pages as context."},"text_context":{"type":"boolean","title":"Text Context","description":"Whether the text context feature was activated.\nWhen this feature is activated, the provided context is used to improve the accuracy of the inference."},"data_schema":{"$ref":"#/components/schemas/DataSchemaActiveOption","title":"Data Schema","description":"Data schema options provided for the inference."}},"type":"object","required":["raw_text","polygon","confidence","rag","multipage_context","text_context","data_schema"],"title":"InferenceActiveOptions","description":"Options which were activated during the inference.\n\nOptions can be activated or deactivated:\n* By setting their default values on the Platform UI\n* By explicitly setting them in the inference request"},"InferenceFile":{"properties":{"name":{"type":"string","title":"Name","description":"File name as sent to the API."},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Alias sent to the API."},"page_count":{"type":"integer","minimum":1.0,"title":"Page Count","description":"Number of pages in the file."},"mime_type":{"type":"string","title":"MIME Type","description":"Detected MIME type of the file."}},"type":"object","required":["name","page_count","mime_type"],"title":"InferenceFile","description":"File used for the inference."},"InferenceModel":{"properties":{"id":{"type":"string","format":"uuid4","title":"ID","description":"UUID of the model."}},"type":"object","required":["id"],"title":"InferenceModel","description":"Model used for the inference."},"Job":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Job."},"model_id":{"type":"string","format":"uuid4","title":"Model Id","description":"UUID of the model to be used for the inference."},"filename":{"type":"string","title":"Filename","description":"Name of the file sent.","examples":["file.jpg"]},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Optional alias sent for the file."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Date and time of the Job creation."},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"Date and time of the Job completion. Filled once processing is finished."},"status":{"$ref":"#/components/schemas/Status"},"polling_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Polling Url","description":"URL to poll for the Job status."},"result_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Result Url","description":"URL to retrieve the inference results. Will be filled once the inference is ready."},"webhooks":{"items":{"$ref":"#/components/schemas/WebhookResponse"},"type":"array","title":"Webhooks","description":"List of responses from webhooks called. Empty until processing is finished.","default":[]},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"type":"null"}],"description":"If an error occurred during processing, contains the problem details."}},"type":"object","required":["id","model_id","filename","created_at","status","polling_url"],"title":"Job","description":"Information on the processing of a file sent to the Mindee API."},"JobResponse":{"properties":{"job":{"$ref":"#/components/schemas/Job"}},"type":"object","required":["job"],"title":"JobResponse","description":"Response for a Job."},"ListField-Input":{"properties":{"items":{"items":{"oneOf":[{"$ref":"#/components/schemas/SimpleField"},{"$ref":"#/components/schemas/ObjectField-Input"},{"$ref":"#/components/schemas/ListField-Input"}]},"type":"array","title":"Items"},"confidence":{"anyOf":[{"$ref":"#/components/schemas/FieldConfidence"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["items"],"title":"ListField","description":"Field having a list of fields."},"ListField-Output":{"properties":{"items":{"items":{"oneOf":[{"$ref":"#/components/schemas/SimpleField"},{"$ref":"#/components/schemas/ObjectField-Output"},{"$ref":"#/components/schemas/ListField-Output"}]},"type":"array","title":"Items"},"confidence":{"anyOf":[{"$ref":"#/components/schemas/FieldConfidence"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["items"],"title":"ListField","description":"Field having a list of fields."},"OCRInference":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/OCRResult"}},"type":"object","required":["id","job","model","file","result"],"title":"OCRInference","description":"The inference result for a ocr utility request."},"OCRResponse":{"properties":{"inference":{"$ref":"#/components/schemas/OCRInference"}},"type":"object","required":["inference"],"title":"OCRResponse","description":"Response for an ocr utility inference."},"OCRResult":{"properties":{"pages":{"items":{"$ref":"#/components/schemas/PageOCR"},"type":"array","title":"pages","description":"List of OCR results for each page in the document."}},"type":"object","required":["pages"],"title":"OCRResult","description":"Result of the OCR utility inference."},"ObjectField-Input":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/FieldLocation"},"type":"array","title":"Locations","default":[]},"confidence":{"anyOf":[{"$ref":"#/components/schemas/FieldConfidence"},{"type":"null"}]},"fields":{"additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/SimpleField"},{"$ref":"#/components/schemas/ObjectField-Input"},{"$ref":"#/components/schemas/ListField-Input"}]},"propertyNames":{"description":"Name of the field in the data schema.","examples":["my_simple_field"]},"type":"object","title":"Fields"}},"additionalProperties":false,"type":"object","required":["fields"],"title":"ObjectField","description":"Field having a set of sub-fields."},"ObjectField-Output":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/FieldLocation"},"type":"array","title":"Locations","default":[]},"confidence":{"anyOf":[{"$ref":"#/components/schemas/FieldConfidence"},{"type":"null"}]},"fields":{"additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/SimpleField"},{"$ref":"#/components/schemas/ObjectField-Output"},{"$ref":"#/components/schemas/ListField-Output"}]},"propertyNames":{"description":"Name of the field in the data schema.","examples":["my_simple_field"]},"type":"object","title":"Fields"}},"additionalProperties":false,"type":"object","required":["fields"],"title":"ObjectField","description":"Field having a set of sub-fields."},"PageOCR":{"properties":{"words":{"items":{"$ref":"#/components/schemas/WordOCR"},"type":"array","title":"Words","description":"List of words extracted from the document page."},"content":{"type":"string","title":"Content","description":"Full text content extracted from the document page."}},"type":"object","required":["words","content"],"title":"PageOCR","description":"OCR result for a single page."},"Rag":{"properties":{"retrieved_document_id":{"anyOf":[{"type":"string","format":"uuid4"},{"type":"null"}],"title":"Retrieved document ID","description":"The UUID of the matched document used during the RAG operation."}},"type":"object","required":["retrieved_document_id"],"title":"Rag","description":"Metadata about the RAG operation."},"RawText":{"properties":{"pages":{"items":{"$ref":"#/components/schemas/RawTextPage"},"type":"array","title":"Pages","description":"List of pages with their extracted text content."}},"type":"object","required":["pages"],"title":"RawText","description":"Raw text extracted from all pages in the document."},"RawTextPage":{"properties":{"content":{"type":"string","title":"Content","description":"Text content of the page as a single string. '\\n' is used to separate lines."}},"type":"object","required":["content"],"title":"RawTextPage","description":"Raw text extracted from a single page."},"SimpleField":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/FieldLocation"},"type":"array","title":"Locations","default":[]},"confidence":{"anyOf":[{"$ref":"#/components/schemas/FieldConfidence"},{"type":"null"}]},"value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"}},"additionalProperties":false,"type":"object","required":["value"],"title":"SimpleField","description":"Field having a single value."},"SplitInference":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the Inference."},"job":{"$ref":"#/components/schemas/BaseJob","title":"Job","description":"Job the inference belongs to."},"model":{"$ref":"#/components/schemas/InferenceModel"},"file":{"$ref":"#/components/schemas/InferenceFile"},"result":{"$ref":"#/components/schemas/SplitResult"}},"type":"object","required":["id","job","model","file","result"],"title":"SplitInference","description":"The inference result for a split utility request."},"SplitRange":{"properties":{"page_range":{"items":{"type":"integer","minimum":0.0},"type":"array","maxItems":2,"minItems":2,"title":"Page Range","description":"0-based page indexes, where the first integer indicates the start page and the second integer indicates the end page."},"document_type":{"type":"string","title":"Document Type","description":"The document type, as identified on given classification values."}},"type":"object","required":["page_range","document_type"],"title":"SplitRange","description":"A single document as identified when splitting a multi-document source file."},"SplitResponse":{"properties":{"inference":{"$ref":"#/components/schemas/SplitInference"}},"type":"object","required":["inference"],"title":"SplitResponse","description":"Response for a split utility inference."},"SplitResult":{"properties":{"splits":{"items":{"$ref":"#/components/schemas/SplitRange"},"type":"array","title":"Documents","description":"List of documents identified within a multi-document source file."}},"type":"object","required":["splits"],"title":"SplitResult","description":"Result of the document splitter inference."},"Status":{"type":"string","enum":["Processing","Failed","Processed"],"title":"Status","description":"Possible states of an operation."},"SubFieldSchema":{"properties":{"classification_values":{"items":{"type":"string"},"type":"array","title":"Classification Values","description":"Allowed values when type is `classification`. Leave empty for other types."},"title":{"type":"string","title":"Title","description":"Display name for the field, also impacts inference results."},"name":{"type":"string","title":"Field Name","description":"Name of the field in the data schema.","examples":["my_simple_field"]},"is_array":{"type":"boolean","title":"Is Array","description":"Whether this field can contain multiple values"},"unique_values":{"type":"boolean","title":"Unique Values","description":"Whether to remove duplicate values in the array. Only applicable if `is_array` is True.","default":false},"description":{"type":"string","title":"Description","description":"Detailed description of what the field represents."},"guidelines":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidelines","description":"Optional extraction guidelines."},"type":{"$ref":"#/components/schemas/SubFieldType","description":"Data type of the subfield"}},"type":"object","required":["title","name","is_array","description","type"],"title":"SubFieldSchema","description":"Subfield model for nested objects in data models."},"SubFieldType":{"type":"string","enum":["string","number","date","boolean","classification"],"title":"SubFieldType","description":"Enumeration of valid field types for subfields (excludes nested_object and object_detection)."},"UtilityEnqueueForm":{"properties":{"model_id":{"type":"string","format":"uuid4","title":"Model Id","description":"Model ID to use for the inference."},"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File","description":"Upload a file as bytes. Required if `url` is not provided."},"url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url","description":"Download the file from a URL, must be secure (HTTPS) and publicly available. Required if `file` is not provided."},"file_base64":{"anyOf":[{"type":"string","minLength":15},{"type":"null"}],"title":"File Base64","description":"Upload a file as a base 64 string. Used as an alternative to `file`. *Not recommended*, for specific use only.","examples":["Base64String=="]},"webhook_ids":{"items":{"type":"string","format":"uuid4"},"type":"array","title":"Webhook Ids","description":"Webhook IDs to call after all processing is finished. If empty, no webhooks will be used."},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Use an alias to link the file to your own DB. If empty, no alias will be used.","examples":["my_file_alias"]}},"type":"object","required":["model_id"],"title":"UtilityEnqueueForm","description":"Form to enqueue an inference for utility models."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookResponse":{"properties":{"id":{"type":"string","format":"uuid4","title":"Id","description":"UUID of the webhook endpoint."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Date and time the webhook was called."},"status":{"$ref":"#/components/schemas/Status","default":"Processing"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"type":"null"}],"description":"If an error occurred when calling the webhook, contains the problem details."},"attempts_count":{"type":"integer","title":"Attempts Count","description":"Number of attempts made to call the webhook.","default":0}},"type":"object","required":["id"],"title":"WebhookResponse","description":"Response from a webhook call."},"WordOCR":{"properties":{"content":{"type":"string","title":"Content","description":"Text content of the word."},"polygon":{"items":{"prefixItems":[{"type":"number","maximum":1.0,"minimum":0.0,"title":"Coordinate","description":"Coordinate value relative to document edge."},{"type":"number","maximum":1.0,"minimum":0.0,"title":"Coordinate","description":"Coordinate value relative to document edge."}],"type":"array","maxItems":2,"minItems":2,"title":"Point","description":"Relative coordinates of a point in [X,Y] notation."},"type":"array","minItems":3,"title":"Polygon","description":"Position information as a list of points in clockwise order."}},"type":"object","required":["content","polygon"],"title":"WordOCR","description":"OCR result for a single word extracted from the document page."}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}}}}