package
4.0.0-rc.10
Repository: https://github.com/sendgrid/sendgrid-go.git
Documentation: pkg.go.dev

# README

Go API client for

IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API.

There is no limit to the number of IP addresses that you can allow.

It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses.

See IP Access Management 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.283792Z[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
AddIpToAllowListAddIpToAllowListPost /v3/access_settings/whitelistAdd one or more IPs to the allow list
DeleteAllowedIpDeleteAllowedIpDelete /v3/access_settings/whitelist/{RuleId}Remove a specific IP from the allowed list
DeleteAllowedIpsDeleteAllowedIpsDelete /v3/access_settings/whitelistRemove one or more IPs from the allow list
GetAllowedIpGetAllowedIpGet /v3/access_settings/whitelist/{RuleId}Retrieve a specific allowed IP
ListAccessActivityListAccessActivityGet /v3/access_settings/activityRetrieve all recent access attempts
ListAllowedIpListAllowedIpGet /v3/access_settings/whitelistRetrieve a list of currently allowed IPs

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)