Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Ingest

Ingest events
client.V1.Usage.Ingest(ctx, body) error
post/v1/ingest

Send usage events to Metronome. The body of this request is expected to be a JSON array of between 1 and 100 usage events. Compressed request bodies are supported with a Content-Encoding: gzip header. See Getting usage into Metronome to learn more about usage events.

Parameters
bodyUsagefieldV1UsageIngestParams
Hide ParametersShow Parameters
Usagefield
optional
Hide ParametersShow Parameters
CustomerIDstring
minLength1
EventTypestring
minLength1
Timestampstring

RFC 3339 formatted

TransactionIDstring
minLength1
maxLength128
Propertiesmap
optional
map[string, unknown]
package main

import (
  "context"

  "github.com/Metronome-Industries/metronome-go"
  "github.com/Metronome-Industries/metronome-go/option"
)

func main() {
  client := metronome.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  err := client.V1.Usage.Ingest(context.TODO(), metronome.V1UsageIngestParams{

  })
  if err != nil {
    panic(err.Error())
  }
}