Convert one Lead
Converts a Lead into a Customer, Property, and Opportunity. When placeId matches one or more of the Customer's Properties, conversion reuses one the organization has active access to. If none of the matches are accessible, conversion returns 404 without granting access. When no Property matches for that Customer, conversion creates a new Property and gives the organization primary access to it. The Opportunity takes the Lead's Originator, returned as result.opportunity.originatorId. Requires Idempotency-Key. Required scope: leads:convert.
Converts a Lead into a Customer, Property, and Opportunity. When placeId matches one or more of the Customer's Properties, conversion reuses one the organization has active access to. If none of the matches are accessible, conversion returns 404 without granting access. When no Property matches for that Customer, conversion creates a new Property and gives the organization primary access to it. The Opportunity takes the Lead's Originator, returned as result.opportunity.originatorId. Requires Idempotency-Key. Required scope: leads:convert.
Convert one Lead. Use an organization API key with leads:convert. Check the response envelope and meta.requestId before triggering dependent workflow steps.
Required scopes
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| idrequired | path | string | Lead identifier returned by the Organization API. |
Request body
| Field | Type | Description |
|---|---|---|
| customerrequired | object | Optional unless marked required. |
| customer.firstNamerequired | string | Optional unless marked required. |
| customer.lastNamerequired | string | Optional unless marked required. |
| customer.emailrequired | string | Optional unless marked required. |
| customer.phone | string | null | Optional unless marked required. |
| customer.displayName | string | null | Optional unless marked required. |
| propertyrequired | object | Optional unless marked required. |
| property.addressrequired | string | Optional unless marked required. |
| property.cityrequired | string | Optional unless marked required. |
| property.staterequired | string | US state name or abbreviation; normalized by solarOS. |
| property.zipCoderequired | string | Optional unless marked required. |
| property.placeId | string | null | Optional unless marked required. |
| property.latitude | number | null | Optional unless marked required. |
| property.longitude | number | null | Optional unless marked required. |
| property.formattedAddress | string | null | Optional unless marked required. |
| property.country | string | Optional unless marked required. |
| opportunityrequired | object | Optional unless marked required. |
| opportunity.namerequired | string | Optional unless marked required. |
| opportunity.value | string | number | null | Optional unless marked required. |
| opportunity.expectedCloseDate | string | null | Optional unless marked required. |
| opportunity.ownerId | string | null | Active or draft same-organization Team Member id. When omitted, the API key default owner for this resource is used. Ownership cannot be changed through generic PATCH endpoints. |
| opportunity.notes | string | null | Optional unless marked required. |
| opportunity.salesTypeIds[] | array<string> | Optional unless marked required. |
{
"customer": {
"firstName": "Ada",
"lastName": "Lovelace",
"email": "ada@example.com"
},
"property": {
"address": "1 Market St",
"city": "San Francisco",
"state": "CA",
"zipCode": "94105"
},
"opportunity": {
"name": "Residential solar consultation",
"salesTypeIds": [
"sales_type_install"
]
}
}Responses
Lead conversion action envelope
#/components/schemas/OrgApiActionEnvelope
Validation or ownership error
#/components/schemas/OrgApiError
Missing or invalid organization API key
#/components/schemas/OrgApiError
Organization billing access or an endpoint-specific business quota denied the request
#/components/schemas/OrgApiError
Missing required scope: leads:convert
#/components/schemas/OrgApiError
Lead not found or no active access to the matching Property
#/components/schemas/OrgApiError
Lead already converted or idempotency conflict
#/components/schemas/OrgApiError
Rate limit exceeded
#/components/schemas/OrgApiError
Errors
Static examples
curl -X POST "$SOLAROS_BASE_URL/api/v1/leads/$SOLAROS_LEAD/convert" \
-H "Authorization: Bearer $SOLAROS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SOLAROS_IDEMPOTENCY_KEY" \
--data '{"customer":{"firstName":"Ada","lastName":"Lovelace","email":"ada@example.com"},"property":{"address":"1 Market St","city":"San Francisco","state":"CA","zipCode":"94105"},"opportunity":{"name":"Residential solar consultation","salesTypeIds":["sales_type_install"]}}'