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 Subusers API allows you to create and manage your Subuser accounts. Subusers are available on Pro and Premier plans, and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers.

You can also manage Subusers in the Twilio SendGrid application user interface. See Subusers for more information.

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.520439Z[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
CreateSubuserCreateSubuserPost /v3/subusersCreate Subuser
DeleteSubuserDeleteSubuserDelete /v3/subusers/{SubuserName}Delete a subuser
GetSubuserCreditGetSubuserCreditGet /v3/subusers/{SubuserName}/creditsGet the Credits for a Subuser
ListMonthlyStatListMonthlyStatGet /v3/subusers/stats/monthlyRetrieve monthly stats for all subusers
ListReputationListReputationGet /v3/subusers/reputationsRetrieve Subuser Reputations
ListStatListStatGet /v3/subusers/statsRetrieve email statistics for your subusers.
ListStatSumListStatSumGet /v3/subusers/stats/sumsRetrieve the totals for each email statistic metric for all subusers.
ListSubuserListSubuserGet /v3/subusersList all Subusers
ListSubuserMonthlyStatListSubuserMonthlyStatGet /v3/subusers/{SubuserName}/stats/monthlyRetrieve the monthly email statistics for a single subuser
UpdateSubuserUpdateSubuserPatch /v3/subusers/{SubuserName}Enable/disable a subuser
UpdateSubuserCreditUpdateSubuserCreditPut /v3/subusers/{SubuserName}/creditsUpdate the Credits for a Subuser
UpdateSubuserIpUpdateSubuserIpPut /v3/subusers/{SubuserName}/ipsUpdate IPs assigned to a subuser
UpdateSubuserRemainingCreditUpdateSubuserRemainingCreditPatch /v3/subusers/{SubuserName}/credits/remainingUpdate the remaining credits for a Subuser
UpdateSubuserWebsiteAccessUpdateSubuserWebsiteAccessPatch /v3/subusers/{SubuserName}/website_accessEnable/Disable website access for a Subuser

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)