Skip to main content

We use cookies to improve Engium and measure marketing. Choose what you're comfortable with.

Manage preferences

We use cookies to improve Engium and measure marketing. Choose what you're comfortable with.

Manage preferences
EngiumEngium Docs
GuidesAPI ReferenceChangelogSupport
person
rocket_launch

Engium Docs

v3.0.0-stable

Core Concepts

rocket_launchGetting Started
lockAuthentication

Messaging API

apiEndpoints
terminalLanguage Guides
webhookWebhooks
analyticsSystem StatushelpDocumentation Help
Guideschevron_rightLanguage Guideschevron_rightGo

Go Quickstart

Call the Engium REST API from Go using the standard net/http package — no third-party dependencies required.

info

Prerequisites

  • •Go 1.21+
  • •API key and Tenant ID from Settings → Developer
info

Zero dependencies

The example uses only Go standard library packages (net/http, encoding/json). No go get required — just set ENGIUM_API_KEY and ENGIUM_TENANT_ID environment variables and run.

Implementation

main.go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
	"time"
)

const base = "https://api.engium.app/api/v1"

type EngiumClient struct {
	apiKey string
	tenant string
	http   *http.Client
}

func NewClient() *EngiumClient {
	return &EngiumClient{
		apiKey: os.Getenv("ENGIUM_API_KEY"),
		tenant: os.Getenv("ENGIUM_TENANT_ID"),
		http:   &http.Client{Timeout: 30 * time.Second},
	}
}

func (c *EngiumClient) Post(path string, body any) (map[string]any, error) {
	b, _ := json.Marshal(body)
	req, _ := http.NewRequest("POST", base+"/"+path, bytes.NewBuffer(b))
	req.Header.Set("Authorization", "Bearer "+c.apiKey)
	req.Header.Set("X-Tenant-ID",   c.tenant)
	req.Header.Set("Content-Type",  "application/json")

	resp, err := c.http.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	data, _ := io.ReadAll(resp.Body)
	var result map[string]any
	json.Unmarshal(data, &result)
	return result, nil
}

func main() {
	client := NewClient()

	session, err := client.Post("conversations/send", map[string]any{
		"recipient": "+15550102999",
		"channel":   "whatsapp",
		"message":   map[string]string{"text": "Hello from Go! 🐹"},
	})
	if err != nil {
		panic(err)
	}
	fmt.Printf("Session ID : %v\n", session["id"])
	fmt.Printf("Status     : %v\n", session["status"])
}

Request Parameters

ParameterTypeRequirementDescription
AuthorizationHeader · stringRequiredBearer {api_key}. Generate from Settings → Developer → API Keys.
X-Tenant-IDHeader · UUIDRequiredYour Tenant UUID. All API data is scoped to this tenant.
AuthorizationRequired

Bearer {api_key}. Generate from Settings → Developer → API Keys.

Type:Header · string
X-Tenant-IDRequired

Your Tenant UUID. All API data is scoped to this tenant.

Type:Header · UUID

Was this helpful?

Previousarrow_backPHP
expand_more

On this page

editEdit on GitHubreportReport Issue
auto_awesomeAI Insight

Consider using Template IDs for better deliverability and localised content management across your 9 supported languages.

© 2026 Engium AI. All systems operational.

Privacy PolicyTerms of ServiceSecurityStatus