Files

28 KiB

\EventAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
GetEventEconomic Get /v1/event/economic Returns, oldest first and paged, the payments the caller's org made or received in a year, with the ones a correction restates named and what either party disputes — for the org's admins.
GetEventErrors Get /v1/event/errors Returns the caller org's most recently captured errors, newest first.
GetEventHealth Get /v1/event/health Reports whether the event plane can take a write and the warehouse can answer a read.
GetEventInsightsEvents Get /v1/event/insights/events Returns the caller org's most recent product events, newest first.
GetEventInsightsHealth Get /v1/event/insights/health Reports that the unified insights surface is serving.
GetEventOverview Get /v1/event/overview Returns the caller org's analytics KPIs for one time window.
GetEventPixelByKey Get /v1/event/pixel/{key} A site's default pixel — a page view from an image, for a page that runs no script
GetEventTagJs Get /v1/event/tag.js The Hanzo event tag — the one-line install for a surface with no bundler
GetEventTimeseries Get /v1/event/timeseries Returns the caller org's LLM usage over time as an evenly-spaced series.
GetEventTop Get /v1/event/top Returns the caller org's ranked lenses for one window, five of them at once.
PostEvent Post /v1/event Capture product events into your org's warehouse
PostEventEconomicDispute Post /v1/event/economic/dispute Records that the caller's org disputes one payment it is party to — for the org's admins.
PostEventReplay Post /v1/event/replay Record a session-replay snapshot batch

GetEventEconomic

EventEconomics GetEventEconomic(ctx).Year(year).Counterparty(counterparty).Rail(rail).Cursor(cursor).Limit(limit).Execute()

