---
docId: doc_b6c709e751df46bf856320f66e07ae21
title: Delete a custom field
description: >-
  Delete an existing custom field and remove its value from every contact in
  the workspace.
api:
  group: campos-personalizados
  auth: bearer
  operations:
    - operationId: deleteCustomField
      method: DELETE
      path: '/v1/custom-fields/{fieldId}'
      postmanName: Delete a custom field
---

<script>
  import { Note, Ways } from '$lib/components';
</script>

# Delete a custom field

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

<Note type="warning">

This operation removes the field's value across every contact in the workspace and cannot be reversed from the API.

</Note>

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X DELETE https://api.platic.ai/v1/custom-fields/$FIELD_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

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

</Ways.Way>
</Ways>

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

## URL parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|-----------|
| `fieldId` | string | Unique identifier of the custom field | ✓ |

## Response

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

## Response fields

| Field | Description |
|-------|-------------|
| `data.id` | Identifier of the deleted field |
| `data.deleted` | Always `true` |
| `data.clientsUpdated` | Number of contacts whose field value was removed |

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | Your 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 |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential does not have the Contacts module (`Missing contacts permission`), or it is an OAuth token without the `platica:write` scope |
| `404` | `CUSTOM_FIELD_NOT_FOUND` | The field does not exist in the workspace or was already deleted |

```json
{
  "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](/api-reference/errors).
