class

Polar::Api::Events

Inherits Reference < Object

API client for events operations

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new Events instance

@param client [Client] The Polar API client instance

Source

Instance methods

Get Event

Get an event by ID.

Scopes: events:read events:write

Endpoint: GET /v1/events/{id}

Parameters:

  • id (required): The event ID.

Returns: Polar::Models::Event

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Ingest Events

Ingest batch of events.

Scopes: events:write

Endpoint: POST /v1/events/ingest

Parameters:

  • body (required): Request body as Polar::Models::EventsIngest

Returns: Polar::Models::EventsIngestResponse

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(filter : String | Nil = nil, start_timestamp : String | Nil = nil, end_timestamp : String | Nil = nil, organization_id : String | Nil = nil, customer_id : String | Nil = nil, external_customer_id : String | Nil = nil, meter_id : String | Nil = nil, name : String | Nil = nil, source : String | Nil = nil, query : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil, sorting : String | Nil = nil, metadata : String | Nil = nil) : Polar::Models::ListResource(Polar::Models::Event)

List Events

List events.

Scopes: events:read events:write

Endpoint: GET /v1/events/

Parameters:

  • filter (optional): Filter events following filter clauses. JSON string following the same schema a meter filter clause.
  • start_timestamp (optional): Filter events after this timestamp.
  • end_timestamp (optional): Filter events before this timestamp.
  • organization_id (optional): Filter by organization ID.
  • customer_id (optional): Filter by customer ID.
  • external_customer_id (optional): Filter by external customer ID.
  • meter_id (optional): Filter by a meter filter clause.
  • name (optional): Filter by event name.
  • source (optional): Filter by event source.
  • query (optional): Query to filter events.
  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.
  • sorting (optional): Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.
  • metadata (optional): Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.

Returns: Polar::Models::ListResource(Polar::Models::Event)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list_names(organization_id : String | Nil = nil, customer_id : String | Nil = nil, external_customer_id : String | Nil = nil, source : String | Nil = nil, query : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil, sorting : String | Nil = nil) : Polar::Models::ListResource(Polar::Models::EventName)

List Event Names

List event names.

Scopes: events:read events:write

Endpoint: GET /v1/events/names

Parameters:

  • organization_id (optional): Filter by organization ID.
  • customer_id (optional): Filter by customer ID.
  • external_customer_id (optional): Filter by external customer ID.
  • source (optional): Filter by event source.
  • query (optional): Query to filter event names.
  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.
  • sorting (optional): Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.

Returns: Polar::Models::ListResource(Polar::Models::EventName)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source