# README
Go API client for
The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the Contacts API.
You can also manage your lists using the Contacts menu in the Marketing Campaigns application user interface. For more information about lists and best practices for building them, see Building your Contact Lists.
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.234227Z[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 |
---|---|---|---|
CreateMarketingList | CreateMarketingList | Post /v3/marketing/lists | Create List |
DeleteContact | DeleteContact | Delete /v3/marketing/lists/{Id}/contacts | Remove Contacts from a List |
DeleteMarketingList | DeleteMarketingList | Delete /v3/marketing/lists/{Id} | Delete a list |
GetMarketingList | GetMarketingList | Get /v3/marketing/lists/{Id} | Get a List by ID |
ListContactCount | ListContactCount | Get /v3/marketing/lists/{Id}/contacts/count | Get List Contact Count |
ListMarketingList | ListMarketingList | Get /v3/marketing/lists | Get All Lists |
UpdateMarketingList | UpdateMarketingList | Patch /v3/marketing/lists/{Id} | Update List |
Documentation For Models
- ContactDetails
- CreateMarketingList400Response
- CreateMarketingListRequest
- DeleteContact202Response
- DeleteMarketingList200Response
- DeleteMarketingList404Response
- Error
- GetMarketingList200Response
- List
- ListContactCount200Response
- ListMarketingList200Response
- Metadata
- SelfMetadata
- UpdateMarketingListRequest
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)