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

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.