Public APIs
Public-facing endpoints for published content
Public APIs
Complete API documentation for public-facing applications (mobile apps, websites, etc.). These endpoints are publicly accessible and do not require authentication.
Base URL: https://ycwadelaide.adenmgb.com
Development: https://dev.ycwadelaide.adenmgb.com
Overview
These endpoints provide:
- Read-only access to published content
- Public submissions (contact forms, newsletter subscriptions, etc.)
- SEO and feed endpoints (RSS, sitemap)
No Authentication Required - All public endpoints are accessible without authentication.
Content APIs
GET /api/actions
Retrieve all published YCW actions.
Query Parameters:
tag(optional) - Filter by tag slug
Response:
Notes:
- Only returns published actions
- Results ordered by
displayOrderASC - Includes tags and author information
GET /api/actions/:slug
Get a single published action by slug.
Response: Full action details including content and tags.
GET /api/news
Retrieve all published news articles.
Query Parameters:
tag(optional) - Filter by tag sluglimit(optional) - Limit number of results (default: 50)offset(optional) - Pagination offset
Response:
Notes:
- Only returns published articles
- Results ordered by
publishedAtDESC - Limited to 50 most recent by default
GET /api/news/:slug
Get a single published news article by slug.
Response: Full article details including content and tags.
GET /api/events
Retrieve all published events.
Query Parameters:
tag(optional) - Filter by tag slugupcoming(optional) - Iftrue, only returns future events
Response:
Notes:
- Only returns published events
- Results ordered by
startDateASC (upcoming first) endDateis optional
GET /api/events/:slug
Get a single published event by slug.
Response: Full event details including content and tags.
GET /api/people
Retrieve all published team members.
Response:
Notes:
- Only returns published people
- Results ordered by
displayOrderASC
Submissions & Engagement
POST /api/contact
Submit a contact form inquiry.
Request Body:
Success Response (200 OK):
Error Responses:
- 400 Bad Request - Missing required fields or invalid email format
Notes:
- All fields are required:
name,email,subject,message - Email format is validated server-side
- Inputs are sanitized (trimmed, length-limited):
name: max 200 charactersemail: max 200 characters (lowercased)subject: max 200 charactersmessage: max 5000 characters
- Submission is stored in database for staff review
- Email notification may be sent (if configured)
POST /api/newsletter/subscribe
Subscribe to the newsletter.
Request Body:
Success Response (200 OK):
Notes:
emailis requirednameis optionalsourceis optional (tracks where subscription came from, e.g., "website", "mobile-app", "event")- Email format is validated server-side
- Email is automatically lowercased and trimmed
- If email already exists:
- If unsubscribed: re-subscribes them
- If already subscribed: returns success message
- Inputs are sanitized:
email: max 200 characters, lowercasedname: max 200 characters (optional)source: max 50 characters (optional, defaults to "unknown")
POST /api/newsletter/unsubscribe
Unsubscribe from newsletter.
Request Body:
Success Response (200 OK):
Notes:
- Email is required
- Email format is validated
- Email is lowercased and trimmed
- Returns success even if email was not subscribed
POST /api/ycs/submit-action
Submit a YCS (Young Catholic Students) action proposal for review.
Request Body:
Success Response (200 OK):
Notes:
title,description,contactName,contactEmailare requiredcontent,imageUrls,contactPhoneare optionalimageUrlsshould use URLs from/api/ycs/upload/image- Submission is stored for staff review
- Email notification sent to staff
POST /api/ycs/upload/image
Upload an image for YCS action submission.
Request Body (FormData):
Success Response (200 OK):
Notes:
- Allowed file types:
image/jpeg,image/jpg,image/png,image/webp,image/gif - Images stored in
ycs-submissions/folder in R2 - Filename auto-generated with timestamp and random string
- Use returned
urlinimageUrlsarray when submitting action - No duplicate detection (unlike staff image upload)
Organization & Discovery
GET /api/tags
Retrieve all tags.
Response:
Notes:
- Results ordered by
nameASC - Used for filtering content
GET /api/navigation
Get the complete navigation structure including static pages and custom pages.
Response:
Notes:
- Includes static pages (Home, Actions, Events, About, News, People, Contact)
- Includes custom pages created by staff
- Supports nested navigation (folders with children)
- Results ordered by
orderASC
GET /api/about
Get about page content including mission, history, and values.
Response:
Notes:
missioncontains mission statement (title and content)historycontains organization history (title and content)valuesis an array of core values- Each value has:
id,title,description,icon(Heroicon name),colorClass(Tailwind CSS class) - Values ordered by
displayOrderASC, thenidASC - Content may be HTML formatted
GET /api/actions/:id/related
Get related actions based on shared tags.
Response:
Notes:
- Returns up to 3 related actions
- Related actions determined by shared tags
- Only returns published actions
- Results exclude the current action
- Returns empty array if no related actions found
GET /api/news/:id/related
Get related news articles based on shared tags or category.
Response:
Notes:
- Returns up to 3 related articles
- Related articles determined by shared tags or same category
- Only returns published articles
- Results exclude the current article
- Returns empty array if no related articles found
GET /api/static-images
Retrieve all static images with their specifications and guidelines.
Response:
Notes:
- Results ordered by
idASC idis a unique identifier (string)recommendedFormatis the recommended file formatrecommendedSizeis the recommended dimensionscontentDescriptionis optional alt text/accessibility description
GET /api/static-images/:id
Get a single static image by ID.
Response: Single static image object with same structure as above.
Feeds & SEO
GET /api/feed/news
RSS feed for published news articles.
Content-Type: application/rss+xml; charset=UTF-8
Response: XML RSS feed (RSS 2.0 format)
Notes:
- Returns up to 50 most recent published news articles
- Results ordered by
publishedAtDESC - Feed is cached for 1 hour (3600 seconds)
- Includes full article content in
content:encoded - Includes image enclosures if available
- Includes category information
- Uses ISO 8601 dates converted to RFC 822 format
GET /api/feed/events
RSS feed for published events.
Content-Type: application/rss+xml; charset=UTF-8
Response: XML RSS feed (RSS 2.0 format)
Notes:
- Returns up to 50 most recent published events
- Results ordered by
startDateASC (upcoming first) - Feed is cached for 1 hour (3600 seconds)
- Includes full event content in
content:encoded - Includes image enclosures if available
- Includes location and date information
- Uses ISO 8601 dates converted to RFC 822 format
GET /sitemap.xml
XML sitemap for SEO.
Content-Type: application/xml; charset=UTF-8
Response: XML sitemap
Notes:
- Sitemap is cached for 24 hours (86400 seconds)
- Includes all published content:
- Static pages (Home, Actions, Events, About, News, People, Contact)
- Published actions (with slugs)
- Published news articles (with slugs)
- Published events (with slugs)
- Published custom pages (with slugs)
lastmodis the last update date (YYYY-MM-DD format)changefreqindicates how often content changes:daily- Frequently updated pagesweekly- Content pagesmonthly- Static/infrequent pages
priorityindicates page importance (0.0 to 1.0):1.0- Homepage0.8- Main section pages0.7- Individual content pages
GET /robots.txt
Robots.txt file for search engine crawlers.
Content-Type: text/plain
Response:
Notes:
- Standard robots.txt format
- Allows all crawlers (
User-agent: *) - Allows crawling of public content (
Allow: /) - Disallows staff/admin areas (
Disallow: /staff/,Disallow: /api/staff/) - References sitemap location (
Sitemap: ...) - Used by search engines to understand crawl permissions
Common Patterns
Error Handling
All endpoints return consistent error format:
Status Codes
- 200 OK - Success
- 400 Bad Request - Invalid input/data
- 404 Not Found - Resource not found
- 500 Internal Server Error - Server error
Date Formats
All dates use ISO 8601 format: 2024-12-15T10:30:00.000Z (UTC)
Filtering
Many list endpoints support query parameters:
tag- Filter by tag slugsearch- Search by name/titlelimit- Limit number of resultsoffset- Pagination offset
CORS
All endpoints support CORS with:
Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONSAccess-Control-Allow-Headers: Content-Type, Authorization
Rate Limiting
Currently no rate limiting is implemented. Consider implementing client-side rate limiting for production mobile apps.
Mobile Implementation Tips
- Caching - Cache content locally for offline access
- Pagination - Implement pagination for large lists
- Image Optimization - Use appropriate image sizes for mobile
- Error Handling - Show user-friendly error messages
- Loading States - Show loading indicators for all requests
- Offline Support - Cache frequently accessed content
- Search - Implement client-side search/filtering
- Pull to Refresh - Implement pull-to-refresh for content lists
Complete API Reference
This document provides complete documentation for all public API endpoints. Use the links below to jump to specific sections:
Content APIs
- Actions - Browse and view published YCW actions
- News - Browse and view published news articles
- Events - Browse and view published events
- People - View published team members
- About - Get about page content (mission, history, values)
Organization & Discovery
- Tags - Browse tags for filtering content
- Navigation - Get website navigation structure
- Related Content - Get related content suggestions
Submissions & Engagement
- Contact - Submit contact form
- Newsletter - Subscribe/unsubscribe to newsletter
- YCS Submissions - Submit YCS action proposals
Media & Assets
- Static Images - Get static image information
- YCS Image Upload - Upload images for YCS submissions
Feeds & SEO
Related Guides
- Content APIs - Staff content management
- Media APIs - Image access