Hydra is now in beta|Get started free|Follow our journey on X.com

Store Events API
On this page

Store Events

Store events provide an immutable audit trail of all mutations in your project. Every time a resource is created, updated, or deleted, Hydra records an event with the action type, the affected resource, and the actor who made the change (API key or admin user).

Base URL: https://api.hydrajs.dev

Auth: All event endpoints require a secret key (sk_live_* or sk_test_*).

Endpoints

Method Path Auth Description
GET /v1/events Secret List store events
GET /v1/events/{id} Secret Get a single event

Immutable log

Events are immutable — they cannot be modified or deleted through the API.

Retention limits

Events are automatically purged after a plan-dependent retention period: 7 days on Free, 90 days on Pro. Export events via the API if you need longer retention.


List events

GET /v1/events

Returns a paginated list of store events, ordered by most recent first. Use the filter parameters to narrow results to a specific event type, resource, or actor.

Query parameters

Parameter Type Default Description
limit integer 25 Results per page (1–100)
cursor string - Pagination cursor from a previous response
order string desc Sort direction: asc, desc
type string - Filter by event type (e.g. product.created)
resource_type string - Filter by resource type (e.g. product, order)
resource_id string - Filter by specific resource ID
fields string - Comma-separated fields to return

Request

curl "https://api.hydrajs.dev/v1/events?type=product.updated&limit=10" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Response 200

{
	"data": [
		{
			"id": "sevt_abc123def456ghij",
			"type": "product.updated",
			"resource_type": "product",
			"resource_id": "prod_abc123",
			"actor_type": "admin",
			"actor_id": "user_xyz789",
			"summary": "Updated product \"Classic T-Shirt\": status changed to active",
			"metadata": {
				"changes": {
					"status": { "from": "draft", "to": "active" }
				}
			},
			"created_at": "2026-08-17T14:30:00Z"
		},
		{
			"id": "sevt_klm012nopq345rst",
			"type": "product.updated",
			"resource_type": "product",
			"resource_id": "prod_def456",
			"actor_type": "api_key",
			"actor_id": "key_abc123",
			"summary": "Updated product \"Slim Jeans\": price changed",
			"metadata": {},
			"created_at": "2026-08-17T12:15:00Z"
		}
	],
	"pagination": {
		"cursor": "eyJ0IjoiMjAyNi...",
		"has_more": true,
		"total": 128
	}
}

Filtering by resource

To see all events for a specific product:

curl "https://api.hydrajs.dev/v1/events?resource_type=product&resource_id=prod_abc123" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Get a single event

GET /v1/events/{id}

Returns a single event by its ID.

Query parameters

Parameter Type Description
fields string Comma-separated fields to return

Request

curl https://api.hydrajs.dev/v1/events/sevt_abc123def456ghij \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Response 200

{
	"data": {
		"id": "sevt_abc123def456ghij",
		"type": "product.updated",
		"resource_type": "product",
		"resource_id": "prod_abc123",
		"actor_type": "admin",
		"actor_id": "user_xyz789",
		"summary": "Updated product \"Classic T-Shirt\": status changed to active",
		"metadata": {
			"changes": {
				"status": { "from": "draft", "to": "active" }
			}
		},
		"created_at": "2026-08-17T14:30:00Z"
	}
}

Error 404 - event not found

{
	"error": {
		"code": "not_found",
		"message": "Event not found."
	}
}

Event types

Event type Trigger
product.created A product was created
product.updated A product was modified
product.deleted A product was soft-deleted
collection.created A collection was created
collection.updated A collection was modified
collection.deleted A collection was soft-deleted
customer.created A customer was created
customer.updated A customer was modified
customer.deleted A customer was soft-deleted
order.created An order was placed
order.updated An order was modified (status change, fulfillment, etc.)

Actor types

Each event records who performed the action:

Actor type Description
api_key Change made via an API key. actor_id is the key ID (prefix key_)
admin Change made by an admin user via the dashboard. actor_id is the user ID

The event object

Field Type Description
id string Unique ID (prefix: sevt_)
type string Event type (e.g. product.created)
resource_type string The type of resource affected (e.g. product, order)
resource_id string The ID of the affected resource
actor_type string Who performed the action: api_key or admin
actor_id string The ID of the actor (API key ID or admin user ID)
summary string Human-readable description of what changed
metadata object Additional context (e.g. field-level change details)
created_at string ISO 8601 timestamp