Get All Categories
Twilio calls a one-time, non-automated email message delivered to a list or segment of your audience a Single Send. You can send such messages immediately or scheduled for future delivery. Single Sends can deliver promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. The Single Sends API lets you create, retrieve, update, delete, schedule, and search for Single Sends. Another API endpoint provides campaign statistics. The SendGrid Knowledge Center explains the latest updates to the Single Sends API.
GET/v3/marketing/singlesends/categories
Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)
This endpoint allows you to retrieve all the categories associated with your Single Sends.
This endpoint will return your latest 1,000 categories.
Bearer <<YOUR_API_KEY_HERE>>Optional
list of latest one thousand unique categories associated with all Single Sends in ascending order
10001const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const request = {5url: `/v3/marketing/singlesends/categories`,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});