Skip to content

Delete a list

client.List.Delete(ctx, id, body) (*ListDeleteResponse, error)
DELETE/v1/lists/{id}

Moves a list to the trash. The list is soft-deleted and may be restored from the Lightfield UI. Member entities (accounts, contacts, or opportunities) are not affected.

Calling delete on an already-trashed list is a no-op and returns the existing record.

Required scope: lists:delete

Rate limit category: Write

ParametersExpand Collapse
id string

Unique identifier of the list to delete.

body ListDeleteParams
Body param.Field[ListDeleteParamsBody]Optional
ReturnsExpand Collapse
type ListDeleteResponse struct{…}
ID string

Unique identifier for the list.

CreatedAt string

ISO 8601 timestamp of when the list was created.

Fields map[string, ListDeleteResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $objectType).

Value ListDeleteResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type ListDeleteResponseFieldValueArray []string
type ListDeleteResponseFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type ListDeleteResponseFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const ListDeleteResponseFieldValueTypeAddress ListDeleteResponseFieldValueType = "ADDRESS"
const ListDeleteResponseFieldValueTypeCheckbox ListDeleteResponseFieldValueType = "CHECKBOX"
const ListDeleteResponseFieldValueTypeCurrency ListDeleteResponseFieldValueType = "CURRENCY"
const ListDeleteResponseFieldValueTypeDatetime ListDeleteResponseFieldValueType = "DATETIME"
const ListDeleteResponseFieldValueTypeEmail ListDeleteResponseFieldValueType = "EMAIL"
const ListDeleteResponseFieldValueTypeFullName ListDeleteResponseFieldValueType = "FULL_NAME"
const ListDeleteResponseFieldValueTypeMarkdown ListDeleteResponseFieldValueType = "MARKDOWN"
const ListDeleteResponseFieldValueTypeMultiSelect ListDeleteResponseFieldValueType = "MULTI_SELECT"
const ListDeleteResponseFieldValueTypeNumber ListDeleteResponseFieldValueType = "NUMBER"
const ListDeleteResponseFieldValueTypeSingleSelect ListDeleteResponseFieldValueType = "SINGLE_SELECT"
const ListDeleteResponseFieldValueTypeSocialHandle ListDeleteResponseFieldValueType = "SOCIAL_HANDLE"
const ListDeleteResponseFieldValueTypeTelephone ListDeleteResponseFieldValueType = "TELEPHONE"
const ListDeleteResponseFieldValueTypeText ListDeleteResponseFieldValueType = "TEXT"
const ListDeleteResponseFieldValueTypeURL ListDeleteResponseFieldValueType = "URL"
const ListDeleteResponseFieldValueTypeHTML ListDeleteResponseFieldValueType = "HTML"

Delete a list

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"),
  )
  listDeleteResponse, err := client.List.Delete(
    context.TODO(),
    "id",
    githubcomlightfldlightfieldgo.ListDeleteParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", listDeleteResponse.ID)
}
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink"
}
Returns Examples
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink"
}