Predict API (1.0.0)
Download OpenAPI specification:Download
API powering the Predict feature of Algolia.
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
- Payload
Content type
application/json
Example
{- "modelsToRetrieve": [
- "funnel_stage"
]
}
Response samples
- 200
- 400
- 404
- 405
Content type
application/json
{- "user": "string",
- "predictions": {
- "funnel_stage": {
- "value": [
- {
- "name": "string",
- "probability": 1
}
], - "lastUpdatedAt": "string"
}, - "order_value": {
- "value": 0,
- "lastUpdatedAt": "string"
}, - "affinities": {
- "value": [
- {
- "name": "string",
- "value": "string",
- "probability": 1
}
], - "lastUpdatedAt": "string"
}
}, - "properties": {
- "raw": { },
- "computed": { },
- "custom": { }
}, - "segments": {
- "computed": [
- "string"
], - "custom": [
- "string"
]
}
}
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
- 200
- 401
- 404
- 422
- 500
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
- Payload
Content type
application/json
Example
{- "modelsToRetrieve": [
- "funnel_stage"
]
}
Response samples
- 200
- 400
- 401
- 422
- 500
Content type
application/json
{- "users": [
- {
- "user": "string",
- "predictions": {
- "funnel_stage": {
- "value": [
- {
- "name": "string",
- "probability": 1
}
], - "lastUpdatedAt": "string"
}, - "order_value": {
- "value": 0,
- "lastUpdatedAt": "string"
}, - "affinities": {
- "value": [
- {
- "name": "string",
- "value": "string",
- "probability": 1
}
], - "lastUpdatedAt": "string"
}
}, - "properties": {
- "raw": { },
- "computed": { },
- "custom": { }
}, - "segments": {
- "computed": [
- "string"
], - "custom": [
- "string"
]
}
}
], - "previousPageToken": "string",
- "nextPageToken": "string"
}