(event_types)
List event types with aggregated statistics.
Scopes: events:read events:write
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.event_types.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", root_events=False, page=1, limit=10)
while res is not None:
# Handle items
res = res.next()| Parameter | Type | Required | Description |
|---|---|---|---|
organization_id |
OptionalNullable[models.EventTypesListQueryParamOrganizationIDFilter] | ➖ | Filter by organization ID. |
customer_id |
OptionalNullable[models.EventTypesListQueryParamCustomerIDFilter] | ➖ | Filter by customer ID. |
external_customer_id |
OptionalNullable[models.EventTypesListQueryParamExternalCustomerIDFilter] | ➖ | Filter by external customer ID. |
query |
OptionalNullable[str] | ➖ | Query to filter event types by name or label. |
root_events |
Optional[bool] | ➖ | When true, only return event types with root events (parent_id IS NULL). |
parent_id |
OptionalNullable[str] | ➖ | Filter by specific parent event ID. |
source |
OptionalNullable[models.EventSource] | ➖ | Filter by event source (system or user). |
page |
Optional[int] | ➖ | Page number, defaults to 1. |
limit |
Optional[int] | ➖ | Size of a page, defaults to 10. Maximum is 100. |
sorting |
List[models.EventTypesSortProperty] | ➖ | 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. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 4XX, 5XX | */* |
Update an event type's label.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.event_types.update(id="<value>", event_type_update={
"label": "<value>",
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | The event type ID. |
event_type_update |
models.EventTypeUpdate | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 4XX, 5XX | */* |