# README
Go API client for
This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the Segmentation v2 API.
To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our Segmentation v1 to v2 upgrade instructions to manually migrate your segments to the v2 API.
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.488074Z[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 |
---|---|---|---|
DeleteSegment | DeleteSegment | Delete /v3/marketing/segments/{SegmentId} | Delete Segment |
GetSegment | GetSegment | Get /v3/marketing/segments/{SegmentId} | Get Segment by ID |
ListSegment | ListSegment | Get /v3/marketing/segments | Get List of Segments |
Documentation For Models
- ContactResponse
- ContactResponseCustomFields
- ErrorResponse
- ErrorResponseErrorsInner
- FullSegment
- GetSegment404Response
- GetSegment404ResponseErrorsInner
- ListSegment200Response
- ListSegment500Response
- ListSegment500ResponseErrorsInner
- SegmentSummary
- SegmentWriteV2
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)