BREAGEN Logo
Opportunity Management

Opportunity Management

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

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_creation_typeQuery parameter: Type of opportunity creation (e.g., default, manual, past)NoString"default"
opportunity_nameName of the opportunityYesStringN/A
typeType of the opportunityYesStringN/A
assigneeUser assigned to the opportunityYesStringN/A
diligence_statusDiligence status of the opportunityYesStringN/A
scoreScore assigned to the opportunityYesIntegerN/A
synopsisBrief description of the opportunityYesStringN/A
summaryDetailed summary of the opportunityYesStringN/A
due_dateDue date and time for the opportunityYesString (date-time)N/A
initiated_byUser who initiated the opportunityYesStringN/A
triggerTrigger event or reason for the opportunityYesStringN/A

Example Request

curl -X 'POST' \
'https://braegen.ai/v1/api/opportunities?opportunity_creation_type=default' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "opportunity_name": "New Business Deal",
    "type": "Business",
    "assignee": "john.doe",
    "diligence_status": "Pending",
    "score": 85,
    "synopsis": "A potential business expansion opportunity",
    "summary": "Detailed summary of the deal",
    "due_date": "2025-05-01T12:00:00Z",
    "initiated_by": "jane.smith",
    "trigger": "Market analysis"
}'

Example Response

