Events
What happened in the calling key's environment, as webhook events.
the same envelope every delivery sends, kept to be read back.
| Operation | Method | SDK |
|---|---|---|
| List events | GET | hixel.events.list |
| Get an event | GET | hixel.events.get |
List events#
GET/v1/eventshixel.events.list
A page of the environment's events, newest first, each exactly as its deliveries send it: how to catch up on what an endpoint missed.
Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
type | query | "wallet.balance_low" | "wallet.depleted" | "wallet.credited" | "wallet.grant_expired" | "wallet.credit_rejected" | "wallet.spend_limit_reached" | … | Only events of this type. |
cursor | query | string | The next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it. |
limit | query | integer | How many items the page holds: an integer from 1 to 100; 50 when left out. |
Response 200: EventList
| Field | Type | Description |
|---|---|---|
data required | array of Event | |
next_cursor required | string | null | Pass back as cursor for the next page; null on the last page. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.invalid_cursor: The cursor is not one this list gave.environment_required: a project key was sent withoutx-hixel-environment.invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.
- 404
environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own. - 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/events" \
-H "Authorization: Bearer $HIXEL_API_KEY"for await (const item of hixel.events.list()) {
console.log(item);
}Get an event#
GET/v1/events/{id}hixel.events.get
The event, exactly as its deliveries send it.
Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The event's id (evt_…). |
Response 200: Event
| Field | Type | Description |
|---|---|---|
id required | string | The event's id (evt_…), the same in every delivery of it: deduplicate on it. |
object required | "event" | |
type required | "wallet.balance_low" | |
api_version required | "2026-11-25" | The version of the envelope and of data. Removing or retyping a field is a new version; adding one is not, so ignore fields you do not know. |
created_at required | string (date-time) | When the change that caused the event was made, in its transaction (to the millisecond). |
environment required | string | The environment the event happened in (env_…). |
data required | object | |
data.customer required | string | Your id for the customer (its external_id), as every path takes it. |
data.wallet_id required | string | The id of a customer's wallet (wal_…). |
data.balance required | object | The balance once the change that caused the event was applied. |
data.balance.purchased_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
data.balance.grants_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
data.balance.total_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
data.threshold_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.environment_required: a project key was sent withoutx-hixel-environment.invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.
- 404
event_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/events/evt_123" \
-H "Authorization: Bearer $HIXEL_API_KEY"const event = await hixel.events.get("evt_123");