BrandingKitRpc
This RPC group provides CRUD operations for branding kits within the current subscription, along with a helper endpoint for obtaining a secure logo upload key. It also exposes billing metadata on create and delete operations, which is part of the endpoint contract.
Endpoints
POST /api/rpc (Method: BrandingKitRpc.getLogoUploadKey)
Description: Gets a secure upload key for a branding kit logo.
Request Body:
{ "method": "BrandingKitRpc.getLogoUploadKey", "params": {} }Parameters:
Name Type Required Description Response:
{ "success": true, "data": { "...": "Response shape is provided by `UploadDownloadService.getUploadKey(...)` and is not defined in this file." } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "BrandingKitRpc.getLogoUploadKey", "params": {} }'
POST /api/rpc (Method: BrandingKitRpc.getData)
Description: Lists branding kits for the current subscription.
Request Body:
{ "method": "BrandingKitRpc.getData", "params": { "filter": {}, "sort": {}, "page": 1, "pageSize": 20 } }Parameters:
Name Type Required Description filterAnyNo Optional filter object. The schema accepts any value and does not define field-level constraints in this file. sortAnyNo Optional sort object. The schema accepts any value and does not define sort-field constraints in this file. pageNumberNo Optional page number. pageSizeNumberNo Optional page size. Response:
{ "success": true, "data": { "...": "Response shape is returned by `BrandingKitService.getBrandingKits(...)` and is not defined in this file." } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "BrandingKitRpc.getData", "params": { "filter": {}, "sort": {}, "page": 1, "pageSize": 20 } }'
POST /api/rpc (Method: BrandingKitRpc.create)
Description: Creates a new branding kit.
Request Body:
{ "method": "BrandingKitRpc.create", "params": { "subscriptionId": "000000000000000000000000", "name": "Acme", "isDefault": false, "brandNameShort": "Acme", "brandNameLong": "Acme Corporation", "logoText": "Acme", "logoIconClass": "bi-star", "logoImageUrl": "/files/public/branding_assets/...", "faviconUrl": "/files/public/branding_assets/...", "address": "123 Main St", "phone": "555-0100", "email": "[email protected]", "website": "https://example.com", "socials": { "twitter": "https://x.com/acme", "facebook": null, "linkedin": null, "instagram": null, "youtube": null }, "primaryColor": "#0d6efd", "secondaryColor": "#6c757d", "accentColor": "#ffc107", "backgroundColor": "#f8f9fa", "textColor": "#212529", "footerText": "© {{currentYear}} {{brandNameLong}}. All rights reserved.", "unsubscribeText": "Unsubscribe from our mailing list." } }Parameters:
Name Type Required Description subscriptionIdStringYes The subscription this kit belongs to. nameStringYes Branding kit name. Must be at least 1 character. isDefaultBooleanNo Whether this is the default kit for the subscription. Defaults to false.brandNameShortStringNo Optional short brand name. brandNameLongStringNo Optional long brand name. logoTextStringNo Optional text used with the logo. logoIconClassStringNo Optional icon class used for the logo. logoImageUrlStringNo Relative path to the uploaded logo image. faviconUrlStringNo Relative path to the uploaded favicon. addressStringNo Optional address. phoneStringNo Optional phone number. emailStringNo Optional email address. websiteStringNo Optional website URL. Empty strings are normalized to nullbefore validation.socialsObjectNo Optional social links object with twitter,facebook,linkedin,instagram, andyoutube. Each entry accepts a URL,null, or an omitted value.primaryColorStringNo Optional primary color. Defaults to #0d6efd.secondaryColorStringNo Optional secondary color. Defaults to #6c757d.accentColorStringNo Optional accent color. Defaults to #ffc107.backgroundColorStringNo Optional background color. Defaults to #f8f9fa.textColorStringNo Optional text color. Defaults to #212529.footerTextStringNo Optional footer text. Defaults to © {{currentYear}} {{brandNameLong}}. All rights reserved.unsubscribeTextStringNo Optional unsubscribe text. Defaults to Unsubscribe from our mailing list.Response:
{ "success": true, "data": { "...": "Created branding kit data is returned by `BrandingKitService.createBrandingKit(...)` and is not defined in this file." } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "BrandingKitRpc.create", "params": { "subscriptionId": "000000000000000000000000", "name": "Acme" } }'
POST /api/rpc (Method: BrandingKitRpc.update)
Description: Updates an existing branding kit.
Request Body:
{ "method": "BrandingKitRpc.update", "params": { "_id": "64f0c0a0c0a0c0a0c0a0c0a0", "name": "Acme Updated", "isDefault": true } }Parameters:
Name Type Required Description _idStringYes Identifier of the branding kit to update. subscriptionIdStringNo The subscription this kit belongs to. nameStringNo Branding kit name. isDefaultBooleanNo Whether this is the default kit for the subscription. brandNameShortStringNo Optional short brand name. brandNameLongStringNo Optional long brand name. logoTextStringNo Optional text used with the logo. logoIconClassStringNo Optional icon class used for the logo. logoImageUrlStringNo Relative path to the uploaded logo image. faviconUrlStringNo Relative path to the uploaded favicon. addressStringNo Optional address. phoneStringNo Optional phone number. emailStringNo Optional email address. websiteStringNo Optional website URL. Empty strings are normalized to nullbefore validation.socialsObjectNo Optional social links object. primaryColorStringNo Optional primary color. secondaryColorStringNo Optional secondary color. accentColorStringNo Optional accent color. backgroundColorStringNo Optional background color. textColorStringNo Optional text color. footerTextStringNo Optional footer text. unsubscribeTextStringNo Optional unsubscribe text. createdAtDateNo Creation timestamp, accepted by the schema but typically not supplied by clients. updatedAtDateNo Last update timestamp, accepted by the schema but typically not supplied by clients. Response:
{ "success": true, "data": { "...": "Updated branding kit data is returned by `BrandingKitService.updateBrandingKit(...)` and is not defined in this file." } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "BrandingKitRpc.update", "params": { "_id": "64f0c0a0c0a0c0a0c0a0c0a0", "name": "Acme Updated" } }'