BREAGEN Logo
Opportunity Management

Prediction Management

Prediction Management provides functionality to manage predictions related to opportunities within the system. This service enables operations such as creating predictions and recalculating scores based on opportunity data.

Prediction Operations

Prediction Operations provide tools to create and manage predictions for opportunities, including generating predictive outcomes and recalculating scores.

Prediction Operations - Create Prediction POST /v1/api/prediction/create/{client_id}

Resource URL/v1/api/prediction/create/{client_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescription
client_idPath parameter: ID of the client
Input JSONPrediction details JSON object (request body). See PredictionBase schema for details.

Example Request

curl -X 'POST' \
'https://braegen.ai/v1/api/prediction/create/98765' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "opportunity_id": "12345",
    "outcome": {"success_probability": 0.75},
    "duration": {"days": 30},
    "cost": {"amount": 5000},
    "quantum": {"value": 10000}
}'

Example Response

{
    "is_error": false,
    "message": "Prediction created successfully",
    "data": {
        "opportunity_id": "12345",
        "client_id": "98765",
        "outcome": {"success_probability": 0.75},
        "duration": {"days": 30},
        "cost": {"amount": 5000},
        "quantum": {"value": 10000}
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Prediction Operations - Recalculate Score PUT /v1/api/prediction/recalculate_score

Resource URL/v1/api/prediction/recalculate_score
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescription
opportunity_idQuery parameter (required): ID of the opportunity
client_idQuery parameter (required): ID of the client

Example Request

curl -X 'PUT' \
'https://braegen.ai/v1/api/prediction/recalculate_score?opportunity_id=12345&client_id=98765' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Score recalculated successfully",
    "data": {
        "opportunity_id": "12345",
        "client_id": "98765",
        "new_score": 92
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

On this page