Returns, oldest first and paged, the payments the caller's org made or received in a year, with the ones a correction restates named and what either party disputes — for the org's admins.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	year := int64(2026) // int64 | Year is the calendar year to read, UTC.
	counterparty := "counterparty_example" // string | Counterparty keeps only payments with this org on the other side. (optional)
	rail := "x402" // string | Rail keeps only payments that moved on this rail. (optional)
	cursor := "cursor_example" // string | Cursor continues from the next of the page before; empty starts the year. (optional)
	limit := int64(789) // int64 | Limit is how many events to answer, default 100 and at most 1000. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventEconomic(context.Background()).Year(year).Counterparty(counterparty).Rail(rail).Cursor(cursor).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventEconomic``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventEconomic`: EventEconomics
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventEconomic`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetEventEconomicRequest struct via the builder pattern

Name Type Description Notes
year int64 Year is the calendar year to read, UTC.
counterparty string Counterparty keeps only payments with this org on the other side.
rail string Rail keeps only payments that moved on this rail.
cursor string Cursor continues from the next of the page before; empty starts the year.
limit int64 Limit is how many events to answer, default 100 and at most 1000.

Return type

EventEconomics

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventErrors

EventErrorList GetEventErrors(ctx).Limit(limit).Execute()

Returns the caller org's most recently captured errors, newest first.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	limit := int64(100) // int64 | Limit is how many rows to return, newest first. Default 50, maximum 200; a value at or below zero, or one that is not a number, takes the default. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventErrors(context.Background()).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventErrors``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventErrors`: EventErrorList
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventErrors`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetEventErrorsRequest struct via the builder pattern

Name Type Description Notes
limit int64 Limit is how many rows to return, newest first. Default 50, maximum 200; a value at or below zero, or one that is not a number, takes the default.

Return type

EventErrorList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventHealth

EventHealthReport GetEventHealth(ctx).Execute()

Reports whether the event plane can take a write and the warehouse can answer a read.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventHealth(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventHealth``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventHealth`: EventHealthReport
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventHealth`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetEventHealthRequest struct via the builder pattern

Return type

EventHealthReport

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventInsightsEvents

EventEventList GetEventInsightsEvents(ctx).Limit(limit).Impersonated(impersonated).Execute()

Returns the caller org's most recent product events, newest first.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	limit := int64(100) // int64 | Limit is how many rows to return, newest first. Default 50, maximum 200; a value at or below zero, or one that is not a number, takes the default. (optional)
	impersonated := "impersonated_example" // string | Impersonated is which events to return against the mark a platform operator leaves acting as someone else: exclude (the default, the tenant's own traffic), include, or only. Anything else is a 400. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventInsightsEvents(context.Background()).Limit(limit).Impersonated(impersonated).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventInsightsEvents``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventInsightsEvents`: EventEventList
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventInsightsEvents`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetEventInsightsEventsRequest struct via the builder pattern

Name Type Description Notes
limit int64 Limit is how many rows to return, newest first. Default 50, maximum 200; a value at or below zero, or one that is not a number, takes the default.
impersonated string Impersonated is which events to return against the mark a platform operator leaves acting as someone else: exclude (the default, the tenant's own traffic), include, or only. Anything else is a 400.

Return type

EventEventList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventInsightsHealth

EventInsightsStatus GetEventInsightsHealth(ctx).Execute()

Reports that the unified insights surface is serving.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventInsightsHealth(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventInsightsHealth``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventInsightsHealth`: EventInsightsStatus
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventInsightsHealth`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetEventInsightsHealthRequest struct via the builder pattern

Return type

EventInsightsStatus

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventOverview

EventOverview GetEventOverview(ctx).Range_(range_).Start(start).End(end).Impersonated(impersonated).Execute()

Returns the caller org's analytics KPIs for one time window.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	range_ := "7d" // string | Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all. Default 24h. Ignored when both start and end are given. An unknown value, or one past the 730-day horizon, is a 400. (optional)
	start := "start_example" // string | Start is the inclusive lower bound of a custom window, RFC3339. Requires end. (optional)
	end := "end_example" // string | End is the exclusive upper bound of a custom window, RFC3339. Requires start. (optional)
	impersonated := "impersonated_example" // string | Impersonated is which events the product-event lenses count against the mark a platform operator leaves acting as someone else: exclude (the default, the tenant's own traffic), include, or only. Anything else is a 400. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventOverview(context.Background()).Range_(range_).Start(start).End(end).Impersonated(impersonated).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventOverview``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventOverview`: EventOverview
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventOverview`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetEventOverviewRequest struct via the builder pattern

Name Type Description Notes
range_ string Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all. Default 24h. Ignored when both start and end are given. An unknown value, or one past the 730-day horizon, is a 400.
start string Start is the inclusive lower bound of a custom window, RFC3339. Requires end.
end string End is the exclusive upper bound of a custom window, RFC3339. Requires start.
impersonated string Impersonated is which events the product-event lenses count against the mark a platform operator leaves acting as someone else: exclude (the default, the tenant's own traffic), include, or only. Anything else is a 400.

Return type

EventOverview

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventPixelByKey

*os.File GetEventPixelByKey(ctx, key).Execute()

A site's default pixel — a page view from an image, for a page that runs no script

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	key := "key_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventPixelByKey(context.Background(), key).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventPixelByKey``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventPixelByKey`: *os.File
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventPixelByKey`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
key string

Other Parameters

Other parameters are passed through a pointer to a apiGetEventPixelByKeyRequest struct via the builder pattern

Name Type Description Notes

Return type

*os.File

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: image/gif

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventTagJs

*os.File GetEventTagJs(ctx).Execute()

The Hanzo event tag — the one-line install for a surface with no bundler

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventTagJs(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventTagJs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventTagJs`: *os.File
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventTagJs`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetEventTagJsRequest struct via the builder pattern

Return type

*os.File

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventTimeseries

EventTimeseries GetEventTimeseries(ctx).Range_(range_).Start(start).End(end).Execute()

Returns the caller org's LLM usage over time as an evenly-spaced series.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	range_ := "30d" // string | Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all. Default 24h. Ignored when both start and end are given. An unknown value, or one past the 730-day horizon, is a 400. (optional)
	start := "start_example" // string | Start is the inclusive lower bound of a custom window, RFC3339. Requires end. (optional)
	end := "end_example" // string | End is the exclusive upper bound of a custom window, RFC3339. Requires start. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventTimeseries(context.Background()).Range_(range_).Start(start).End(end).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventTimeseries``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventTimeseries`: EventTimeseries
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventTimeseries`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetEventTimeseriesRequest struct via the builder pattern

Name Type Description Notes
range_ string Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all. Default 24h. Ignored when both start and end are given. An unknown value, or one past the 730-day horizon, is a 400.
start string Start is the inclusive lower bound of a custom window, RFC3339. Requires end.
end string End is the exclusive upper bound of a custom window, RFC3339. Requires start.

Return type

EventTimeseries

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventTop

EventTop GetEventTop(ctx).Range_(range_).Start(start).End(end).Limit(limit).Impersonated(impersonated).Execute()

Returns the caller org's ranked lenses for one window, five of them at once.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	range_ := "7d" // string | Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all. Default 24h. Ignored when both start and end are given. An unknown value, or one past the 730-day horizon, is a 400. (optional)
	start := "start_example" // string | Start is the inclusive lower bound of a custom window, RFC3339. Requires end. (optional)
	end := "end_example" // string | End is the exclusive upper bound of a custom window, RFC3339. Requires start. (optional)
	limit := int64(25) // int64 | Limit bounds every ranked lens in the response. Default 10, maximum 100; a value at or below zero, or one that is not a number, takes the default. (optional)
	impersonated := "impersonated_example" // string | Impersonated is which events the product-event lenses count against the mark a platform operator leaves acting as someone else: exclude (the default, the tenant's own traffic), include, or only. Anything else is a 400. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.GetEventTop(context.Background()).Range_(range_).Start(start).End(end).Limit(limit).Impersonated(impersonated).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.GetEventTop``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEventTop`: EventTop
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.GetEventTop`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetEventTopRequest struct via the builder pattern

Name Type Description Notes
range_ string Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all. Default 24h. Ignored when both start and end are given. An unknown value, or one past the 730-day horizon, is a 400.
start string Start is the inclusive lower bound of a custom window, RFC3339. Requires end.
end string End is the exclusive upper bound of a custom window, RFC3339. Requires start.
limit int64 Limit bounds every ranked lens in the response. Default 10, maximum 100; a value at or below zero, or one that is not a number, takes the default.
impersonated string Impersonated is which events the product-event lenses count against the mark a platform operator leaves acting as someone else: exclude (the default, the tenant's own traffic), include, or only. Anything else is a 400.

Return type

EventTop

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostEvent

CaptureResult PostEvent(ctx).PostEventRequest(postEventRequest).Execute()

Capture product events into your org's warehouse

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	postEventRequest := openapiclient.post_event_request{CaptureBatch: openapiclient.NewCaptureBatch()} // PostEventRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.PostEvent(context.Background()).PostEventRequest(postEventRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.PostEvent``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostEvent`: CaptureResult
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.PostEvent`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostEventRequest struct via the builder pattern

Name Type Description Notes
postEventRequest PostEventRequest

Return type

CaptureResult

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostEventEconomicDispute

EventEconomicDispute PostEventEconomicDispute(ctx).EventDisputeIn(eventDisputeIn).Execute()

Records that the caller's org disputes one payment it is party to — for the org's admins.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	eventDisputeIn := *openapiclient.NewEventDisputeIn("Event_example", "Reason_example") // EventDisputeIn | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.PostEventEconomicDispute(context.Background()).EventDisputeIn(eventDisputeIn).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.PostEventEconomicDispute``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostEventEconomicDispute`: EventEconomicDispute
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.PostEventEconomicDispute`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostEventEconomicDisputeRequest struct via the builder pattern

Name Type Description Notes
eventDisputeIn EventDisputeIn

Return type

EventEconomicDispute

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostEventReplay

CaptureResult PostEventReplay(ctx).ReplayBody(replayBody).Execute()

Record a session-replay snapshot batch

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	replayBody := *openapiclient.NewReplayBody() // ReplayBody |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.EventAPI.PostEventReplay(context.Background()).ReplayBody(replayBody).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventAPI.PostEventReplay``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostEventReplay`: CaptureResult
	fmt.Fprintf(os.Stdout, "Response from `EventAPI.PostEventReplay`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostEventReplayRequest struct via the builder pattern

Name Type Description Notes
replayBody ReplayBody

Return type

CaptureResult

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]