Skip to Content
MySagra 1.4.0 is released 🎉

Banners

Banners are promotional images displayed in the MyCassa interface and customer-facing screens. Each banner has a type (event branding or sponsor logos) and can be toggled on/off.

{ "id": "clx...", "name": "Summer Festival 2026", "type": "EVENT", "title": "2026 Summer Festival", "description": "Join us for a spectacular summer celebration", "website": "https://example.com", "instagram": "@summerfestival", "facebook": "summerfestival2026", "image": "https://your-domain.com/banners/summer-festival.jpg", "color": "fecc01", "dateTime": "2026-06-01T00:00:00Z", "active": true }
FieldTypeDescription
idstringUnique banner identifier
namestringBanner name
typeEVENT | SPONSORBanner category
titlestringDisplay title
descriptionstringBanner description/tagline
websitestring (URL)Associated website URL
instagramstringInstagram handle
facebookstringFacebook page/ID
imagestring (URL)Image URL
colorstring (hex)Accent color (hex code without #)
dateTimeISO8601Event date/time
activebooleanWhether banner is visible

Endpoints

GET /v1/banners

List all banners. Requires: Bearer token.

GET /v1/banners Authorization: Bearer <token>

Response: 200 OK

[ { "id": "clx...", "name": "Summer Festival 2026", "type": "EVENT", "title": "2026 Summer Festival", "description": "Join us for a spectacular summer celebration", "website": "https://example.com", "instagram": "@summerfestival", "facebook": "summerfestival2026", "image": "https://your-domain.com/banners/summer-festival.jpg", "color": "fecc01", "dateTime": "2026-06-01T00:00:00Z", "active": true } ]

POST /v1/banners

Create a new banner. Requires: Bearer token (admin only).

POST /v1/banners Authorization: Bearer <token> Content-Type: application/json { "name": "Summer Festival 2026", "type": "EVENT", "title": "2026 Summer Festival", "description": "Join us for a spectacular summer celebration", "website": "https://example.com", "instagram": "@summerfestival", "facebook": "summerfestival2026", "color": "fecc01", "dateTime": "2026-06-01T00:00:00Z", "active": true }

Response: 201 Created

{ "id": "clx...", "name": "Summer Festival 2026", "type": "EVENT", "title": "2026 Summer Festival", "description": "Join us for a spectacular summer celebration", "website": "https://example.com", "instagram": "@summerfestival", "facebook": "summerfestival2026", "image": null, "color": "fecc01", "dateTime": "2026-06-01T00:00:00Z", "active": true }

GET /v1/banners/{id}

Retrieve a specific banner by ID. Requires: Bearer token.

GET /v1/banners/clx... Authorization: Bearer <token>

Response: 200 OK

PUT /v1/banners/{id}

Update a banner (full replacement). Requires: Bearer token (admin only).

PUT /v1/banners/clx... Authorization: Bearer <token> Content-Type: application/json { "name": "Summer Festival 2026", "type": "EVENT", "title": "2026 Summer Festival", "description": "Join us for a spectacular summer celebration", "website": "https://example.com", "instagram": "@summerfestival", "facebook": "summerfestival2026", "color": "fecc01", "dateTime": "2026-06-01T00:00:00Z", "active": true }

Response: 200 OK

PATCH /v1/banners/{id}/image

Upload or replace the banner image. Requires: Bearer token (admin only).

PATCH /v1/banners/clx.../image Authorization: Bearer <token> Content-Type: multipart/form-data [multipart body with image field]

Form field: image (PNG or JPG file)

Response: 200 OK

{ "id": "clx...", "name": "Summer Festival 2026", "type": "EVENT", "image": "https://your-domain.com/banners/summer-festival-abc123.jpg", ... }

DELETE /v1/banners/{id}

Delete a banner. Requires: Bearer token (admin only).

DELETE /v1/banners/clx... Authorization: Bearer <token>

Response: 204 No Content

Error Responses

StatusBodyDescription
400{ "error": "..." }Invalid request body or image format
401{ "message": "Unauthorized" }Missing or invalid Bearer token
403{ "message": "Forbidden" }Insufficient permissions (non-admin user)
404{ "message": "Banner not found" }Banner ID does not exist
Last updated on