Skip to content

Opportunity

Opportunities represent potential deals or sales in Lightfield. Each opportunity belongs to an account and can have tasks and notes associated with it.

Get opportunity field definitions
client.Opportunity.Definitions(ctx) (*OpportunityDefinitionsResponse, error)
GET/v1/opportunities/definitions
Create an opportunity
client.Opportunity.New(ctx, body) (*OpportunityCreateResponse, error)
POST/v1/opportunities
Update an opportunity
client.Opportunity.Update(ctx, id, body) (*OpportunityUpdateResponse, error)
POST/v1/opportunities/{id}
Retrieve an opportunity
client.Opportunity.Get(ctx, id) (*OpportunityRetrieveResponse, error)
GET/v1/opportunities/{id}
List opportunities
client.Opportunity.List(ctx, query) (*OpportunityListResponse, error)
GET/v1/opportunities
ModelsExpand Collapse
type OpportunityCreateResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, OpportunityCreateResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value OpportunityCreateResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type OpportunityCreateResponseFieldValueArray []string
type OpportunityCreateResponseFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type OpportunityCreateResponseFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const OpportunityCreateResponseFieldValueTypeAddress OpportunityCreateResponseFieldValueType = "ADDRESS"
const OpportunityCreateResponseFieldValueTypeCheckbox OpportunityCreateResponseFieldValueType = "CHECKBOX"
const OpportunityCreateResponseFieldValueTypeCurrency OpportunityCreateResponseFieldValueType = "CURRENCY"
const OpportunityCreateResponseFieldValueTypeDatetime OpportunityCreateResponseFieldValueType = "DATETIME"
const OpportunityCreateResponseFieldValueTypeEmail OpportunityCreateResponseFieldValueType = "EMAIL"
const OpportunityCreateResponseFieldValueTypeFullName OpportunityCreateResponseFieldValueType = "FULL_NAME"
const OpportunityCreateResponseFieldValueTypeMarkdown OpportunityCreateResponseFieldValueType = "MARKDOWN"
const OpportunityCreateResponseFieldValueTypeMultiSelect OpportunityCreateResponseFieldValueType = "MULTI_SELECT"
const OpportunityCreateResponseFieldValueTypeNumber OpportunityCreateResponseFieldValueType = "NUMBER"
const OpportunityCreateResponseFieldValueTypeSingleSelect OpportunityCreateResponseFieldValueType = "SINGLE_SELECT"
const OpportunityCreateResponseFieldValueTypeSocialHandle OpportunityCreateResponseFieldValueType = "SOCIAL_HANDLE"
const OpportunityCreateResponseFieldValueTypeTelephone OpportunityCreateResponseFieldValueType = "TELEPHONE"
const OpportunityCreateResponseFieldValueTypeText OpportunityCreateResponseFieldValueType = "TEXT"
const OpportunityCreateResponseFieldValueTypeURL OpportunityCreateResponseFieldValueType = "URL"
Relationships map[string, OpportunityCreateResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

type OpportunityDefinitionsResponse struct{…}
FieldDefinitions map[string, OpportunityDefinitionsResponseFieldDefinition]

Map of field keys to their definitions, including both system and custom fields.

Description string

Description of the field, or null.

Label string

Human-readable display name of the field.

TypeConfiguration OpportunityDefinitionsResponseFieldDefinitionTypeConfiguration

Type-specific configuration (e.g. select options, currency code).

Currency stringOptional

ISO 4217 3-letter currency code.

HandleService stringOptional

Social platform associated with this handle field.

One of the following:
const OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"
const OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"
const OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"
const OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"
MultipleValues boolOptional

Whether this field accepts multiple values.

Options []OpportunityDefinitionsResponseFieldDefinitionTypeConfigurationOptionOptional

Available options for select fields.

ID string

Unique identifier of the select option.

Label string

Human-readable display name of the option.

Description stringOptional

Description of the option, or null.

Unique boolOptional

Whether values for this field must be unique.

ValueType string

Data type of the field.

One of the following:
const OpportunityDefinitionsResponseFieldDefinitionValueTypeAddress OpportunityDefinitionsResponseFieldDefinitionValueType = "ADDRESS"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeCheckbox OpportunityDefinitionsResponseFieldDefinitionValueType = "CHECKBOX"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeCurrency OpportunityDefinitionsResponseFieldDefinitionValueType = "CURRENCY"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeDatetime OpportunityDefinitionsResponseFieldDefinitionValueType = "DATETIME"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeEmail OpportunityDefinitionsResponseFieldDefinitionValueType = "EMAIL"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeFullName OpportunityDefinitionsResponseFieldDefinitionValueType = "FULL_NAME"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeMarkdown OpportunityDefinitionsResponseFieldDefinitionValueType = "MARKDOWN"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeMultiSelect OpportunityDefinitionsResponseFieldDefinitionValueType = "MULTI_SELECT"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeNumber OpportunityDefinitionsResponseFieldDefinitionValueType = "NUMBER"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeSingleSelect OpportunityDefinitionsResponseFieldDefinitionValueType = "SINGLE_SELECT"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeSocialHandle OpportunityDefinitionsResponseFieldDefinitionValueType = "SOCIAL_HANDLE"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeTelephone OpportunityDefinitionsResponseFieldDefinitionValueType = "TELEPHONE"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeText OpportunityDefinitionsResponseFieldDefinitionValueType = "TEXT"
const OpportunityDefinitionsResponseFieldDefinitionValueTypeURL OpportunityDefinitionsResponseFieldDefinitionValueType = "URL"
ID stringOptional

Unique identifier of the field definition.

ReadOnly boolOptional

true for fields that are not writable via the API (e.g. AI-generated summaries). false or absent for writable fields.

ObjectType string

The object type these definitions belong to (e.g. account).

RelationshipDefinitions map[string, OpportunityDefinitionsResponseRelationshipDefinition]

Map of relationship keys to their definitions.

Cardinality string

Whether this is a has_one or has_many relationship.

One of the following:
const OpportunityDefinitionsResponseRelationshipDefinitionCardinalityHasOne OpportunityDefinitionsResponseRelationshipDefinitionCardinality = "HAS_ONE"
const OpportunityDefinitionsResponseRelationshipDefinitionCardinalityHasMany OpportunityDefinitionsResponseRelationshipDefinitionCardinality = "HAS_MANY"
Description string

Description of the relationship, or null.

Label string

Human-readable display name of the relationship.

ObjectType string

The type of the related object (e.g. account, contact).

ID stringOptional

Unique identifier of the relationship definition.

type OpportunityListResponse struct{…}
Data []OpportunityListResponseData

Array of entity objects for the current page.

ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, OpportunityListResponseDataField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value OpportunityListResponseDataFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type OpportunityListResponseDataFieldValueArray []string
type OpportunityListResponseDataFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type OpportunityListResponseDataFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const OpportunityListResponseDataFieldValueTypeAddress OpportunityListResponseDataFieldValueType = "ADDRESS"
const OpportunityListResponseDataFieldValueTypeCheckbox OpportunityListResponseDataFieldValueType = "CHECKBOX"
const OpportunityListResponseDataFieldValueTypeCurrency OpportunityListResponseDataFieldValueType = "CURRENCY"
const OpportunityListResponseDataFieldValueTypeDatetime OpportunityListResponseDataFieldValueType = "DATETIME"
const OpportunityListResponseDataFieldValueTypeEmail OpportunityListResponseDataFieldValueType = "EMAIL"
const OpportunityListResponseDataFieldValueTypeFullName OpportunityListResponseDataFieldValueType = "FULL_NAME"
const OpportunityListResponseDataFieldValueTypeMarkdown OpportunityListResponseDataFieldValueType = "MARKDOWN"
const OpportunityListResponseDataFieldValueTypeMultiSelect OpportunityListResponseDataFieldValueType = "MULTI_SELECT"
const OpportunityListResponseDataFieldValueTypeNumber OpportunityListResponseDataFieldValueType = "NUMBER"
const OpportunityListResponseDataFieldValueTypeSingleSelect OpportunityListResponseDataFieldValueType = "SINGLE_SELECT"
const OpportunityListResponseDataFieldValueTypeSocialHandle OpportunityListResponseDataFieldValueType = "SOCIAL_HANDLE"
const OpportunityListResponseDataFieldValueTypeTelephone OpportunityListResponseDataFieldValueType = "TELEPHONE"
const OpportunityListResponseDataFieldValueTypeText OpportunityListResponseDataFieldValueType = "TEXT"
const OpportunityListResponseDataFieldValueTypeURL OpportunityListResponseDataFieldValueType = "URL"
Relationships map[string, OpportunityListResponseDataRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

Object string

The object type, always "list".

TotalCount int64

Total number of entities matching the query.

minimum0
maximum9007199254740991
type OpportunityRetrieveResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, OpportunityRetrieveResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value OpportunityRetrieveResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type OpportunityRetrieveResponseFieldValueArray []string
type OpportunityRetrieveResponseFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type OpportunityRetrieveResponseFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const OpportunityRetrieveResponseFieldValueTypeAddress OpportunityRetrieveResponseFieldValueType = "ADDRESS"
const OpportunityRetrieveResponseFieldValueTypeCheckbox OpportunityRetrieveResponseFieldValueType = "CHECKBOX"
const OpportunityRetrieveResponseFieldValueTypeCurrency OpportunityRetrieveResponseFieldValueType = "CURRENCY"
const OpportunityRetrieveResponseFieldValueTypeDatetime OpportunityRetrieveResponseFieldValueType = "DATETIME"
const OpportunityRetrieveResponseFieldValueTypeEmail OpportunityRetrieveResponseFieldValueType = "EMAIL"
const OpportunityRetrieveResponseFieldValueTypeFullName OpportunityRetrieveResponseFieldValueType = "FULL_NAME"
const OpportunityRetrieveResponseFieldValueTypeMarkdown OpportunityRetrieveResponseFieldValueType = "MARKDOWN"
const OpportunityRetrieveResponseFieldValueTypeMultiSelect OpportunityRetrieveResponseFieldValueType = "MULTI_SELECT"
const OpportunityRetrieveResponseFieldValueTypeNumber OpportunityRetrieveResponseFieldValueType = "NUMBER"
const OpportunityRetrieveResponseFieldValueTypeSingleSelect OpportunityRetrieveResponseFieldValueType = "SINGLE_SELECT"
const OpportunityRetrieveResponseFieldValueTypeSocialHandle OpportunityRetrieveResponseFieldValueType = "SOCIAL_HANDLE"
const OpportunityRetrieveResponseFieldValueTypeTelephone OpportunityRetrieveResponseFieldValueType = "TELEPHONE"
const OpportunityRetrieveResponseFieldValueTypeText OpportunityRetrieveResponseFieldValueType = "TEXT"
const OpportunityRetrieveResponseFieldValueTypeURL OpportunityRetrieveResponseFieldValueType = "URL"
Relationships map[string, OpportunityRetrieveResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

type OpportunityUpdateResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, OpportunityUpdateResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value OpportunityUpdateResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type OpportunityUpdateResponseFieldValueArray []string
type OpportunityUpdateResponseFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type OpportunityUpdateResponseFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const OpportunityUpdateResponseFieldValueTypeAddress OpportunityUpdateResponseFieldValueType = "ADDRESS"
const OpportunityUpdateResponseFieldValueTypeCheckbox OpportunityUpdateResponseFieldValueType = "CHECKBOX"
const OpportunityUpdateResponseFieldValueTypeCurrency OpportunityUpdateResponseFieldValueType = "CURRENCY"
const OpportunityUpdateResponseFieldValueTypeDatetime OpportunityUpdateResponseFieldValueType = "DATETIME"
const OpportunityUpdateResponseFieldValueTypeEmail OpportunityUpdateResponseFieldValueType = "EMAIL"
const OpportunityUpdateResponseFieldValueTypeFullName OpportunityUpdateResponseFieldValueType = "FULL_NAME"
const OpportunityUpdateResponseFieldValueTypeMarkdown OpportunityUpdateResponseFieldValueType = "MARKDOWN"
const OpportunityUpdateResponseFieldValueTypeMultiSelect OpportunityUpdateResponseFieldValueType = "MULTI_SELECT"
const OpportunityUpdateResponseFieldValueTypeNumber OpportunityUpdateResponseFieldValueType = "NUMBER"
const OpportunityUpdateResponseFieldValueTypeSingleSelect OpportunityUpdateResponseFieldValueType = "SINGLE_SELECT"
const OpportunityUpdateResponseFieldValueTypeSocialHandle OpportunityUpdateResponseFieldValueType = "SOCIAL_HANDLE"
const OpportunityUpdateResponseFieldValueTypeTelephone OpportunityUpdateResponseFieldValueType = "TELEPHONE"
const OpportunityUpdateResponseFieldValueTypeText OpportunityUpdateResponseFieldValueType = "TEXT"
const OpportunityUpdateResponseFieldValueTypeURL OpportunityUpdateResponseFieldValueType = "URL"
Relationships map[string, OpportunityUpdateResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.