Skip to main content

Health and support API

Endpoints for public supporter statistics and the one-time donation Stripe checkout. These are used by the ticketyboo.dev team page and the support widget.

GET /api/team/supporters

GET /api/team/supporters No auth required

Returns aggregated supporter stats: total number of supporters and total donation amount in pence. Used to display live supporter counts on the site.

Response (200 OK)

{
  "supporter_count": 42,
  "total_pence": 84000
}

Fields

FieldTypeDescription
supporter_countintegerNumber of unique supporters who have completed a donation checkout
total_penceintegerTotal donated in GBP pence (divide by 100 for pounds)

Example

curl https://api.ticketyboo.dev/api/team/supporters

POST /api/support

POST /api/support No auth required

Creates a Stripe Checkout Session for a one-time GBP donation. Returns a checkout URL. The user is redirected to Stripe to complete payment. Donations are processed in GBP.

Request body

FieldTypeRequiredDescription
amount_penceintegerYesDonation amount in GBP pence. Minimum: 100 (£1.00).
donor_namestringNoOptional name shown on the supporter list

Response (200 OK)

{
  "checkout_url": "https://checkout.stripe.com/c/pay/...",
  "session_id": "cs_..."
}

Error responses

StatusCondition
400Missing amount_pence or amount below minimum

Webhook handling

When a donation checkout completes, Stripe sends a checkout.session.completed event to POST /api/stripe-webhook. The webhook handler records the donation in DynamoDB and increments the supporter stats counter. Webhook signatures are verified using HMAC-SHA256 with a 5-minute replay protection window.

GET /api/team/{resource}

GET /api/team/{resource} No auth required

Proxy endpoint for the /team/ dashboard. Returns data from DynamoDB team-activity table populated by the ops-agents Lambda functions. The resource path segment selects the data category (for example sre, cost, security, cto).

The /api/team/ endpoints serve the internal team dashboard at /team/. The data is written by four EventBridge-scheduled Lambda functions (ops-agents) and is not user-generated.