Skip to main content

Theme API - Quick Reference

✅ Implemented

A read-only REST API for themes has been added to the platform.

Endpoints

GET /v0.3/themes/           - List all themes
GET /v0.3/themes/{id}/ - Get theme by UUID
GET /v0.3/themes/{slug}/ - Get theme by slug (recommended)

Features

  • Search: ?search=oakland - Searches name, slug, description
  • Filter: ?slug=oakland or ?name=Oakland%20Theme
  • Lookup by slug: Use slug as lookup field for user-friendly URLs
  • Public access: No authentication required
  • Read-only: Create/update/delete via Django admin only

Example Usage

# Get theme by slug
curl https://api.vibemap.com/v0.3/themes/oakland/

# Search themes
curl "https://api.vibemap.com/v0.3/themes/?search=oakland"

# List all themes
curl https://api.vibemap.com/v0.3/themes/

Response Structure

Returns all theme fields from the Theme model:

  • Color scheme (accent, secondary, background, etc.)
  • Branding (logo_url, font_url)
  • Event form configuration
  • Events display settings
  • Cards configuration
  • Map configuration
  • Filter settings

Integration

Themes are used by:

  1. Organizations - Have a default theme
  2. Lists - Can override theme properties via theme_overrides

When fetching a list, the theme field contains the merged result of:

  • Base theme (from organization)
  • Theme overrides (from list)

Files Modified

  1. api/views.py:1685-1721 - Added ThemeViewSet
  2. api/urlsv03.py:27 - Registered themes route
  3. api/serializers/accounts.py:291-311 - Enhanced ThemeSerializer documentation

Testing

Test the API:

# Check if endpoint is accessible
curl http://localhost:8000/v0.3/themes/

# Get specific theme (replace with actual slug)
curl http://localhost:8000/v0.3/themes/vibemap/

Status: ✅ Complete and ready to use!