> For the complete documentation index, see [llms.txt](https://docs.mindee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindee.com/integrations/api-reference/classification-models.md).

# Classification Models

Help for manually integrating Classification models: API reference, test client, and cURL samples.

{% hint style="warning" %}
**We do not recommend manually integrating**, and cannot guarantee full support.

Pro plans and above benefit from extended integration support.
{% endhint %}

{% hint style="success" %}
**Recommended integrations:**

* [Client Libraries / SDKs](https://docs.mindee.com/integrations/client-libraries-sdk.md)
* [No-Code Integration](https://docs.mindee.com/extraction-models/no-code-integration.md)

Also take a look at the [Integration Overview](https://docs.mindee.com/integrations/api-overview.md) if you are setting up your integration for the first time.
{% endhint %}

## Send a file for a classification utility inference.

> Send a file to the asynchronous processing queue for a classification utility inference.\
> \
> Results can be retrieved in two ways:\
> \* Loop on the \`polling\_url\` endpoint in the response until the status\
> &#x20; is \`Processed\` or \`Failed\` (polling).\
> \* Use a webhook to be notified when the inference is finished.\
> &#x20; Webhooks can be configured on the platform on a per-model basis.\
> \
> Inferences taking longer than 590 seconds will time out.

```json
{"openapi":"3.1.0","info":{"title":"Mindee API","version":"2.0.0"},"servers":[{"url":"https://api-v2.mindee.net"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"JobResponse":{"properties":{"job":{"$ref":"#/components/schemas/Job"}},"type":"object","required":["job"],"title":"JobResponse","description":"Response for a Job."},"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."},"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."},"Status":{"type":"string","enum":["Processing","Failed","Processed"],"title":"Status","description":"Possible states of an operation."},"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/ExtendedStatus","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."},"ExtendedStatus":{"type":"string","enum":["Processing","Failed","Processed","Skipped"],"title":"ExtendedStatus","description":"Possible states of an extended operation."},"ErrorResponse":{"properties":{"status":{"type":"integer","maximum":599,"minimum":100,"title":"Status","description":"The HTTP status code returned by the server."},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to the occurrence of the problem."},"title":{"type":"string","title":"Title","description":"A short, human-readable summary of the problem."},"code":{"type":"string","title":"Code","description":"A machine-readable code specific to the occurrence of the problem."},"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."},"ErrorItem":{"properties":{"pointer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pointer","description":"A JSON Pointer to the location of the body property."},"detail":{"type":"string","title":"Detail","description":"Explicit information on the issue."}},"type":"object","required":["pointer","detail"],"title":"ErrorItem","description":"Explicit details on a problem."}}},"paths":{"/v2/products/classification/enqueue":{"post":{"tags":["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":{"properties":{"model_id":{"type":"string","format":"uuid4","title":"Model Id","description":"Model ID to use for the inference."},"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"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."},"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. Can be a list or comma-separated string."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Optional filename to associate with the uploaded or fetched file."},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Optional: a free-form string to tag the request with your own identifier. For example, an internal document ID, reference number, or database key. If set, it will be included in the job and result responses."},"extraction_text_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Text Context","description":"Pass additional context to the extraction model chained to this utility inference."},"utility_configuration":{"anyOf":[{"type":"string","contentMediaType":"application/json","contentSchema":{"properties":{"replace":{"anyOf":[{"properties":{"classification_values":{"items":{"properties":{"name":{"type":"string","title":"Name","description":"Value returned by the utility model and used to select an optional chained model."},"guidelines":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidelines","description":"Optional guidelines, used to help the model identify the class."},"chained_model_id":{"anyOf":[{"type":"string","format":"uuid4"},{"type":"null"}],"title":"Chained Model Id","description":"ID of the chained model"}},"type":"object","required":["name"],"title":"ClassificationConfiguration","description":"Configuration for classification utilities with optional chained model."},"type":"array","title":"Classification Values","description":"Required for `classification`, `split`, and `crop` types (at least one entry). Must be empty for other types (e.g. `ocr`)."},"type":{"type":"string","enum":["crop","split","classification","ocr"],"title":"UtilityType","description":"Enumeration of utility types."}},"type":"object","required":["type"],"title":"UtilityConfiguration","description":"Utility configuration for utility types."},{"type":"null"}],"description":"If set, completely replaces the utility configuration of the model."}},"type":"object","title":"DynamicUtilityConfiguration","description":"Dynamic changes to the utility configuration of the model."}},{"type":"null"}],"title":"Utility Configuration","description":"Dynamically change the utility configuration of the model, for this inference."}},"type":"object","required":["model_id"],"title":"UtilityEnqueueForm","description":"Form to enqueue an inference for utility models."}},"application/json":{"schema":{"properties":{"model_id":{"type":"string","format":"uuid4","title":"Model Id","description":"Model ID to use for the inference."},"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."},"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. Can be a list or comma-separated string."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Optional filename to associate with the uploaded or fetched file."},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Optional: a free-form string to tag the request with your own identifier. For example, an internal document ID, reference number, or database key. If set, it will be included in the job and result responses."},"extraction_text_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Text Context","description":"Pass additional context to the extraction model chained to this utility inference."},"utility_configuration":{"anyOf":[{"type":"string","contentMediaType":"application/json","contentSchema":{"properties":{"replace":{"anyOf":[{"properties":{"classification_values":{"items":{"properties":{"name":{"type":"string","title":"Name","description":"Value returned by the utility model and used to select an optional chained model."},"guidelines":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidelines","description":"Optional guidelines, used to help the model identify the class."},"chained_model_id":{"anyOf":[{"type":"string","format":"uuid4"},{"type":"null"}],"title":"Chained Model Id","description":"ID of the chained model"}},"type":"object","required":["name"],"title":"ClassificationConfiguration","description":"Configuration for classification utilities with optional chained model."},"type":"array","title":"Classification Values","description":"Required for `classification`, `split`, and `crop` types (at least one entry). Must be empty for other types (e.g. `ocr`)."},"type":{"type":"string","enum":["crop","split","classification","ocr"],"title":"UtilityType","description":"Enumeration of utility types."}},"type":"object","required":["type"],"title":"UtilityConfiguration","description":"Utility configuration for utility types."},{"type":"null"}],"description":"If set, completely replaces the utility configuration of the model."}},"type":"object","title":"DynamicUtilityConfiguration","description":"Dynamic changes to the utility configuration of the model."}},{"type":"null"}],"title":"Utility Configuration","description":"Dynamically change the utility configuration of the model, for this inference."}},"type":"object","required":["model_id"],"title":"UtilityEnqueueForm","description":"Form to enqueue an inference for utility models."}}},"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"}}}}}}}}}
```

## Get the status of a file's processing.

> Get the status of an inference that was previously enqueued.\
> \
> If you are using webhooks there is no need to call this route.\
> \
> When the job \`status\` is \`Processing\` or \`Failed\` the return code will be HTTP 200.\
> \
> When the job \`status\` is \`Processed\` the return code will be HTTP 302.\
> \
> The processing result can then be retrieved in two ways:\
> \* \*\*Recommended:\*\* Using a GET on the URL specified in the \`result\_url\` field of the response\
> \* Allowing your client to redirect on the \`Location\` header of the response\
> \
> Note: set the \`redirect\` parameter to \`false\` to disable the redirection behavior, and always return HTTP 200.

```json
{"openapi":"3.1.0","info":{"title":"Mindee API","version":"2.0.0"},"servers":[{"url":"https://api-v2.mindee.net"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"JobResponse":{"properties":{"job":{"$ref":"#/components/schemas/Job"}},"type":"object","required":["job"],"title":"JobResponse","description":"Response for a Job."},"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."},"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."},"Status":{"type":"string","enum":["Processing","Failed","Processed"],"title":"Status","description":"Possible states of an operation."},"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/ExtendedStatus","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."},"ExtendedStatus":{"type":"string","enum":["Processing","Failed","Processed","Skipped"],"title":"ExtendedStatus","description":"Possible states of an extended operation."},"ErrorResponse":{"properties":{"status":{"type":"integer","maximum":599,"minimum":100,"title":"Status","description":"The HTTP status code returned by the server."},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to the occurrence of the problem."},"title":{"type":"string","title":"Title","description":"A short, human-readable summary of the problem."},"code":{"type":"string","title":"Code","description":"A machine-readable code specific to the occurrence of the problem."},"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."},"ErrorItem":{"properties":{"pointer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pointer","description":"A JSON Pointer to the location of the body property."},"detail":{"type":"string","title":"Detail","description":"Explicit information on the issue."}},"type":"object","required":["pointer","detail"],"title":"ErrorItem","description":"Explicit details on a problem."}}},"paths":{"/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","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"}}}}}}
```

{% openapi-webhook spec="mindee-api" name="classification-utility-processed" method="post" %}
[mindee-api](https://api-v2.mindee.net/openapi.json)
{% endopenapi-webhook %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mindee.com/integrations/api-reference/classification-models.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
