Delete a custom object record
client.Object.Delete(ctx, id, params) (*ObjectDeleteResponse, error)
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
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
objectDeleteResponse, err := client.Object.Delete(
context.TODO(),
"id",
githubcomlightfldlightfieldgo.ObjectDeleteParams{
EntitySlug: "entitySlug",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}