API Reference
All public REST endpoints used by the Statiq widget script.
Events
Returns all upcoming and recent events for the site.
{
"events": [
{
"id": 1,
"title": "Team Meetup",
"description": "Monthly all-hands.",
"location": "Conference Room A",
"starts_at": "2026-06-15T14:00:00Z",
"ends_at": "2026-06-15T16:00:00Z"
}
]
}
Announcements
Returns published announcements, newest first. limit defaults to 10. Only announcements with a publish date in the past (or no publish date) are returned.
{
"announcements": [
{
"id": 1,
"title": "New feature: Gallery",
"body": "<p>We just launched the gallery widget.</p>",
"published_at": "2026-05-01T00:00:00Z"
}
]
}
Popups
Returns active popups (not expired, currently within schedule).
{
"popups": [
{
"id": 1,
"title": "Get 20% off",
"body": "Use code SAVE20 at checkout.",
"cta_text": "Shop now",
"cta_url": "https://example.com/shop",
"type": "modal",
"delay_seconds": 3,
"frequency": "once_per_session"
}
]
}
Theme
Returns the site's widget theme (colours, radius, font). Injected as CSS custom properties by the widget script.
{
"accent": "#4f46e5",
"bg": "#ffffff",
"fg": "#0f172a",
"border_radius": "12px",
"font_family": "Inter"
}
Testimonials
Returns approved testimonials. limit defaults to 6.
{
"testimonials": [
{
"id": 1,
"name": "Jane Smith",
"role": "CTO",
"company": "Acme Corp",
"body": "Statiq saved us hours every week.",
"rating": 5,
"photo_url": ""
}
]
}
FAQ
Returns FAQ items ordered by sort order.
{
"faqs": [
{
"id": 1,
"question": "Do you offer refunds?",
"answer": "<p>Yes, within 30 days.</p>",
"sort_order": 0
}
]
}
Business Hours
Returns the weekly business hours schedule.
{
"hours": [
{ "day": 1, "open": "09:00", "close": "17:00", "closed": false },
{ "day": 6, "open": "", "close": "", "closed": true },
{ "day": 0, "open": "", "close": "", "closed": true }
]
}
Team
Returns all team members.
{
"members": [
{
"id": 1,
"name": "Alice Lee",
"role": "CEO",
"bio": "Leads product vision.",
"photo_url": "/media/team/1/1",
"linkedin_url": "https://linkedin.com/in/alicelee",
"twitter_url": ""
}
]
}
Map
Returns the map configuration.
{
"lat": 51.505,
"lng": -0.09,
"label": "Our Office",
"zoom": 14,
"style": "street"
}
Social Links
Returns configured social profile URLs.
{
"links": [
{ "platform": "twitter", "url": "https://twitter.com/example" },
{ "platform": "github", "url": "https://github.com/example" }
]
}
Gallery
Returns gallery images ordered by sort order.
{
"images": [
{
"id": 1,
"title": "Office",
"caption": "Our HQ in London.",
"url": "/media/gallery/1/1",
"sort_order": 0
}
]
}
Contact Form Config
Returns the contact form widget configuration (custom labels, required fields).
{
"name_label": "Your name",
"email_label": "Email address",
"message_label": "Message",
"submit_label": "Send",
"file_upload_enabled": false
}
Submit Contact Form
Submits a contact form entry. Body: multipart/form-data or application/x-www-form-urlencoded with fields name, email, message. Optional: file attachment.
// Success
{ "ok": true }
// Error
{ "error": "email is required" }
Subscribe
Adds an email subscriber. Body: JSON {"email": "[email protected]"}.
{ "ok": true }
Booking — Services
Returns bookable services.
{
"services": [
{
"id": 1,
"name": "30-min Consultation",
"duration_minutes": 30,
"price": "50.00",
"description": "One-on-one strategy session."
}
]
}
Booking — Available Slots
Returns available time slots for a service on a given date.
{
"slots": [
{ "start": "09:00", "end": "09:30" },
{ "start": "10:00", "end": "10:30" }
]
}
Booking — Create Appointment
Creates a booking. Body: JSON.
// Request
{
"service_id": 1,
"date": "2026-06-20",
"start": "10:00",
"name": "Jane Smith",
"email": "[email protected]",
"phone": "+1 555 0100",
"notes": "First appointment"
}
// Response
{ "id": 42, "status": "confirmed" }
Analytics Collect
Records a page view event. Called automatically by the widget script on each page load. Body: JSON with event, url, referrer.
{ "ok": true }
Media
Serves an uploaded gallery image. Content-Type is detected from file bytes. Cached for 24 hours.
Serves an uploaded team member photo. Content-Type is detected from file bytes. Cached for 24 hours.