Skip to contentSkip to navigationSkip to topbar
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 (The Twilio SendGrid v3 API)

This endpoint retrieves all defined Custom Fields and Reserved Fields.


Authentication

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

reserved_fieldsarray[object]

_metadataobject
Get All Field DefinitionsLink to code sample: Get All Field Definitions
1
const client = require('@sendgrid/client');
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
5
const request = {
6
url: `/v3/marketing/field_definitions`,
7
method: 'GET',
8
9
}
10
11
client.request(request)
12
.then(([response, body]) => {
13
console.log(response.statusCode);
14
console.log(response.body);
15
})
16
.catch(error => {
17
console.error(error);
18
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.