Events

API audit trail and event log

The events endpoint provides an audit trail of all API actions taken on your account. Every create, update, and delete operation is recorded with metadata including the request method, path, IP address, and status code.

Info

The events endpoint requires read permission.

Authentication

bash
Authorization: Bearer asp_xxx

Base URL: https://platform-api.anyspend.com/api/v1

Endpoints

List Events

List API events with optional filtering. Results are returned in reverse chronological order (newest first).

type string

Filter by event type (e.g., payment_link.created, webhook.updated, discount_code.deleted).

Filter by resource type (e.g., payment_link, webhook, discount_code, widget, notification).

from string

ISO 8601 timestamp. Only return events created at or after this time.

to string

ISO 8601 timestamp. Only return events created at or before this time.

page number

Page number for pagination (default: 1).

limit number

Results per page (default: 20, max: 100).

bash
curl -X GET "https://platform-api.anyspend.com/api/v1/events?type=payment_link.created&from=2026-02-01T00:00:00Z&limit=10" \ -H "Authorization: Bearer asp_xxx"
typescript
import { AnySpendClient } from "@b3dotfun/sdk/anyspend"; const client = new AnySpendClient({ apiKey: process.env.ANYSPEND_API_KEY! }); const events = await client.events.list({ type: "payment_link.created", from: "2026-02-01T00:00:00Z", limit: 10, });

Response

json
{ "success": true, "data": [ { "id": "evt_abc123", "event_type": "payment_link.created", "resource_type": "payment_link", "resource_id": "pl_xyz789", "ip_address": "203.0.113.42", "request_method": "POST", "request_path": "/api/v1/payment-links", "status_code": 201, "created_at": "2026-02-27T10:30:00Z" }, { "id": "evt_abc124", "event_type": "payment_link.created", "resource_type": "payment_link", "resource_id": "pl_xyz790", "ip_address": "203.0.113.42", "request_method": "POST", "request_path": "/api/v1/payment-links", "status_code": 201, "created_at": "2026-02-25T14:15:00Z" } ], "pagination": { "page": 1, "limit": 10, "total": 2, "total_pages": 1 } }

Event Object

FieldTypeDescription
idstringUnique event identifier (e.g., evt_abc123)
event_typestringThe type of action that occurred (see Event Types)
resource_typestringThe type of resource affected
resource_idstringThe ID of the affected resource
ip_addressstringIP address of the API caller
request_methodstringHTTP method used (GET, POST, PATCH, DELETE)
request_pathstringAPI path that was called
status_codenumberHTTP status code returned
created_atstringISO 8601 timestamp when the event was recorded

Event Types

Events follow the pattern {resource_type}.{action}:

Event TypeDescription
payment_link.createdA payment link was created
payment_link.updatedA payment link was updated
payment_link.deletedA payment link was deleted
product.createdA product was created
product.updatedA product was updated
product.deletedA product was deleted
webhook.createdA webhook endpoint was created
webhook.updatedA webhook endpoint was updated
webhook.deletedA webhook endpoint was deleted
discount_code.createdA discount code was created
discount_code.updatedA discount code was updated
discount_code.deletedA discount code was deleted
widget.createdA widget was created
widget.updatedA widget was updated
widget.deletedA widget was deleted
notification.updatedNotification settings were updated
api_key.createdAn API key was created
api_key.revokedAn API key was revoked

Resource Types

Resource TypeDescription
payment_linkPayment link resources
productProduct catalog entries
webhookWebhook endpoint configurations
discount_codeDiscount code entries
widgetWidget configurations
notificationNotification settings
api_keyAPI key management

Filtering Examples

Events for a specific date range

bash
curl -X GET "https://platform-api.anyspend.com/api/v1/events?from=2026-02-01T00:00:00Z&to=2026-02-28T23:59:59Z" \ -H "Authorization: Bearer asp_xxx"
typescript
const events = await client.events.list({ from: "2026-02-01T00:00:00Z", to: "2026-02-28T23:59:59Z", });
bash
curl -X GET "https://platform-api.anyspend.com/api/v1/events?resource_type=webhook&limit=50" \ -H "Authorization: Bearer asp_xxx"
typescript
const events = await client.events.list({ resource_type: "webhook", limit: 50, });

Deletion audit

bash
curl -X GET "https://platform-api.anyspend.com/api/v1/events?type=payment_link.deleted" \ -H "Authorization: Bearer asp_xxx"
typescript
const deletions = await client.events.list({ type: "payment_link.deleted", }); deletions.data.forEach((event) => { console.log( `${event.resource_id} deleted from ${event.ip_address} at ${event.created_at}` ); });
Note

Events are retained for 90 days. For longer retention, export events periodically using the date range filters.

Ask a question... ⌘I