---
title: Predictions for unstructured model deployments
description: Using a specified endpoint, calculates predictions based on user-provided data for a specific unstructured model deployment.

---

# Predictions for unstructured model deployments {: #predictions-for-unstructured-model-deployments }

Using the endpoint below, you can provide the data necessary to calculate predictions for a specific unstructured model deployment. If you need to make predictions for a standard model, see [Predictions for deployments](dep-pred).

**Endpoint:** `/deployments/<deploymentId>/predictionsUnstructured`

Calculates predictions based on user-provided data for a specific unstructured model deployment. This endpoint works _only_ for deployed custom inference models with an unstructured target type. For more information, see [Assemble unstructured custom models](unstructured-custom-models).

This endpoint does the following: 

* Calls the `/predictUnstructured` route on the target custom inference model, allowing you to use the custom request and response schema, which may go beyond the standard DataRobot prediction API interface. 

* Passes any payload and content type (MIME type and charset, if provided) to the model.

* Passes any model-returned payload, along with the content type (MIME type and charset, if provided), back to the caller.

In the [DRUM library](custom-model-drum), this call is handled by the [`score_unstructured()` hook](unstructured-custom-models#score).

!!! note
    You can find the deployment ID in the sample code output of the [**Deployments > Predictions > Prediction API**](code-py) tab (with **Interface** set to **API Client**).

**Request Method:** `POST`

**Request URL:** deployed URL, for example: `https://your-company.orm.datarobot.com/predApi/v1.0`

## Request parameters {: #request-parameters }

### Headers {: #headers }

| Key | Description | Example(s) |
|-----|-------------|------------|
| Datarobot-key     | Required for managed AI Platform users; string type <br><br> Once a model is deployed, see the code snippet in the DataRobot UI, [Predictions > Prediction API](code-py). | `DR-key-12345abcdb-xyz6789` |
| Authorization     | Required; string <br><br> Three methods are supported: <ul><li>  Bearer authentication  </li><li> (deprecated) Basic authentication: User_email and API token  </li><li> (deprecated) API token | <ul><li>Example for Bearer authentication method: `Bearer API_key-12345abcdb-xyz6789`</li><li>(deprecated) Example for User_email and API token method: `Basic Auth_basic-12345abcdb-xyz6789`</li><li>(deprecated) Example for API token method: `Token API_key-12345abcdb-xyz6789`</li></ul> |
| Content-Type      | Optional; string type <br><br> Default: `application/octet-stream` <br><br> Any provided content type is passed to the model; however, the DRUM library has a built-in decoding mechanism for `text` content-types using the specified charset. <br><br> For more information, see [Assemble unstructured custom models](unstructured-custom-models). | <ul><li>`text/plain`</li><li>`text/csv`</li><li>`text/plain; charset=latin1`</li><li>`application/json; charset=UTF-8`</li><li>`custom/type`<li>`application/octet-stream`</li></ul> |
| Content-Encoding  | Optional; string type <br><br> Currently supports only gzip-encoding with the default data extension. | `gzip` |
| Accept            | Optional; string type | `*/*` (default) <br><br> The response is defined by the model output.
|

### Query arguments {: #query-arguments }

Currently not supported for the `predictionsUnstructured` endpoint.

### Body {: #body }

| Data | Type | Example(s) |
|------|------|------------|
| Data to pass to the custom model | Bytes | <ul><li>`PassengerId,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked 892,3,"Kelly, Mr. James",male,34.5,0,0,330911,7.8292,,Q 893,3,"Wilkes, Mrs. James (Ellen Needs)",female,47,1,0,363272,7,,S 894,2,"Myles, Mr. Thomas Francis",male,62,0,0,240276,9.6875,,Q`</li><li>`{“data”: [{“some”: “json”}]}`</li><li>`Custom payload 123`</li><li>`<binary data>` (for example, image data)</li></ul> |

## Response 200 {: #response-200 }

The HTTP Response contains a payload returned by the custom model’s `/predictUnstructured` route and passed back as-is. The `Content-Type` header is passed to the caller. If the `Content-Type` header isn't provided, the `application/octet-stream` default is applied.

In the case of a DataRobot-acknowledged error in a request, an `application/json` error message is returned.

In the [DRUM library](custom-model-drum), the response payload and content type are generated by the [`score_unstructured()` hook](unstructured-custom-models#score).

## Errors list {: #errors-list }

| HTTP Code | Sample error message | Reason(s) |
|-----------|----------------------|-----------|
| 400 BAD REQUEST           | `{"message":"Query parameters not accepted on this endpoint"}` | The request passed query parameters to the endpoint. |
| 404 NOT FOUND             | `{"message": "Deployment :deploymentId cannot be found for user :userId"}` | The request provided an invalid `:deploymentId` (a deleted or non-existant deployment). |
| 422 UNPROCESSABLE CONTENT | `{"message": "Only unstructured custom models can be used with this endpoint. Use /predictions instead.}` | The request provided a `:deploymentId` for a deployment that isn't an unstructured custom inference model deployment. |