# README
Go API client for
The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services.
To create your initial SendGrid API Key, you should use the SendGrid application user interface. Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
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.482588Z[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 |
---|---|---|---|
CreateApiKey | CreateApiKey | Post /v3/api_keys | Create API keys |
DeleteApiKey | DeleteApiKey | Delete /v3/api_keys/{ApiKeyId} | Delete API keys |
GetApiKey | GetApiKey | Get /v3/api_keys/{ApiKeyId} | Retrieve an existing API Key |
ListApiKey | ListApiKey | Get /v3/api_keys | Retrieve all API Keys belonging to the authenticated user |
UpdateApiKey | UpdateApiKey | Put /v3/api_keys/{ApiKeyId} | Update API key name and scopes |
UpdateApiKeyName | UpdateApiKeyName | Patch /v3/api_keys/{ApiKeyId} | Update API key name |
Documentation For Models
- ApiKeyResponse
- ApiKeyScopesResponse
- CreateApiKey201Response
- CreateApiKeyRequest
- ErrorResponse
- ErrorResponseErrorsInner
- GetApiKey200Response
- ListApiKey200Response
- UpdateApiKeyNameRequest
- UpdateApiKeyRequest
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)