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