# 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
Class | Method | HTTP request | Description |
---|---|---|---|
CreateSubuser | CreateSubuser | Post /v3/subusers | Create Subuser |
DeleteSubuser | DeleteSubuser | Delete /v3/subusers/{SubuserName} | Delete a subuser |
GetSubuserCredit | GetSubuserCredit | Get /v3/subusers/{SubuserName}/credits | Get the Credits for a Subuser |
ListMonthlyStat | ListMonthlyStat | Get /v3/subusers/stats/monthly | Retrieve monthly stats for all subusers |
ListReputation | ListReputation | Get /v3/subusers/reputations | Retrieve Subuser Reputations |
ListStat | ListStat | Get /v3/subusers/stats | Retrieve email statistics for your subusers. |
ListStatSum | ListStatSum | Get /v3/subusers/stats/sums | Retrieve the totals for each email statistic metric for all subusers. |
ListSubuser | ListSubuser | Get /v3/subusers | List all Subusers |
ListSubuserMonthlyStat | ListSubuserMonthlyStat | Get /v3/subusers/{SubuserName}/stats/monthly | Retrieve the monthly email statistics for a single subuser |
UpdateSubuser | UpdateSubuser | Patch /v3/subusers/{SubuserName} | Enable/disable a subuser |
UpdateSubuserCredit | UpdateSubuserCredit | Put /v3/subusers/{SubuserName}/credits | Update the Credits for a Subuser |
UpdateSubuserIp | UpdateSubuserIp | Put /v3/subusers/{SubuserName}/ips | Update IPs assigned to a subuser |
UpdateSubuserRemainingCredit | UpdateSubuserRemainingCredit | Patch /v3/subusers/{SubuserName}/credits/remaining | Update the remaining credits for a Subuser |
UpdateSubuserWebsiteAccess | UpdateSubuserWebsiteAccess | Patch /v3/subusers/{SubuserName}/website_access | Enable/Disable website access for a Subuser |
Documentation For Models
- AggregatedBy
- CategoryStats
- CategoryStatsStatsInner
- CategoryStatsStatsInnerMetrics
- CreateSubuserRequest
- ErrorResponse
- ErrorResponseErrorsInner
- ListReputation200ResponseInner
- Region
- Region1
- Region2
- Region3
- ResetFrequency
- ResetFrequency1
- SortByDirection
- SortByDirection1
- SortByDirection2
- SortByMetric
- Subuser
- SubuserCredits
- SubuserCreditsRequest
- SubuserPost
- SubuserPostCreditAllocation
- SubuserStats
- SubuserStatsStatsInner
- SubuserStatsStatsInnerMetrics
- Type
- Type1
- UpdateSubuserIp200Response
- UpdateSubuserRemainingCreditRequest
- UpdateSubuserRequest
- UpdateSubuserWebsiteAccessRequest
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)