{
    "is_error": false,
    "message": "Opportunity created successfully",
    "results": {
        "opportunity_id": "12345",
        "opportunity_name": "New Business Deal",
        "type": "Business",
        "assignee": "john.doe"
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - List Minimal Opportunities GET /v1/api/minimal/opportunities

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
page_noPage number for paginationNoInteger (min: 1)1
page_sizeNumber of items per pageNoInteger (min: 1)10
sort_fieldField to sort by (e.g., created_at, status, assignee)NoString or Null"created_at"
sort_orderSort order (ascending or descending)NoString or Null"desc"
statusFilter by opportunity status (array of strings)NoArray[String] or NullNull
assigneeFilter by assigneeNoString or NullNull
created_fromFilter by creation date from (date-time)NoString (date-time) or NullNull
created_toFilter by creation date to (date-time)NoString (date-time) or NullNull

Example Request

curl -X 'GET' \
'https://braegen.ai/v1/api/minimal/opportunities?page_no=1&page_size=10&sort_field=created_at&sort_order=desc' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Minimal opportunities retrieved successfully",
    "page_no": 1,
    "page_size": 10,
    "total_pages": 5,
    "total": 50,
    "results": [
        {
            "opportunity_id": "12345",
            "created_at": "2025-04-01T10:00:00Z",
            "status": "New",
            "assignee": "john.doe"
        },
        {
            "opportunity_id": "12346",
            "created_at": "2025-04-02T14:00:00Z",
            "status": "Intake Request",
            "assignee": "jane.smith"
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - List Detailed Opportunities GET /v1/api/detailed/opportunities

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
page_noPage number for paginationNoInteger (min: 1)1
page_sizeNumber of items per pageNoInteger (min: 1)10
sort_fieldField to sort by (e.g., opportunity_name, created_at, status, score)NoString or Null"created_at"
sort_orderSort order (ascending or descending)NoString or Null"desc"
opportunity_nameFilter by opportunity nameNoString or NullNull
statusFilter by opportunity status (array of strings)NoArray[String] or NullNull
assigneeFilter by assigneeNoString or NullNull
created_fromFilter by creation date from (date-time)NoString (date-time) or NullNull
created_toFilter by creation date to (date-time)NoString (date-time) or NullNull
scoreFilter by minimum scoreNoNumber or NullNull
typeFilter by opportunity typeNoString or NullNull
diligence_statusFilter by diligence statusNoString or NullNull
synopsisFilter by synopsisNoString or NullNull
summaryFilter by summaryNoString or NullNull
due_dateFilter by due date (date)NoString (date) or NullNull
display_idFilter by display IDNoString or NullNull

Example Request

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

Example Response

{
    "is_error": false,
    "message": "Detailed opportunities retrieved successfully",
    "page_no": 1,
    "page_size": 10,
    "total_pages": 3,
    "total": 25,
    "results": [
        {
            "opportunity_id": "12345",
            "opportunity_name": "New Business Deal",
            "type": "Business",
            "assignee": "john.doe",
            "diligence_status": "Pending",
            "score": 85,
            "synopsis": "A potential business expansion opportunity",
            "summary": "Detailed summary of the deal",
            "status": "New",
            "due_date": "2025-05-01T12:00:00Z",
            "created_at": "2025-04-01T10:00:00Z"
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Get Minimal Opportunity GET /v1/api/opportunities/minimal/{opportunity_id}

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idUnique ID of the opportunity to fetchYesStringN/A

Example Request

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

Example Response

{
    "is_error": false,
    "message": "Minimal opportunity retrieved successfully",
    "result": {
        "opportunity_id": "12345",
        "opportunity_name": "Quick Summary Deal",
        "status": "Open"
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Get Detailed Opportunity GET /v1/api/opportunities/detailed/{opportunity_id}

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idUnique ID of the opportunity to fetchYesStringN/A

Example Request

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

Example Response

{
    "is_error": false,
    "message": "Detailed opportunity retrieved successfully",
    "result": {
        "opportunity_id": "12345",
        "opportunity_name": "Enterprise Deal",
        "type": "Strategic",
        "assignee": "jane.doe",
        "diligence_status": "In Review",
        "score": 92,
        "synopsis": "Large-scale enterprise opportunity",
        "summary": "Comprehensive deal analysis and summary",
        "status": "In Progress",
        "due_date": "2025-05-15T12:00:00Z",
        "created_at": "2025-04-02T14:30:00Z"
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Update Opportunity PATCH /v1/api/opportunities/{opportunity_id}

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idUnique ID of the opportunity to updateYesStringN/A

Request Body

FieldDescriptionRequiredType
opportunity_nameName of the opportunityNoString
statusStatus of the opportunityNoString
typeType of the opportunityNoString
diligence_statusDiligence statusNoString
scoreScore (0–100)NoNumber
synopsisShort description of the opportunityNoString
summaryDetailed summaryNoString
assigneeAssigned personNoString
due_dateDue date (ISO 8601 date-time format)NoString (date-time)

Note: Exact request body fields depend on the OpportunityUpdateModel schema definition.

Example Request

curl -X 'PATCH' \
'https://braegen.ai/v1/api/opportunities/12345' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
  "opportunity_name": "Updated Business Deal",
  "status": "In Progress",
  "score": 90
}'

Example Response

{
    "is_error": false,
    "message": "Opportunity updated successfully",
    "result": {
        "opportunity_id": "12345",
        "opportunity_name": "Updated Business Deal",
        "status": "In Progress",
        "score": 90
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Update Opportunity Status POST /v1/api/opportunities/update_status/{opportunity_id}

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idUnique ID of the opportunity to update statusYesStringN/A

Request Body

FieldDescriptionRequiredType
statusNew status of the opportunityYesString

Note: The fields are based on the StatusUpdateModel schema.

Example Request

curl -X 'POST' \
'https://braegen.ai/v1/api/opportunities/update_status/12345' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
  "status": "Closed"
}'

Example Response

{
    "is_error": false,
    "message": "Opportunity status updated successfully",
    "result": {
        "opportunity_id": "12345",
        "status": "Closed"
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Update Opportunity Status with Attachments POST /v1/api/opportunities/update_status_with_attachments/{opportunity_id}

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

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idUnique ID of the opportunity to update status with attachmentsYesStringN/A

Request Body (multipart/form-data)

FieldDescriptionRequiredType
statusNew status of the opportunityYesString
commentComment regarding the status updateNoString
attachmentsFiles to attach (e.g., PDFs, images, docs)NoArray of files

Note: The fields come from the schema Body_update_opportunity_status_v1_api_opportunities_update_status_with_attachments__opportunity_id__post.

Example Request

curl -X 'POST' \
'https://braegen.ai/v1/api/opportunities/update_status_with_attachments/12345' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'status=Approved' \
-F 'comment=Supporting documents attached' \
-F 'attachments=@/path/to/document.pdf'

Example Response

{
    "is_error": false,
    "message": "Opportunity status and attachments updated successfully",
    "result": {
        "opportunity_id": "12345",
        "status": "Approved"
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Send Email To Claimants GET /v1/api/opportunities/status/{status}/{username}/{session_id}

Resource URL/v1/api/opportunities/status/{status}/{username}/{session_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Description

This endpoint performs a sequence of operations:

  • Checks if opportunities are in the specified status (typically "New").
  • Finds related claimants.
  • Retrieves all associated entity data.
  • Generates access links with tokens for each claimant.
  • Sends emails to all claimants.
  • If successful, updates the opportunity status to "Reach-out Request".

Parameters

ParameterDescriptionRequiredTypeDefault Value
statusStatus to filter opportunities byYesStringN/A
usernameUsername performing the actionYesStringN/A
session_idSession ID for tracking or loggingYesStringN/A

Example Request

curl -X 'GET' \
'https://braegen.ai/v1/api/opportunities/status/New/john.doe/abc123-session' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Emails sent successfully and status updated to Reach-out Request",
    "result": {
        "emails_sent": 5,
        "status_updated": true
    }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Get Status List GET /v1/api/next_status/{opportunity_id}

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

Description

Retrieves the list of possible next statuses that can be applied to a given opportunity based on its current state.

Parameters

ParameterDescriptionRequiredTypeDefault Value
opportunity_idID of the opportunityYesStringN/A

Example Request

curl -X 'GET' \
'https://braegen.ai/v1/api/next_status/12345' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Next statuses retrieved successfully",
    "result": [
        "Reach-out Request",
        "Claim Evaluation",
        "Final Review"
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Get Diligence Status List GET /v1/api/get_diligence_status_list

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

Description

Fetches the list of all available diligence statuses that can be used for filtering or assigning to opportunities.

Parameters

This endpoint does not require any parameters.

Example Request

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

Example Response

{
    "is_error": false,
    "message": "Diligence status list retrieved successfully",
    "result": [
        "Pending",
        "In Progress",
        "Completed",
        "Rejected"
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - All Statuses GET /v1/api/all_statuses

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

Description

Retrieves a comprehensive list of all statuses available for opportunities.

Parameters

This endpoint does not require any parameters.

Example Request

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

Example Response

{
    "is_error": false,
    "message": "All statuses retrieved successfully",
    "result": [
        "New",
        "In Progress",
        "Completed",
        "Closed",
        "Rejected",
        "Reach-out Request"
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

Opportunity Operations - Get Status List By Process Id GET /v1/api/get_status_list_by_process_id/{process_id}

Resource URL/v1/api/get_status_list_by_process_id/{process_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Description

Retrieves the list of available statuses based on the provided process_id. This allows filtering or associating statuses specific to the process.

Parameters

ParameterDescriptionRequiredTypeDefault Value
process_idID of the processYesStringN/A

Example Request

curl -X 'GET' \
'https://braegen.ai/v1/api/get_status_list_by_process_id/abc123' \
-H 'accept: application/json'

Example Response

{
    "is_error": false,
    "message": "Status list for process retrieved successfully",
    "result": [
        "New",
        "In Progress",
        "Completed",
        "Pending Review"
    ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
422Validation Error

On this page

Opportunity Operations - Create Opportunity POST /v1/api/opportunitiesParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - List Minimal Opportunities GET /v1/api/minimal/opportunitiesParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - List Detailed Opportunities GET /v1/api/detailed/opportunitiesParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Get Minimal Opportunity GET /v1/api/opportunities/minimal/{opportunity_id}ParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Get Detailed Opportunity GET /v1/api/opportunities/detailed/{opportunity_id}ParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Update Opportunity PATCH /v1/api/opportunities/{opportunity_id}ParametersRequest BodyExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Update Opportunity Status POST /v1/api/opportunities/update_status/{opportunity_id}ParametersRequest BodyExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Update Opportunity Status with Attachments POST /v1/api/opportunities/update_status_with_attachments/{opportunity_id}ParametersRequest Body (multipart/form-data)Example RequestExample ResponseHTTP ResponsesOpportunity Operations - Send Email To Claimants GET /v1/api/opportunities/status/{status}/{username}/{session_id}DescriptionParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Get Status List GET /v1/api/next_status/{opportunity_id}DescriptionParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Get Diligence Status List GET /v1/api/get_diligence_status_listDescriptionParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - All Statuses GET /v1/api/all_statusesDescriptionParametersExample RequestExample ResponseHTTP ResponsesOpportunity Operations - Get Status List By Process Id GET /v1/api/get_status_list_by_process_id/{process_id}DescriptionParametersExample RequestExample ResponseHTTP Responses