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 retrieves all defined Custom Fields and Reserved Fields.
Bearer <<YOUR_API_KEY_HERE>>
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const request = {5url: `/v3/marketing/field_definitions`,6method: "GET",7};89client10.request(request)11.then(([response, body]) => {12console.log(response.statusCode);13console.log(response.body);14})15.catch((error) => {16console.error(error);17});