Go SDK
go get github.com/Glytos/glytos-sdk-goRequires Go 1.21 or newer. Zero dependencies - the standard library only.
Setup
import glytos "github.com/Glytos/glytos-sdk-go"
client := glytos.New("gly_...")To act in a specific environment, pass an option - dev, staging, prod, or an
environment uuid. It defaults to Development.
client := glytos.New("gly_...", glytos.WithEnvironment("prod"))Resources
Every call takes a context.Context, and typed params structs for creates:
ctx := context.Background()
agents, err := client.Workflows.List(ctx, nil)
agent, err := client.Workflows.Create(ctx, glytos.WorkflowCreateParams{
Name: "Receptionist",
Mode: "prompt",
})
// Mint a web-call token for the browser (never ship the API key there).
token, err := client.Calls.WebToken(ctx, glytos.WebTokenParams{WorkflowUUID: agent.UUID})The client covers Workflows, Calls, PhoneNumbers, Campaigns, Sessions,
Webhooks, Chat, Tools, KnowledgeBase, VectorStores and Analytics.
Anything not wrapped
Reach any endpoint directly, with auth and error handling applied:
var out map[string]any
err := client.Do(ctx, "GET", "/providers", nil, nil, &out)Verifying webhooks
ok := glytos.VerifyWebhook(rawBody, signatureHeader, secret, glytos.DefaultWebhookTolerance)rawBody must be the untouched request body - parsing and re-serialising it changes the
bytes and the signature will not match. It is also on the client as
client.Webhooks.Verify(...). See Webhooks.