---
title: "Go SDK"
description: "The official Go client for the Nextmail API. One module with nothing outside the standard library, and one method for every endpoint."
url: "https://openemail.uk/docs/go"
area: "Go"
category: "Getting started"
---

# Go SDK

The official Go client for the Nextmail API. One module with nothing outside the standard library, and one method for every endpoint.

## What it is

One module over the whole API, from sending, templates and tracking to threads, contacts, domains, webhooks and disposable inboxes. It has a method for every method of the TypeScript SDK under the same name in Go casing, one error type with a sentinel for every kind of refusal, retries that cannot duplicate a send, and a webhook signature verifier. It needs Go 1.24 or later and nothing else.

**Install**

_go get_

```bash
go get github.com/bfzli/nextmail-go
```

**main.go**

```
package main

import (
	"context"
	"log"

	"github.com/bfzli/nextmail-go"
)

func main() {
	client := nextmail.New()

	_, err := client.Emails.Send(context.Background(), nextmail.Body{
		"from":    "Acme Billing <billing@acme.com>",
		"to":      "ada@example.com",
		"subject": "Your September invoice",
		"html":    "<p>Invoice attached.</p>",
	})
	if err != nil {
		log.Fatal(err)
	}
}
```

## Where to go

- [Install](https://openemail.uk/docs/go/install.md): Add the package and send your first message.
- [Configuration](https://openemail.uk/docs/go/configuration.md): Every option, and what the client refuses.
- [Send an email](https://openemail.uk/docs/go/emails/send.md): Attachments, scheduling and batches.
- [Errors and retries](https://openemail.uk/docs/go/errors.md): One error type, and what is tried again.
- [Pagination](https://openemail.uk/docs/go/pagination.md): One page, every page, or one item at a time.
- [Verify webhooks](https://openemail.uk/docs/go/webhooks/verify.md): Check a delivery before you trust it.
- [Every method](https://openemail.uk/docs/go/reference/methods.md): The complete list, one row each.

## It wraps the same API as every other client

Everything here is the surface the API reference documents and the TypeScript SDK wraps, so read the API reference for what an endpoint does and this for how to call it from Go. Every TypeScript method has a Go twin, and the parity check of the module runs both with the same arguments and fails unless they send the same request.

- [API reference](https://openemail.uk/docs/api/overview.md): What each endpoint does, and how it fails.
