ÃÛ¶¹ÊÓƵ

Models endpoint

NOTE
Data Science Workspace is no longer available for purchase.
This documentation is intended for existing customers with prior entitlements to Data Science Workspace.

A model is an instance of a machine learning recipe that is trained using historical data and configurations to solve for a business use case.

Retrieve a list of Models

You can retrieve a list of Model details belonging to all Models by performing a single GET request to /models. By default this list will order itself from oldest created model and limit the results to 25. You may choose to filter results by specifying some query parameters. For a list of available queries, refer to the appendix section on query parameters for asset retrieval.

API format

GET /models

Request

curl -X GET \
  https://platform.adobe.io/data/sensei/models/ \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}'

Response

A successful response returns a payload containing the details of your Models including each Models unique identifier (id).

{
    "children": [
        {
            "id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
            "name": "A name for this Model",
            "experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
            "experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
            "description": "A description for this Model",
            "modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
            "created": "2019-01-01T00:00:00.000Z",
            "createdBy": {
                "userId": "Jane_Doe@ÃÛ¶¹ÊÓƵID"
            },
            "updated": "2019-01-02T00:00:00.000Z"
       },
        {
            "id": "27c53796-bd6b-4u59-b51d-7296aa20er23",
            "name": "Model 2",
            "experimentId": "3cb25a2d-2cbd-4d34-a619-8ddae5259a5t",
            "experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
            "description": "A description for Model2",
            "modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
            "created": "2019-01-01T00:00:00.000Z",
            "createdBy": {
                "userId": "Jane_Doe@ÃÛ¶¹ÊÓƵID"
            },
            "updated": "2019-01-02T00:00:00.000Z"
       },
        {
            "id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
            "name": "Model 3",
            "experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
            "experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
            "description": "A description for Model3",
            "modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
            "created": "2019-01-01T00:00:00.000Z",
            "createdBy": {
                "userId": "Jane_Doe@ÃÛ¶¹ÊÓƵID"
            },
            "updated": "2019-01-02T00:00:00.000Z"
       },
    ],
    "_page": {
        "property": "deleted==false",
        "count": 3
    }
}
Property
Description
id
The ID corresponding to the Model.
modelArtifactUri
A URI indicating where the model is stored. The URI ends with the name value for the model.
experimentId
A valid Experiment ID.
experimentRunId
A valid Experiment Run ID.

Retrieve a specific Model

You can retrieve a list of Model details belonging to a particular Model by performing a single GET request and providing a valid Model ID in the request path. To help filter results, you can specify query parameters in the request path. For a list of available queries, refer to the appendix section on query parameters for asset retrieval.

API Format

GET /models/{MODEL_ID}
GET /models/?property=experimentRunID=={EXPERIMENT_RUN_ID}
Parameter
Description
{MODEL_ID}
The identifier of the trained or published Model.
{EXPERIMENT_RUN_ID}
The identifier of the experiment run.

Request

The following request contains a query and retrieves a list of trained Models sharing the same experimentRunID ({EXPERIMENT_RUN_ID}).

curl -X GET \
  https://platform.adobe.io/data/sensei/models/?property=experimentRunId==33408593-2871-4198-a812-6d1b7d939cda \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}'

Response

A successful response returns a payload containing the details of your Model including the Models unique identifier (id).

{
    "children": [
        {
            "id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
            "name": "A name for this Model",
            "experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
            "experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
            "description": "A description for this Model",
            "modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
            "created": "2019-01-01T00:00:00.000Z",
            "createdBy": {
                "userId": "Jane_Doe@ÃÛ¶¹ÊÓƵID"
            },
            "updated": "2019-01-02T00:00:00.000Z"
       }
    ],
    "_page": {
        "property": "experimentRunId==33408593-2871-4198-a812-6d1b7d939cda,deleted==false",
        "count": 1
    }
}
Property
Description
id
The ID corresponding to the Model.
modelArtifactUri
A URI indicating where the model is stored. The URI ends with the name value for the model.
experimentId
A valid Experiment ID.
experimentRunId
A valid Experiment Run ID.

