Create an opportunity
Creates a new opportunity record. The $name and $stage fields and the $account relationship are required.
After creation, Lightfield automatically generates an opportunity summary in the background. The $opportunityStatus field is read-only and cannot be set via the API. The $task and $note relationships are also read-only — manage them via the $opportunity relationship on the task, or the $account/$opportunity note relationships instead.
Supports idempotency via the Idempotency-Key header.
To avoid duplicates, we recommend a find-or-create pattern — use list filtering to check if a record exists before creating.
Required scope: opportunities:create
Rate limit category: Write
Parameters
Field values for the new opportunity. System fields use a $ prefix (e.g. $name, $stage); custom attributes use their bare slug. Required: $name (string) and $stage (option ID or label). Fields of type SINGLE_SELECT or MULTI_SELECT accept either an option ID or label from the field’s typeConfiguration.options — call the definitions endpoint to discover available fields and options. See Fields and relationships for value type details.
Relationships to set on the new opportunity. System relationships use a $ prefix (e.g. $account, $owner); custom relationships use their bare slug. $account is required. Each value is a single entity ID or an array of IDs. Call the definitions endpoint to list available relationship keys.
Create an opportunity
lightfield opportunity create \
--api-key 'My API Key' \
--fields '{$name: $name, $stage: $stage}' \
--relationships '{$account: string}'{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}