Skip to main content
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.
The events endpoint requires read permission.

Authentication

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

Endpoints

List Events

GET /events
read
List API events with optional filtering. Results are returned in reverse chronological order (newest first).
string
Filter by event type (e.g., payment_link.created, webhook.updated, discount_code.deleted).
string
Filter by resource type (e.g., payment_link, webhook, discount_code, widget, notification).
string
ISO 8601 timestamp. Only return events created at or after this time.
string
ISO 8601 timestamp. Only return events created at or before this time.
number
Page number for pagination (default: 1).
number
Results per page (default: 20, max: 100).
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"
Response
{
  "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

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"
curl -X GET "https://platform-api.anyspend.com/api/v1/events?resource_type=webhook&limit=50" \
  -H "Authorization: Bearer asp_xxx"

Deletion audit

curl -X GET "https://platform-api.anyspend.com/api/v1/events?type=payment_link.deleted" \
  -H "Authorization: Bearer asp_xxx"
Events are retained for 90 days. For longer retention, export events periodically using the date range filters.