Delete an opportunity
client.opportunity.delete(stringid, OpportunityDeleteParams { body } params?, RequestOptionsoptions?): OpportunityDeleteResponse { id, createdAt, fields, 4 more }
DELETE/v1/opportunities/{id}
Moves an opportunity to the trash. The opportunity is soft-deleted and may be restored from the Lightfield UI. Associated tasks, notes, and meetings are not deleted.
Calling delete on an already-trashed opportunity is a no-op and returns the existing record.
Required scope: opportunities:delete
Rate limit category: Write
Delete an opportunity
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const opportunityDeleteResponse = await client.opportunity.delete('id');
console.log(opportunityDeleteResponse.id);{
"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"
}