Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Get All Field Definitions



API Overview

api-overview page anchor

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(link takes you to an external page). For more about creating Custom Fields, including a list of Reserved Fields, see our Custom Fields documentation.


GET/v3/marketing/field_definitions

Base url: https://api.sendgrid.com

This endpoint retrieves all defined Custom Fields and Reserved Fields.


Authentication

authentication page anchor
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
200
SchemaExample
custom_fieldsarray[object]

reserved_fieldsarray[object]

_metadataobject

Get All Field Definitions

get-all-field-definitions page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_18
const client = require('@sendgrid/client');
_18
client.setApiKey(process.env.SENDGRID_API_KEY);
_18
_18
_18
const request = {
_18
url: `/v3/marketing/field_definitions`,
_18
method: 'GET',
_18
_18
}
_18
_18
client.request(request)
_18
.then(([response, body]) => {
_18
console.log(response.statusCode);
_18
console.log(response.body);
_18
})
_18
.catch(error => {
_18
console.error(error);
_18
});


Rate this page: