Docs/White-Label API
White-Label API

SparkGlim White-Label API

Version 1 API for approved white-label organizations using SparkGlim infrastructure under their own brand.

API context

Base path

/api/white-label/v1

Audience

Approved white-label organizations with issued API keys.

Authentication

HMAC-signed requests with x-white-label-key-id, x-white-label-signature, x-white-label-timestamp, and x-white-label-nonce.

Overview

Overview

Use this API for white-label organization operations only. It is not the reseller portal API.

All documented endpoints were audited from server/src/api/routes/white-label.ts.

Authentication

Sign requests on your backend. Never place the API secret in browser or mobile code.

Nonce and timestamp are required for replay protection.

Errors

White-label client API errors use { success: false, error, requestId } with HTTP 400 for handler errors and 401/403 in auth middleware.

Implementation audit

These docs are tied to the current backend implementation.

Mounted at /api/white-label in server/src/api/router.ts.
Client API routes are implemented under /api/white-label/v1 in server/src/api/routes/white-label.ts.
Auth is enforced by requireWhiteLabelAuth in server/src/white-label/auth.ts.
Only Version 1 is documented.

Overview

GET
Overview
server/src/api/routes/white-label.ts:1056

Get account context

Loads the current white-label account context for an enabled account.

GET /api/white-label/v1/context

Authentication

White-label HMAC authentication

Permissions

settings:read

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.

Campaigns

GET
Campaigns
server/src/api/routes/white-label.ts:1067; server/src/white-label/schemas.ts:468

List campaigns

Lists campaigns visible to the authenticated white-label account.

GET /api/white-label/v1/campaigns

Authentication

White-label HMAC authentication

Permissions

campaigns:read

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
searchquerystringNoOptional campaign search text.
statusquerystringNoOptional campaign status filter.
POST
Campaigns
server/src/api/routes/white-label.ts:1079; server/src/white-label/schemas.ts:318

Create campaign

Creates a white-label campaign. Supported campaign_type values are voting, donation, and ticketing.

POST /api/white-label/v1/campaigns

Authentication

White-label HMAC authentication

Permissions

campaigns:write

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
titlebodystringYes3 to 255 characters.
descriptionbodystringYes10 to 5000 characters.
campaign_typebodyvoting | donation | ticketingYesImplemented campaign types.
start_datebodyISO datetimeYesCampaign start date.
end_datebodyISO datetimeYesCampaign end date.
PATCH
Campaigns
server/src/api/routes/white-label.ts:1091

Update campaign

Partially updates an existing campaign owned by the white-label account.

PATCH /api/white-label/v1/campaigns/:campaignId

Authentication

White-label HMAC authentication

Permissions

campaigns:write

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
campaignIdpathstringYesCampaign identifier.

Ticketing

GET
Ticketing
server/src/api/routes/white-label.ts:1103; server/src/white-label/schemas.ts:473

List ticket types

Lists ticket types, optionally filtered by campaignId.

GET /api/white-label/v1/ticket-types

Authentication

White-label HMAC authentication

Permissions

tickets:read

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
campaignIdqueryuuidNoOptional campaign filter.
POST
Ticketing
server/src/api/routes/white-label.ts:1115; server/src/white-label/schemas.ts:341

Create ticket type

Creates a ticket type for a ticketing campaign.

POST /api/white-label/v1/ticket-types

Authentication

White-label HMAC authentication

Permissions

tickets:write

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
campaignIdbodyuuidYesCampaign ID.
namebodystringYesTicket type name.
pricebodynumberYesTicket price.
quantity_availablebodynumberYesAvailable quantity.

Voting

GET
Voting
server/src/api/routes/white-label.ts:1139; server/src/white-label/schemas.ts:357

List participants

Lists voting participants/nominees for white-label campaigns.

GET /api/white-label/v1/participants

Authentication

White-label HMAC authentication

Permissions

campaigns:read

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
campaignIdqueryuuidNoOptional campaign filter.
searchquerystringNoOptional search text.
statusquerystringNoOptional participant status.

Payments

POST
Payments
server/src/api/routes/white-label.ts:1247; server/src/white-label/schemas.ts:393

Initialize payment

Initializes a vote, donation, or ticket payment through the white-label account provider routing.

POST /api/white-label/v1/payments/initialize

Authentication

White-label HMAC authentication

Permissions

payments:write

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
transactionTypebodyvote | donation | ticketYesTransaction type.
amountbodynumberYesPositive amount.
emailbodyemailYesCustomer email.
callbackUrlbodyURLYesCallback URL.

Withdrawals

POST
Withdrawals
server/src/api/routes/white-label.ts:1262; server/src/white-label/schemas.ts:384

Create withdrawal request

Creates a withdrawal request. This route requires a secret key, withdrawal-enabled API key, and idempotency key.

POST /api/white-label/v1/withdrawals

Authentication

White-label HMAC authentication with secret key only

Permissions

withdrawals:write, withdrawal capability, X-Idempotency-Key header

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
X-Idempotency-KeyheaderstringYesRequired duplicate-prevention key.
amountbodynumberYesPositive amount.
bank_namebodystringYesBank/channel name.
bank_codebodystringYesBank/channel code.
account_numberbodystringYesRecipient account number.
account_namebodystringYesRecipient account name.

Settings

GET
Settings
server/src/api/routes/white-label.ts:1294; server/src/white-label/schemas.ts:477

Read settings

Returns white-label settings, optionally filtered by categories.

GET /api/white-label/v1/settings

Authentication

White-label HMAC authentication

Permissions

settings:read

NameLocationTypeRequiredDescription
x-white-label-key-idheaderstringYesWhite-label API key ID from the account keyring.
x-white-label-signatureheaderstringYesHMAC signature generated by your backend.
x-white-label-timestampheadernumber stringYesRequest timestamp in milliseconds.
x-white-label-nonceheaderstringYesUnique nonce for replay protection.
categoriesquerystring | string[]NoOptional category filter.