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);345const request = {6url: `/v3/marketing/field_definitions`,7method: 'GET',89}1011client.request(request)12.then(([response, body]) => {13console.log(response.statusCode);14console.log(response.body);15})16.catch(error => {17console.error(error);18});