package
4.0.0-rc.10
Repository: https://github.com/sendgrid/sendgrid-go.git
Documentation: pkg.go.dev

# README

Go API client for

The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over SendGrid’s Web API or SMTP relay. These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more.

For a full list of Twilio SendGrid's Mail Settings, and what each one does, see Mail Settings.

You can also manage your Mail Settings in the Twilio SendGrid application user interface.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/sendgrid-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version:
  • Build date: 2025-08-18T08:58:25.192839Z[Etc/UTC]
  • Build package: com.sendgrid.oai.go.SendgridGoGenerator For more information, please visit https://support.sendgrid.com/hc/en-us

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./"

Documentation for API Endpoints

All URIs are relative to https://api.sendgrid.com

ClassMethodHTTP requestDescription
ListAddressWhitelistListAddressWhitelistGet /v3/mail_settings/address_whitelistRetrieve address whitelist mail settings
ListBouncePurgeListBouncePurgeGet /v3/mail_settings/bounce_purgeRetrieve Bounce Purge Mail Settings
ListFooterListFooterGet /v3/mail_settings/footerRetrieve footer mail settings
ListForwardBounceListForwardBounceGet /v3/mail_settings/forward_bounceRetrieve forward bounce mail settings
ListForwardSpamListForwardSpamGet /v3/mail_settings/forward_spamRetrieve forward spam mail settings
ListMailSettingListMailSettingGet /v3/mail_settingsRetrieve all mail settings
ListTemplateListTemplateGet /v3/mail_settings/templateRetrieve legacy template mail settings
UpdateAddressWhitelistUpdateAddressWhitelistPatch /v3/mail_settings/address_whitelistUpdate address whitelist mail settings
UpdateBouncePurgeUpdateBouncePurgePatch /v3/mail_settings/bounce_purgeUpdate Bounce Purge Mail Settings
UpdateFooterUpdateFooterPatch /v3/mail_settings/footerUpdate footer mail settings
UpdateForwardBounceUpdateForwardBouncePatch /v3/mail_settings/forward_bounceUpdate forward bounce mail settings
UpdateForwardSpamUpdateForwardSpamPatch /v3/mail_settings/forward_spamUpdate forward spam mail settings
UpdateTemplateUpdateTemplatePatch /v3/mail_settings/templateUpdate template mail settings

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)