BREAGEN Logo
Opportunity Management

Opportunity History Management

Opportunity History Management provides functionality to track and manage the historical changes and events related to opportunities within the system. This service enables CRUD (Create, Read, Delete) operations for opportunity history records.

Opportunity History Operations

Opportunity History Operations provide comprehensive management of historical data for opportunities, including creating, retrieving, and deleting history entries.

Opportunity History Operations - Create Opportunity History POST /v1/api/opportunities/history

Resource URL/v1/api/opportunities/history
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idID of the opportunity this history entry is associated withYesStringN/A
messageDescription of the historical event or changeYesStringN/A
meta_dataMetadata associated with the history entryYesStringN/A

Example Request

curl -X 'POST' \
'https://braegen.ai/v1/api/opportunities/history' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "opportunity_id": "12345",
    "message": "Status changed to Intake Complete",
    "meta_data": {"changed_by": "john.doe", "timestamp": "2025-04-05T10:00:00Z"}
}'

Example Response

{
  "is_error": false,
  "message": "opportunity history Create Success",
  "results": {
    "opportunity_id": "234345",
    "message": "string",
    "meta_data": {},
    "id": "23455",
    "created_at": "2025-04-07T06:49:51.688000"
  }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity History Operations - Get Opportunity History by Opportunity ID GET /v1/api/opportunities/history/opportunity_id/{opportunity_id}

Resource URL/v1/api/opportunities/history/opportunity_id/{opportunity_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescription
opportunity_idPath parameter: ID of the opportunity
page_noQuery parameter (optional): Page number. Default: 1
page_sizeQuery parameter (optional): Items per page. Default: 10, Max: 100

Example Request

curl -X 'GET' \
'https://braegen.ai/v1/api/opportunities/history/opportunity_id/12345?page_no=1&page_size=10' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Opportunity history retrieved successfully",
    "page_no": 1,
    "page_size": 10,
    "total_pages": 1,
    "total": 2,
    "results": [
        {
            "opportunity_history_id": "54321",
            "opportunity_id": "12345",
            "message": "Status changed to Intake Complete",
            "meta_data": {"changed_by": "john.doe", "timestamp": "2025-04-05T10:00:00Z"}
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity History Operations - Read Opportunity History GET /v1/api/opportunities/history/{opportunity_history_id}

Resource URL/v1/api/opportunities/history/{opportunity_history_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescription
opportunity_history_idPath parameter: ID of the opportunity history record to retrieve

Example Request

curl -X 'GET' \
'https://braegen.ai/v1/api/opportunities/history/54321' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Opportunity history retrieved successfully",
    "results": {
        "opportunity_history_id": "54321",
        "opportunity_id": "12345",
        "message": "Status changed to Intake Complete",
        "meta_data": {"changed_by": "john.doe", "timestamp": "2025-04-05T10:00:00Z"}
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity History Operations - Delete Opportunity History DELETE /v1/api/opportunities/history/{opportunity_history_id}

Resource URL/v1/api/opportunities/history/{opportunity_history_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescription
opportunity_history_idPath parameter: ID of the opportunity history record to delete

Example Request

curl -X 'DELETE' \
'https://braegen.ai/v1/api/opportunities/history/54321' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Opportunity history deleted successfully",
    "results": null
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error