get_model¶
- MachineLearningApi.get_model(model_id, role_id, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get registered ML model details
Returns the DynamoDB record for a registered SageMaker ML model. Requires resource access. Optional projectionExpression limits returned attributes.
- Parameters:
model_id (str) – ModelId of the registered ML model. (required)
role_id (str) – Role identifier used for authorization. Missing this header returns AUTH-1001. (required)
projection_expression (str) – Comma-separated attribute names to include. When omitted, the full item is returned (with Keywords defaulting to []).
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /models/{model_id}
Success (HTTP 200)¶
Model record for the caller, including AccessType.
Request / response example
{
"ModelId": "7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f",
"ModelName": "sales-blazingtext",
"Description": "Classifies product review sentiment",
"AlgorithmUsed": "BlazingText",
"OutputType": "metadata",
"InputSchema": "N/A",
"OutputSchema": "N/A",
"ArtifactsLocation": "s3://example-ml-temp/ml-models/7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f/sampleFile.gz",
"SupportedFileFormats": [
"csv",
"txt"
],
"PreProcessedGlueJobs": "custom_role_job",
"PostProcessedGlueJobs": "custom_role_job",
"Keywords": [
"nlp"
],
"IsSubscribedModel": "no",
"AccessType": "owner",
"CreatedBy": "jane.doe",
"CreationTime": "2026-08-19 07:26:01",
"LastModifiedBy": "jane.doe",
"LastModifiedTime": "2026-08-19 07:26:01"
}
Errors¶
Documented error codes: IPV-1038, GE-1008.
HTTP 400
Model not found, missing stored keys (IPV-1038), or the caller has no access on this model.
Unknown ModelId
{
"Message": "No model present with this model Id 7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f"
}
Caller has no resource permission
{
"Message": "User is not authorized to edit"
}
HTTP 500
Unexpected failure retrieving the model (GE-1008).
Request / response example
{
"Message": "GE-1008 - Could not complete the request. Please try again."
}