Register a pre-generated Model register-a-model

You can register a pre-generated Model by making a POST request to the /models endpoint. In order to register your Model, the modelArtifact file and model property values need to be included in the body of the request.

API Format

POST /models

Request

The following POST contains the modelArtifact file and model property values that are needed. See the table below for more information on these values.

curl -X POST \
  https://platform.adobe.io/data/sensei/models \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}' \
    -F 'modelArtifact=@/Users/yourname/Desktop/model.onnx' \
    -F 'model={
            "name": "Your Model - 0615-1342-45",
            "originType": "offline"
    }'
Parameter
Description
modelArtifact
The location of the complete Model artifact you wish to include.
model
The form data of the Model object that needs to be created.

Response

A successful response returns a payload containing the details of your Model including the Models unique identifier (id).

{
  "id": "a28f151a-597a-4a7e-87e9-1c1dbc9c2af7",
  "name": "Your Model - 0615-1342-45",
  "originType": "offline",
  "modelArtifactUri": "http://storageblobml.blob.core.windows.net/prod-models/a28f151a-597a-4a7e-87e9-1c1dbc9c2af7",
  "created": "2020-06-15T20:55:41.520Z",
  "updated": "2020-06-15T20:55:41.520Z",
  "deprecated": false
}
Property
Description
id
The ID corresponding to the Model.
modelArtifactUri
A URI indicating where the model is stored. The URI ends with the id value for your model.

Update a Model by ID

You can update an existing Model by overwriting its properties through a PUT request that includes the target Model’s ID in the request path and providing a JSON payload containing updated properties.

TIP
In order to ensure the success of this PUT request, it is suggested that first you perform a GET request to retrieve the Model by ID. Then, modify and update the returned JSON object and apply the entirety of the modified JSON object as the payload for the PUT request.

API Format

PUT /models/{MODEL_ID}
Parameter
Description
{MODEL_ID}
The identifier of the trained or published Model.

Request

curl -X PUT \
  https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71 \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'Content-Type: application/vnd.adobe.platform.sensei+json;profile=mlInstance.v1.json' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}'
    -d '{
        "id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
        "name": "A name for this Model",
        "experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
        "experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
        "description": "An updated description for this Model",
        "modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
        "created": "2019-01-01T00:00:00.000Z",
        "createdBy": {
            "userId": "Jane_Doe@ÃÛ¶¹ÊÓƵID"
        },
        "updated": "2019-01-02T00:00:00.000Z"
    }'

Response

A successful response returns a payload containing the Experiment’s updated details.

{
        "id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
        "name": "A name for this Model",
        "experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
        "experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
        "description": "An updated description for this Model",
        "modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
        "created": "2019-01-01T00:00:00.000Z",
        "createdBy": {
            "userId": "Jane_Doe@ÃÛ¶¹ÊÓƵID"
        },
        "updated": "2019-01-02T00:00:00.000Z"
    }

Delete a Model by ID

You can delete a single Model by performing a DELETE request that includes the target Model’s ID in the request path.

API Format

DELETE /models/{MODEL_ID}
Parameter
Description
{MODEL_ID}
The identifier of the trained or published Model.

Request

curl -X DELETE \
  https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71 \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}'

Response

A successful response returns a payload containing a 200 status confirming the deletion of the Model.

{
    "title": "Success",
    "status": 200,
    "detail": "Model deletion was successful"
}

Create a new transcoding for a Model create-transcoded-model

Transcoding is the direct digital-to-digital conversion of one encoding to another. You create a new transcoding for a Model by providing the {MODEL_ID} and a targetFormat you want the new output to be in.

API Format

POST /models/{MODEL_ID}/transcodings
Parameter
Description
{MODEL_ID}
The identifier of the trained or published Model.

Request

