Delete a custom object record
client.object.delete(stringid, ObjectDeleteParams { entitySlug, body } params, RequestOptionsoptions?): ObjectDeleteResponse { id, createdAt, fields, 4 more }
DELETE/v1/objects/{entitySlug}/values/{id}
Moves a custom object record to the trash. The record is soft-deleted and may be restored from the Lightfield UI.
Calling delete on an already-trashed record is a no-op and returns the existing record.
Required scope: custom_objects:delete
Rate limit category: Write
Delete a custom object record
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const objectDeleteResponse = await client.object.delete('id', { entitySlug: 'entitySlug' });
console.log(objectDeleteResponse.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"
}