Install
openclaw skills install @psyb0t/go-zulipUnofficial Go client for the Zulip REST API, generated with oapi-codegen. Package zulip (github.com/psyb0t/go-zulip) provides typed ...WithResponse methods on ClientWithResponses for messages, users, channels (streams), subscriptions, events long polling, uploads and organization administration, with HTTP Basic auth (email and API key) set through WithRequestEditorFn. Use when Go code needs to send or read Zulip messages, manage a Zulip organization, or already imports go-zulip.
openclaw skills install @psyb0t/go-zulipUnofficial, typed Go client for the Zulip REST API, in package zulip at the module root.
For install, operation names, request encoding and pagination, see references/setup.md.
ZULIP_SERVER, ZULIP_EMAIL and ZULIP_API_KEY. Never hardcode, commit or log credentials, or print an Authorization header./api/v1 in the base URL. Request content and credentials leave the machine for that server.github.com/psyb0t/go-zulip.AGENTS.md instead.The usage below covers one call. Every operation in the spec has a generated method, and the spec's descriptions are on them as Go doc comments. Look names and fields up instead of guessing. After go get github.com/psyb0t/go-zulip, from inside your module:
go doc github.com/psyb0t/go-zulip ClientWithResponsesInterface # every endpoint method
go doc github.com/psyb0t/go-zulip GetMessagesParams # one method, params type or model
go doc -all github.com/psyb0t/go-zulip # the whole package
The same documentation is at https://pkg.go.dev/github.com/psyb0t/go-zulip.
Method names come from the spec's operation IDs. <OperationId>WithResponse takes the context, then the path parameters in order, then *<OperationId>Params when the operation has query or header parameters, then the request body when it has one. The JSON200 field (or JSON201 and so on, per declared status) holds the decoded body; it is nil for any other status. Operations with a URL-encoded form body are <OperationId>WithFormdataBodyWithResponse (for example SendMessageWithFormdataBodyWithResponse with a SendMessageFormdataRequestBody), and multipart uploads use <OperationId>WithBodyWithResponse.
import (
"context"
"net/http"
"os"
"github.com/psyb0t/go-zulip"
)
auth := zulip.WithRequestEditorFn(
func(_ context.Context, req *http.Request) error {
req.SetBasicAuth(
os.Getenv("ZULIP_EMAIL"),
os.Getenv("ZULIP_API_KEY"),
)
return nil
},
)
client, err := zulip.NewClientWithResponses(
os.Getenv("ZULIP_SERVER"),
auth,
)
if err != nil {
return err
}
res, err := client.GetOwnUserWithResponse(context.Background())
if err != nil {
return err
}
_ = res.JSON200
Set ZULIP_SERVER to a URL such as https://your-server.example/api/v1. Check StatusCode() and JSON200 before consuming the response. The error return covers request, transport and decoding failures; an API rejection can return a nil Go error.
Read the generated signature for the operation before writing a call. Many endpoints use URL-encoded forms. Zulip's event API is REST long polling; this module has no WebSocket package.