curl -X POST \
  https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71/transcodings \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}' \
    -H 'Content-Type: text/plain' \
    -D '{
 "id": "491a3be5-1d32-4541-94d5-cd1cd07affb5",
 "modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
 "targetFormat": "CoreML",
 "created": "2019-12-16T19:59:08.360Z",
 "createdBy": {
    "userId": "FDD760CD5CD467380A495FE2@ÃÛ¶¹ÊÓƵID"
 },
 "updated": "2019-12-19T18:37:43.696Z",
 "deleted": false,
}'

Response

A successful response returns a payload containing a JSON object with the information of your transcoding. This includes the transcodings unique identifier (id) used in retrieving a specific transcoded Model.

{
  "id": "491a3be5-1d32-4541-94d5-cd1cd07affb5",
  "modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
  "targetFormat": "CoreML",
  "created": "2020-06-12T22:01:55.886Z",
  "createdBy": {
    "userId": "FDD760CD5CD467380A495FE2@ÃÛ¶¹ÊÓƵID"
  },
  "updated": "2020-06-12T22:01:55.886Z",
  "deleted": false
}

Retrieve a list of transcodings for a Model retrieve-transcoded-model-list

You can retrieve a list of transcodings that have been performed on a Model by performing a GET request with your {MODEL_ID}.

API Format

GET /models/{MODEL_ID}/transcodings
Parameter
Description
{MODEL_ID}
The identifier of the trained or published Model.

Request

curl -X GET \
  https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71/transcodings \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}'

Response

A successful response returns a payload containing a json object with a list of each transcoding performed on the Model. Each transcoded Model receives a unique identifier (id).

{
    "children": [
        {
            "id": "460aa5a1-e972-455d-b8dc-4bc6cd91edb6",
            "modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
            "created": "2019-12-20T01:07:50.978Z",
            "createdBy": {
                "userId": "FDD760CD5CD467380A495FE2@ÃÛ¶¹ÊÓƵID"
            },
            "updated": "2019-12-20T01:07:50.978Z",
            "deprecated": false
        },
        {
            "id": "bdb3e4c2-4702-4045-86b4-17ee40df91cc",
            "modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
            "created": "2019-12-20T17:48:26.473Z",
            "createdBy": {
                "userId": "FDD760CD5CD467380A495FE2@ÃÛ¶¹ÊÓƵID"
            },
            "updated": "2019-12-20T17:48:26.473Z",
            "deprecated": false
        }
    ],
    "_page": {
        "property": "modelId==15c53796-bd6b-4e09-b51d-7296aa20af71,deleted==false,deprecated==false",
        "count": 2
    }
}

Retrieve a specific transcoded Model retrieve-transcoded-model

You can retrieve a specific transcoded Model by performing a GET request with your {MODEL_ID} and the id of a transcoded model.

API Format

GET /models/{MODEL_ID}/transcodings/{TRANSCODING_ID}
Parameter
Description
{MODEL_ID}
The unique identifier of a trained or published Model.
{TRANSCODING_ID}
The unique identifier of a transcoded Model.

Request

curl -X GET \
  https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71/transcodings/460aa5a1-e972-455d-b8dc-4bc6cd91edb6 \
    -H 'Authorization: Bearer {ACCESS_TOKEN}' \
    -H 'x-api-key: {API_KEY}' \
    -H 'x-gw-ims-org-id: {ORG_ID}' \
    -H 'x-sandbox-name: {SANDBOX_NAME}'

Response

A successful response returns a payload containing a JSON object with the data of the transcoded Model.

{
    "id": "460aa5a1-e972-455d-b8dc-4bc6cd91edb6",
    "modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
    "created": "2019-12-20T01:07:50.978Z",
    "createdBy": {
        "userId": "FDD760CD5CD467380A495FE2@ÃÛ¶¹ÊÓƵID"
    },
    "updated": "2019-12-20T01:07:50.978Z",
    "deprecated": false
}
recommendation-more-help
cc79fe26-64da-411e-a6b9-5b650f53e4e9