Custom Fields allow you to add extra information about your contacts to your contact database. With custom fields, you can create custom segments from your individual contacts or from your contact database that will dynamically update your content with the values for the individual contact receiving the email. Your custom fields are completely customizable to the use cases and user information that you need.
You can also manage your Custom Fields using the Custom Fields UI in the Marketing Campaigns App. For more about creating Custom Fields, including a list of Reserved Fields, see our Custom Fields documentation.
This endpoint deletes a defined Custom Field.
You can delete only Custom Fields; Reserved Fields cannot be deleted.
Bearer <<YOUR_API_KEY_HERE>>
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const custom_field_id = "ZGkrHSypTsudrGkmdpJJ";56const request = {7url: `/v3/marketing/field_definitions/${custom_field_id}`,8method: "DELETE",9};1011client12.request(request)13.then(([response, body]) => {14console.log(response.statusCode);15console.log(response.body);16})17.catch((error) => {18console.error(error);19});