Delete an account
client.Account.Delete(ctx, id, body) (*AccountDeleteResponse, error)
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
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"),
)
accountDeleteResponse, err := client.Account.Delete(
context.TODO(),
"id",
githubcomlightfldlightfieldgo.AccountDeleteParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}