# The official Go library for Calisero is available

- Language: English
- URL: https://calisero.ro/en/developers/knowledge-base/biblioteca-go-disponibila
- Romanian version: https://calisero.ro/developer/knowledge-base/biblioteca-go-disponibila
- Published: 2026-10-24; last updated: 2026-10-24
- Summary: The official Go library for Calisero SMS: no dependencies, context.Context, typed errors, OTP verifications, opt-outs and a net/http webhook handler.

The official Go library for Calisero is published and ready for production. It covers the whole API — messages, OTP verifications, opt-outs and account details — for backend services, workers and command-line tools.

## What it includes

**No dependencies.** Built on the standard library's `net/http` only: nothing else to download or audit.

**Context on every call.** Every method takes a `context.Context`, to set a timeout or cancel the request. A client is safe for concurrent use from several goroutines.

**Typed.** Typed requests, responses and errors, with message statuses as constants rather than hand-written strings.

**OTP in two calls.** Start a verification, then validate the code the user typed. Calisero generates, sends and checks the code, so your application never stores it.

**Delivery webhooks.** `DeliveryWebhookHandler` is a ready `http.Handler`: it reads and validates every delivery report and hands it to your code as a typed object. An optional secret token in the callback address turns away requests that do not carry it.

**Clear errors.** Every kind of failure has its own error type, found with `errors.As`, carrying the API's message and the request's trace ID — the one you [debug any request](https://calisero.ro/en/developers/knowledge-base/depanare-cu-trace-id) with.

**Romania time handled.** Pass a `time.Time` to schedule a message and the library converts it to the time zone the API expects.

**URL shortening.** Turn on link shortening for a message and track the clicks on its links.

## Getting started

Add the module to your project:

```bash
go get github.com/calisero/calisero-go
```

Then send your first message with your API key:

```go
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	calisero "github.com/calisero/calisero-go"
)

func main() {
	client, err := calisero.NewClient(os.Getenv("CALISERO_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	response, err := client.Messages.Create(context.Background(), &calisero.CreateMessageRequest{
		Recipient: "+40742123456",
		Body:      "Your order has shipped and arrives tomorrow.",
	})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(response.Data.ID, response.Data.Status)
}
```

With a [sandbox API key](https://calisero.ro/en/developers/knowledge-base/manual-sandbox) you try every call without sending or paying for real messages.

The library needs Go 1.22 or later and is tested on Go 1.22–1.27, on Linux, macOS and Windows. The source code is public on [GitHub](https://github.com/calisero/calisero-go), with runnable examples for every operation, and the reference documentation is on [pkg.go.dev](https://pkg.go.dev/github.com/calisero/calisero-go).

Keep your API key on the server: the library is meant for server-side code, never for a client application.

## All the official libraries

With Go and [Python](https://calisero.ro/en/developers/knowledge-base/biblioteca-python-disponibila), the [integrations page](https://calisero.ro/en/developers/integrations) now lists six official libraries: PHP, Laravel, Symfony, Node.js, Go and Python.
