EmailGuard
  • Pricing
Log inRegister
DocumentationAPI ReferenceKnowledge Base

API reference

Download spec

API reference

Guides and endpoint docs

  • SDK clients
  • TypeScript SDK
  • Go SDK
  • Python SDK
  • PHP SDK
  • Ruby SDK
  • MCP client
  • getGet team
  • patchUpdate team
  • getList team members
  • deleteRemove a team member
  • patchUpdate a team member role
  • deleteCancel a pending invite
  • postInvite a team member
  • getList pending team invites
  • getGet billing usage
  • postCreate notification channel
  • deleteDelete notification channel
  • getList notification channels
  • postTest notification channel
  • putUpdate notification channel
  • getList notification events
  • postCreate notification rule
  • deleteDelete notification rule
  • getList notification rules
  • putUpdate notification rule
  • getDetect email characteristics

Go SDK

Generated Go client from the public OpenAPI spec — unwrap the response envelope in your app layer.

Loading article…

On this page

  • Install
  • Configure
  • Quickstart
  • Response envelope
  • Operations by resource
    • Billing
    • Channels
    • email
    • Events
    • Invites
    • Members
    • Rules
    • Teams
  • Authentication pattern
  • Errors and limits
  • Related
TypeScript SDKPython SDK

The Go module github.com/emailguard/emailguard-go is generated from openapi-public.yaml. Import it as emailguardsdk and call 20 team-scoped REST operations with typed request/response structs (version 1.0.0).

Install

go get github.com/emailguard/emailguard-go/[email protected]

Add the module to your go.mod and run go mod tidy after upgrading.

Configure

VariableRequiredDescription
EMAILGUARD_API_KEYYesTeam-scoped live key (egsk_live_...)

API_KEY is accepted as an alias in most clients.

Set the base URL via configuration if your deployment uses a custom API origin (https://api.emailguard.co by default in generated samples).

Quickstart

package main
 
import (
	"context"
	"fmt"
	"os"
 
	openapiclient "github.com/emailguard/emailguard-go/emailguardsdk"
)
 
func main() {
	ctx := context.Background()
	configuration := openapiclient.NewConfiguration()
	configuration.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("EMAILGUARD_API_KEY"))
	apiClient := openapiclient.NewAPIClient(configuration)
 
	result, _, err := apiClient.TeamsAPI.ApiV1TeamGet(ctx).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "request failed: %v\n", err)
		os.Exit(1)
	}
	fmt.Printf("%+v\n", result)
}

Generated methods return typed structs from the HTTP body. When the API responds with { "code", "data", "message" }, read the data field in your integration layer on success.

Response envelope

{
  "code": "SUCCESS",
  "data": { "..." : "..." },
  "message": "OK"
}

In practice, decode the JSON body and branch on code before using data in your handlers.

Operations by resource

Billing

  • Get billing usage

Channels

  • Create notification channel
  • Delete notification channel
  • List notification channels
  • Test notification channel
  • Update notification channel

email

  • Detect email characteristics

Events

  • List notification events

Invites

  • Cancel a pending invite
  • Invite a team member
  • List pending team invites

Members

  • List team members
  • Remove a team member
  • Update a team member role

Rules

  • Create notification rule
  • Delete notification rule
  • List notification rules
  • Update notification rule

Teams

  • Get team
  • Update team

Each API reference page includes a Go SDK tab with imports and call syntax for that route.

Authentication pattern

cfg := emailguardsdk.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("EMAILGUARD_API_KEY"))
client := emailguardsdk.NewAPIClient(cfg)
 
// client.TeamsAPI.ApiV1TeamGet(ctx).Execute()

Errors and limits

Generated methods return (result, *http.Response, error). Inspect Response.StatusCode for 401, 403, and 429. See API rate limiting for quota headers and backoff.

Related

  • SDK clients — overview and credentials
  • TypeScript SDK — envelope unwrapping in the npm client