Skip to content

On-premise users: click in-app to access the full platform documentation for your version of DataRobot.

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.

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.

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, this call is handled by the score_unstructured() hook.


You can find the deployment ID in the sample code output of the Deployments > Predictions > Prediction API tab (with Interface set to API Client).

Request Method: POST

Request URL: deployed URL, for example:

Request parameters


Key Description Example(s)
Datarobot-key Required for managed AI Platform users; string type

Once a model is deployed, see the code snippet in the DataRobot UI, Predictions > Prediction API.
Authorization Required; string

Three methods are supported:
  • Bearer authentication
  • (deprecated) Basic authentication: User_email and API token
  • (deprecated) API token
  • Example for Bearer authentication method: Bearer API_key-12345abcdb-xyz6789
  • (deprecated) Example for User_email and API token method: Basic Auth_basic-12345abcdb-xyz6789
  • (deprecated) Example for API token method: Token API_key-12345abcdb-xyz6789
Content-Type Optional; string type

Default: application/octet-stream

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.

For more information, see Assemble unstructured custom models.
  • text/plain
  • text/csv
  • text/plain; charset=latin1
  • application/json; charset=UTF-8
  • custom/type
  • application/octet-stream
Content-Encoding Optional; string type

Currently supports only gzip-encoding with the default data extension.
Accept Optional; string type */* (default)

The response is defined by the model output.

Query arguments

Currently not supported for the predictionsUnstructured endpoint.


Data Type Example(s)
Data to pass to the custom model Bytes
  • 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
  • {“data”: [{“some”: “json”}]}
  • Custom payload 123
  • <binary data> (for example, image data)

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, the response payload and content type are generated by the score_unstructured() hook.

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-existent 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.

Updated November 21, 2023