# README
Go API client for
The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as "active" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active.
This API provides operations to create and manage your templates as well as their versions.
Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts.
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.187016Z[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 |
---|---|---|---|
ActivateTemplateVersion | ActivateTemplateVersion | Post /v3/templates/{TemplateId}/versions/{VersionId}/activate | Activate a transactional template version. |
CreateTemplate | CreateTemplate | Post /v3/templates | Create a transactional template. |
CreateTemplateVersion | CreateTemplateVersion | Post /v3/templates/{TemplateId}/versions | Create a new transactional template version. |
DeleteTemplate | DeleteTemplate | Delete /v3/templates/{TemplateId} | Delete a template. |
DeleteTemplateVersion | DeleteTemplateVersion | Delete /v3/templates/{TemplateId}/versions/{VersionId} | Delete a transactional template version. |
DuplicateTemplate | DuplicateTemplate | Post /v3/templates/{TemplateId} | Duplicate a transactional template. |
GetTemplate | GetTemplate | Get /v3/templates/{TemplateId} | Retrieve a single transactional template. |
GetTemplateVersion | GetTemplateVersion | Get /v3/templates/{TemplateId}/versions/{VersionId} | Retrieve a specific transactional template version. |
ListTemplate | ListTemplate | Get /v3/templates | Retrieve paged transactional templates. |
UpdateTemplate | UpdateTemplate | Patch /v3/templates/{TemplateId} | Edit a transactional template. |
UpdateTemplateVersion | UpdateTemplateVersion | Patch /v3/templates/{TemplateId}/versions/{VersionId} | Edit a transactional template version. |
Documentation For Models
- Active
- Active1
- CreateTemplateRequest
- DuplicateTemplateRequest
- Editor
- Editor1
- Generation
- Generation1
- Generations
- ListTemplate200Response
- ListTemplate400Response
- ListTemplate400ResponseErrorsInner
- Metadata
- TransactionalTemplate
- TransactionalTemplateVersionCreate
- TransactionalTemplateVersionOutput
- TransactionalTemplateWarning
- TransactionalTemplatesTemplateLean
- TransactionalTemplatesVersionOutputLean
- UpdateTemplateRequest
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)