POST https://app.aporia.com/v1beta/models
{
"id": "my-model",
"name": "My Model",
"description": "My awesome model",
"color": "turquoise",
"icon": "fraud-detection",
"owner": "[email protected]",
"tags": {
"foo": "bar"
}
}
Request Parameters
Parameter
Type
Required
Description
id
str
False
A unique identifier for the new model, which will be used in all future operations. If this parameter is not passed, an id will be generated from the name parameter
name
str
True
A name for the new model, which will be displayed in Aporia's dashboard
description
str
False
A description of the model
color
ModelColor
False
A color to distinguish the model in Aporia's dashboard. Defaults to blue
icon
ModelIcon
False
An icon that indicates the model's designation. Defaults to general
owner
str
False
The email of the model owner (must be a registered aporia user)
tags
Dict[str, str]
False
A mapping of tag keys to tag values
ModelColor options:blue,arctic_blue, green, turquoise, pink, purple, yellow, red
Feature positions: When reporting a model schema, there is an optional argument called feature_positions. This argument provides mapping of feature names to feature positions in the dataframe which the model receives. Feature Positions are required for Explainability capabilities. In the console, to explain a data point, go to Model Overview -> Investigation Toolbox -> Data points and click Explain on a specific data point. For example:
Response
Value
Type
Description
id
UUID
The id of the new model version
Create Monitor
Creates a new monitor.
The documentation for each monitor contains an example of creating that monitor using the REST API.
Request Parameters
Parameter
Type
Required
Description
name
str
True
A name for the new monitor, which will be displayed in Aporia's dashboard
type
MonitorType
True
The type of monitor to create
scheduling
str
True
A cron expression that indicates how often the monitor will run
configuration
object
True
The monitor's configuration
is_active
bool
False
True if the new monitor should be created as active, False if it should be created as inactive
custom_alert_description
str
False
A custom description for the alerts generated by this monitor
Return "environments" list of objects with the following fields:
Value
Type
Description
id
UUID
The id of the environment
name
str
The name of the environment
Get Model Tags
Returns all of the tags that were defined for a model.
Path Parameters
Parameter
Description
model_id
The ID of the model whose tags you wish to fetch.
Response
Value
Type
Description
tags
Dict[str, str]
A mapping of tag keys to tag values
Delete Model Tag
Deletes a single model tag.
Path Parameters
Parameter
Description
model_id
The ID of the model whose tags you wish to fetch.
tag_key
The key of the tag to delete.
Create Model Tags
Creates or updates model tags.
Path Parameters
Parameter
Description
model_id
The ID of the model whose tags you wish to fetch.
Request Parameters
Parameter
Type
Required
Description
tags
Dict[str, str]
True
A mapping of tag keys to tag values
Notes
Each model is restricted to 10 tags
Tag keys are restricted to 15 characters, and may only contain letters, numbers, spaces, '-' and '_'.
Tag values are restricted to 100 characters, and may only contain letters, numbers and special characters
If a tag key already exists, you can use this enpoint to update its value
Update Model Owner
Update the owner of an existing model.
Path Parameters
Parameter
Description
model_id
The ID of the model for which you would like to update an owner.
Request Parameters
Parameter
Type
Required
Description
owner
str
True
The email of the model owner (must be a registered aporia user).
Response
Value
Type
Description
model_id
str
The ID of the model that was updated.
owner
str
The email of new model's owner.
Update Feature Positions
Update feature positions for an existing model version. Feature Positions are required for Explainability capabilities. In the console, to explain a datapoint, go to Model Overview -> Investigation Toolbox -> Datapoints and click Explain on a specific datapoint.
Path Parameters
Parameter
Description
model_id
The ID of the model for which you would like to update features' positions.
model_version
The version for which you would like to update an features' positions.
Request Parameters
Parameter
Type
Required
Description
feature_positions
dict
True
Mapping of feature names to feature positions in the dataframe which the model receives.
Notes
Features should be identical to the model schema.
Update Feature Importance
Update feature importance for an existing model version.
Path Parameters
Parameter
Description
model_id
The ID of the model for which you would like to update features' importance.
model_version
The version for which you would like to update an features' importance.
Request Parameters
Parameter
Type
Required
Description
feature_importance
dict
True
Mapping of feature names to feature importance.
Notes
Mapping of features from the scema and their importance is expected. Partial mappings are also supported.
When using the API call, all previous reported feature importance values will be overridden.