API & Integrations

API Overview

BeTS provides a comprehensive API for integrating with external systems, automating data imports, and building custom workflows.

API Features

RESTful Endpoints

Full CRUD operations for all BeTS resources via standard REST API patterns.

Webhooks

Receive real-time data from external systems like card readers, POS, and surveys.

Token Authentication

Secure API access with Bearer tokens and configurable secrets per endpoint.

Rate Limiting

Built-in rate limiting to prevent abuse and ensure fair usage.

Base URL

https://your-instance.betsapp.app/api

Each BeTS customer has their own dedicated instance with a unique subdomain.

Authentication

API endpoints support Bearer token authentication. Include your API secret in the Authorization header:

curl -X POST https://your-instance.betsapp.app/api/feedback/webhook \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -d '{"feedback": [...]}'

Environment Variables

Configure API secrets via environment variables. Each webhook endpoint has its own secret for granular access control.

Webhook Endpoints

MethodEndpointDescription
POST/api/arcade/webhook/weekly-importImport weekly arcade game activity
POST/api/events/webhookImport parsed event data from PDFs
POST/api/feedback/webhookImport guest feedback
POST/api/inventory/webhookImport redemption inventory
POST/api/bar/webhookImport bar inventory
POST/api/demo/seedSeed demo data (dev only)

Response Format

All API responses follow a consistent JSON format with success status and relevant data or error messages.

Success Response

{
  "success": true,
  "data": {
    "imported": 15,
    "skipped": 2,
    "errors": []
  }
}

Error Response

{
  "success": false,
  "error": "Invalid location name",
  "details": {
    "field": "locationName",
    "value": "Unknown Venue"
  }
}

Health Checks

All webhook endpoints support GET requests for health checks and documentation. Use these to verify connectivity and view expected payload formats.

# Check endpoint health and get documentation
curl https://your-instance.betsapp.app/api/feedback/webhook

# Response includes expected payload format
{
  "status": "ok",
  "endpoint": "/api/feedback/webhook",
  "methods": ["GET", "POST"],
  "auth": "Bearer token (FEEDBACK_WEBHOOK_SECRET)",
  "payload": { ... }
}

Detailed Documentation