This endpoint is in preview and may be modified or removed at any time.
To use this endpoint, add preview=true to the request query parameters.
Promotes an existing Model Version to the target Model. The promoted Model Version will be copied to the target Model as the latest version on the master branch, but will have a new Model Version RID.
Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:models-write.
objectstringThe Resource Identifier (RID) of a Model Version.
objectstringThe Resource Identifier (RID) of a Model Version.
objectThe Model API is a specification that describes the inputs and outputs of a machine learning model. It is used to define the interface for the model, including the types of data that can be passed to it and the types of data that it will return.
list<string>list<rid>stringThe time at which the resource was created.
unionThe source from which this model version was created.
stringThe Experiment linked to this Model Version, if one exists.
1
2
3
4
5
curl -X POST \
\t-H "Content-type: application/json" \
\t-H "Authorization: Bearer $TOKEN" \
"https://$HOSTNAME/api/v2/models/ri.models.main.model.f351c142-0e4c-4b12-adc2-6e1539737ae9/promoteVersion?preview=true" \
-d '{"sourceModelVersionRid":"ri.models.main.model-version.adf94926-c3ac-41ea-beb2-4946699d08ee"}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"backingRepositories": [
"ri.stemma.main.repository.a1b2c3d4-e5f6-7890-abcd-ef1234567890"
],
"condaRequirements": [
"numpy==1.24.0",
"pandas==2.0.0"
],
"linkedExperiment": "ri.models.main.experiment.abc123",
"modelApi": {
"inputs": [
{
"name": "input_df",
"required": true,
"type": "tabular",
"columns": [
{
"name": "feature_1",
"required": true,
"dataType": {
"type": "double"
}
},
{
"name": "feature_2",
"required": true,
"dataType": {
"type": "integer"
}
}
],
"format": "PANDAS"
}
],
"outputs": [
{
"name": "output_df",
"required": true,
"type": "tabular",
"columns": [
{
"name": "prediction",
"required": true,
"dataType": {
"type": "double"
}
}
],
"format": "SPARK"
}
]
},
"createdTime": "2003-05-06T12:34:56.789Z",
"rid": "ri.models.main.model-version.adf94926-c3ac-41ea-beb2-4946699d08ee"
}| Error Name | ||
|---|---|---|
Unsupported | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The Model Version has a source type that is not supported by the API. This can occur when the model was created through a legacy or internal workflow that is not exposed through the public API. | |
| Parameters | | |
Promote | Error Code | PERMISSION_DENIED |
| Status Code | 403 | |
| Description | Could not promoteVersion the Model. | |
| Parameters | modelRid | |
Model | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The given Model could not be found. | |
| Parameters | modelRid | |
Model | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The given ModelVersion could not be found. | |
| Parameters | modelRid, modelVersionRid | |
See Errors for a general overview of errors in the platform.