Delete a custom field

SDK platic.customFields.delete()

Remove a field you no longer need by sending its fieldId. Its values are also removed from all workspace contacts.

Example

await platic.customFields.delete("plan");

If your credential covers several workspaces, add ?workspace=<id> to say which one you work in (list workspaces); without it the answer is 400. A single-workspace credential never needs it.

URL parameters

ParameterTypeDescriptionRequired
fieldIdstringUnique identifier of the custom field✓

Response

{
  "status": "success",
  "message": "Custom field deleted successfully",
  "data": {
    "id": "membership_level",
    "deleted": true,
    "clientsUpdated": 142
  }
}

Response fields

FieldDescription
data.idIdentifier of the deleted field
data.deletedAlways true
data.clientsUpdatedNumber of contacts whose field value was removed

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTYour credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the ones you can use
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe credential does not have the Contacts module (Missing contacts permission), or it is an OAuth token without the platica:write scope
404CUSTOM_FIELD_NOT_FOUNDThe field does not exist in the workspace or was already deleted
{
  "code": 404,
  "error": "Not Found - The resource doesn't exist",
  "details": {
    "code": "CUSTOM_FIELD_NOT_FOUND",
    "message": "Custom field membership_level not found in this workspace"
  }
}

The general error format is in Errors.