Describes how to delete a custom field category, and what happens to contacts with that custom field.
Delete a custom_field
Deleting a custom_field is a multi-step process that is completed asynchronously. Here’s what happens when you delete a custom field:
- The custom_field resource is deleted.
- The custom_field subresource is then removed from all contacts to which it was applied.
The system responds with a 204 No Content.
Example DELETE Call
DELETE https://api.cc.email/v3/contact_custom_fields/{custom_field_id}
Endpoint Requirements
User privileges: contacts:write
Authorization scopes: contact_data
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
.url("https://api.cc.email/v3/contact_custom_fields/{custom_field_id}")
.delete(body)
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.build();
Response response = client.newCall(request).execute();
curl -X DELETE \
https://api.cc.email/v3/contact_custom_fields/{custom_field_id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/contact_custom_fields/{custom_field_id}');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders(array(
'Authorization' => 'Bearer {access_token}',
'Content-Type' => 'application/json',
'Accept' => 'application/json'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}