The generated API clients are a work in progress, you can also find our stable clients on the Algolia documentation.

Skip to main content

Predict API (1.0.0)

Download OpenAPI specification:Download

API powering the Predict feature of Algolia.

Profiles

Manage users' profiles.

Get user profile

Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile.

Authorizations:
(appIdapiKey)
path Parameters
userID
required
string

User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors).

Request Body schema: application/json
One of
modelsToRetrieve
Array of strings (modelsToRetrieve)
Items Enum: "funnel_stage" "order_value" "affinities"

Responses

Request samples

Content type
application/json
Example
{
  • "modelsToRetrieve": [
    ]
}

Response samples

Content type
application/json
{
  • "user": "string",
  • "predictions": {
    },
  • "properties": {
    },
  • "segments": {
    }
}

Delete user profile

Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID).

Authorizations:
(appIdapiKey)
path Parameters
userID
required
string

User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors).

Responses

Response samples

Content type
application/json
{
  • "user": "string",
  • "deletedUntil": "string"
}

Get all user profiles

Get all users with predictions in the provided application.

Authorizations:
(appIdapiKey)
Request Body schema: application/json
One of
modelsToRetrieve
Array of strings (modelsToRetrieve)
Items Enum: "funnel_stage" "order_value" "affinities"

Responses

Request samples

Content type
application/json
Example
{
  • "modelsToRetrieve": [
    ]
}

Response samples

Content type
application/json
{
  • "users": [
    ],
  • "previousPageToken": "string",
  • "nextPageToken": "string"
}

Models

Manage models.

Get a list of available model types

Get a list of all available model types. Each model type can be activated more than once, by selecting a different data source.

Authorizations:
(appIdapiKey)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a model’s instance configuration

Get the configuration for a model that was activated.

Authorizations:
(appIdapiKey)
path Parameters
modelID
required
string

The ID of the model to retrieve.

Responses

Response samples

Content type
application/json
{
  • "modelID": "string",
  • "name": "string",
  • "type": "string",
  • "sourceID": "string",
  • "index": "string",
  • "affinities": [
    ],
  • "contentAttributes": [
    ],
  • "lastTrained": "string",
  • "lastInference": "string",
  • "error": "string",
  • "status": "pending"
}

Update a model instance

Update a model’s configuration.

Authorizations:
(appIdapiKey)
path Parameters
modelID
required
string

The ID of the model to retrieve.

Request Body schema: application/json
name
string (name)

The model’s instance name.

affinities
Array of strings (affinities)
contentAttributes
Array of strings (contentAttributes)
status
string (status)
Enum: "active" "inactive"

active - model is running and generating predictions. The active value is allowed only if the current status of the model is inactive.
inactive - model training and inference have been paused. The inactive value is allowed only if the current status of the model is active.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "affinities": [
    ],
  • "contentAttributes": [
    ],
  • "status": "active"
}

Response samples

Content type
application/json
{
  • "modelID": "string",
  • "updatedAt": "string"
}

Delete a model instance

Delete the model’s configuration, pipelines and generated predictions.

Authorizations:
(appIdapiKey)
path Parameters
modelID
required
string

The ID of the model to retrieve.

Responses

Response samples

Content type
application/json
{
  • "modelID": "string",
  • "deletedUntil": "string"
}

Get model instances

Get a list of all model instances.

Authorizations:
(appIdapiKey)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Activate a model instance

Activate an existing model template. This action triggers the training and inference pipelines for the selected model. The model is added with status=pending. If a model with the exact same source & index already exists, the API endpoint returns an error.

Authorizations:
(appIdapiKey)
Request Body schema: application/json
type
required
string (modelsToRetrieve)
Enum: "funnel_stage" "order_value" "affinities"
name
required
string (name)

The model’s instance name.

sourceID
required
string (sourceID)

The data source ID, as returned by the (external) sources API.

index
required
string (index)

The index name.

affinities
Array of strings (affinities)
contentAttributes
Array of strings (contentAttributes)

Responses

Request samples

Content type
application/json
{
  • "type": "funnel_stage",
  • "name": "string",
  • "sourceID": "string",
  • "index": "string",
  • "affinities": [
    ],
  • "contentAttributes": [
    ]
}

Response samples

Content type
application/json
{
  • "modelID": "string",
  • "updatedAt": "string"
}

Get a model’s instance metrics

Get the model instance’ training metrics.

Authorizations:
(appIdapiKey)
path Parameters
modelID
required
string

The ID of the model to retrieve.

Responses

Response samples

Content type
application/json
[
  • {
    }
]