API ReferenceOpportunity
opportunity.create
Type: Mutation · Auth: Workspace-aware
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| customerId | string | Yes | — | ID of the associated customer |
| primaryContactId | string | No | — | ID of the associated primary contact |
| siteId | string | No | — | ID of the associated site |
| title | string | Yes | — | Title |
| stage | enum(lead, qualified, survey, proposal, negotiation, won, lost) | Yes | "lead" | Stage |
| pipelineType | enum(new_construction, retrofit, service_agreement, expansion, other) | Yes | — | Pipeline type |
| source | enum(referral, website, cold_call, existing_customer, partner, trade_show, portal_request, other) | No | — | Source |
| estimatedValue | number | No | — | Estimated value |
| expectedCloseDate | string.date-time | No | — | Expected close date |
| probability | integer | No | — | Probability |
| solutionFamilies | string[] | No | — | Solution families |
| scopeSummary | string | No | — | Scope summary |
| competitorNotes | string | No | — | Competitor notes |
| winLossReason | string | No | — | Win loss reason |
| nextStepDescription | string | No | — | Next step description |
| nextStepDate | string.date-time | No | — | Next step date |
| bidDueDate | string.date-time | No | — | Bid due date |
| budgetConfirmed | boolean | Yes | false | Budget confirmed |
| priority | enum(low, medium, high, urgent) | No | — | Priority |
| lostReasonCategory | enum(price, timing, competitor, scope_mismatch, no_decision, relationship, other) | No | — | Lost reason category |
| technicalRequirements | string | No | — | Technical requirements |
| ownerUserId | string | No | — | ID of the associated owner user |
| workspaceId | string | No | — | ID of the associated workspace |
| visibilityMode | enum(global, workspace_local, shared) | Yes | "workspace_local" | Visibility mode |
Example
{
"customerId": "550e8400-e29b-41d4-a716-446655440000",
"primaryContactId": "550e8400-e29b-41d4-a716-446655440000",
"siteId": "550e8400-e29b-41d4-a716-446655440000",
"title": "Example Title",
"stage": "lead",
"pipelineType": "new_construction",
"budgetConfirmed": false,
"visibilityMode": "global"
}