Skip to main content
The Marketing domain covers the full lifecycle of outbound messaging campaigns (WhatsApp, SMS, Email), the message templates those campaigns reference, storefront-theme templates, email and SMS sending connections, Web Push subscriptions, notification channels, and per-user notification preferences. Campaigns can target individual customers, tag-based segments, or the entire customer base and support template messages, free-form messages, and scheduled delivery. Base URL https://api.genuka.com · Auth Authorization: Bearer <token> + X-Company: <companyId> · See Getting Started for shared conventions, pagination & error formats.

Endpoints at a glance


Campaigns

GET /2023-11/admin/campaigns

List all campaigns for the authenticated company, with optional filtering, sorting, and pagination.
  • Query parameters:
Request example:
Success response — 200 OK:
Error responses:
  • 400 — Missing X-Company header (company_id_required)
  • 401 — Invalid or missing token

POST /2023-11/admin/campaigns

Create a new campaign. Optionally attach individual customers and compute conversation-window eligibility for free-message campaigns.
  • Request body:
Request example:
Success response — 200 OK:
Error responses:
  • 400 — Missing X-Company header
  • 422 — Validation failure (e.g. invalid status value, non-existent campaign_template_id)
  • 500 — Internal error (transaction rolled back)

POST /2023-11/admin/campaigns/bulk-delete

Permanently delete multiple campaigns in a single request.
  • Request body:
Request example:
Success response — 204 No Content: Empty body. Error responses:
  • 422 — One or more IDs do not exist
  • 500 — Transaction failure

GET /2023-11/admin/campaigns/{campaign}

Retrieve a single campaign including its template, customers, WhatsApp connection, and button-click stats.
  • Path parameters:
Request example:
Success response — 200 OK:
Error responses:
  • 404 — Campaign not found or belongs to another company

PUT /2023-11/admin/campaigns/{campaign}

Update a campaign. If status is set to running a SendCampaignJob is dispatched immediately.
  • Path parameters:
  • Request body: All fields optional (same field set as create, with status accepting additionally paused, running, completed, failed).
Request example:
Success response — 200 OK:
Error responses:
  • 404 — Campaign not found
  • 422 — Validation failure
  • 500 — Transaction failure

DELETE /2023-11/admin/campaigns/{campaign}

Permanently delete a single campaign.
  • Path parameters:
Request example:
Success response — 204 No Content: Empty body. Error responses:
  • 404 — Campaign not found

POST /2023-11/admin/campaigns/{campaign}/cancel-scheduled

Cancel a pending scheduled campaign job. The campaign status reverts to draft and scheduled_at is cleared.
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:
Error responses:
  • 400 — Campaign is not in scheduled status, or has no scheduled_job_id
  • 404 — Scheduled job has already started and could not be canceled
  • 500 — Internal error

GET /2023-11/admin/campaigns/{campaign}/customers

Paginated list of customers attached to a campaign, with per-customer delivery status.
  • Path parameters:
  • Query parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/campaigns/{campaign}/customers/export

Trigger an async export of campaign recipients. The export job runs in the background; the user is notified on completion.
  • Path parameters:
  • Query parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:
Note: The response shape is produced by AsyncExportManager. The exact fields may vary; the key indication is an HTTP 200 acknowledging the job was dispatched. The file is delivered asynchronously via a notification.

GET /2023-11/admin/campaigns/{campaign}/customers/export/fields

Return the list of column slugs available for export.
  • Path parameters:
Request example:
Success response — 200 OK:

GET /2023-11/admin/campaigns/{campaign}/customers/{customer}

Retrieve full delivery detail for a single recipient including status events, button clicks, and the most recent inbox conversation.
  • Path parameters:
Request example:
Success response — 200 OK:
Error responses:
  • 404 — Campaign–customer record not found

POST /2023-11/admin/campaigns/{campaign}/customers/{customer}/retry

Re-send the campaign message to a single recipient.
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:
Error responses:
  • 404 — No campaign–customer pivot record found
  • 422 — Provider rejected the retry

POST /2023-11/admin/campaigns/{campaign}/duplicate

Create an exact copy of a campaign (with all recipients) in draft status with the name suffixed (copy).
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:
Error responses:
  • 404 — Source campaign not found
  • 500 — Transaction failure

GET /2023-11/admin/campaigns/{campaign}/pre-launch

Estimate recipient count, per-message credit cost, and current wallet balance before launching a campaign.
  • Path parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/campaigns/{campaign}/launch

Launch a campaign immediately. Delegates to CampaignService::launchCampaign.
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:
Error responses:
  • 404 — Campaign not found
  • 500 — Launch error (e.g. insufficient balance, provider unreachable)

GET /2023-11/admin/campaigns/{campaign}/pre-retry-failed

Return the count of failed recipients and cost estimate before retrying all failed messages.
  • Path parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/campaigns/{campaign}/retry-failed

Retry sending the campaign message to all recipients currently in failed status.
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:
Error responses:
  • 404 — Campaign not found
  • 500 — Retry error

Campaign Templates

Campaign templates are pre-approved message templates for WhatsApp, SMS, or email campaigns. WhatsApp templates require Meta review (status: pending → approved); SMS and email templates are auto-approved.

GET /2023-11/admin/campaign-templates

List campaign templates. WhatsApp templates are synced from the provider (cached for 30 minutes).
  • Query parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/campaign-templates

Create a campaign template locally and submit it to the provider for approval. For WhatsApp, a FOOTER component is auto-appended if absent.
  • Request body:
Request example (WhatsApp):
Success response — 200 OK:
Error responses:
  • 422 — Validation failure
  • 500 — Provider API error or transaction failure (includes fields array indicating blamed fields from Meta)

POST /2023-11/admin/campaign-templates/bulk-delete

Soft-delete multiple campaign templates.
  • Request body:
Request example:
Success response — 200 OK:

GET /2023-11/admin/campaign-templates/{campaignTemplate}

Retrieve a single campaign template. Pass ?sync=true to force a provider status check before returning.
  • Path parameters:
  • Query parameters:
Request example:
Success response — 200 OK:

PUT /2023-11/admin/campaign-templates/{campaignTemplate}

Update a campaign template. Pass ?resubmit=true to re-submit to the provider after updating.
  • Path parameters:
  • Query parameters:
  • Request body:
Request example:
Success response — 200 OK:

DELETE /2023-11/admin/campaign-templates/{campaignTemplate}

Soft-delete a single campaign template.
  • Path parameters:
Request example:
Success response — 204 No Content: Empty body.

Storefront Templates

Storefront themes/templates are visual design templates that can be associated with the company’s online shop. These are distinct from campaign message templates.

GET /2023-11/admin/templates

List available storefront templates.
  • Query parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/templates/apps/sync

Dispatch a background job to synchronize an external storefront template from a remote location.
  • Request body:
Request example:
Success response — 200 OK:

GET /2023-11/admin/templates/{template}

Get a single storefront template with its theme configurations.
  • Path parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/templates/{template}

Associate a storefront template with the company. Deactivates any other active theme configuration and registers the template’s domains with Caddy.
  • Path parameters:
Request body: None — no body required. The template to associate is identified by the path parameter; the company is resolved from the authenticated user’s session. Request example:
Success response — 200 OK:
Error responses:
  • 500 — Domain registration on the CDN/Caddy server failed

Email Connections

Email connections store the SMTP/API credentials used to send email campaigns and transactional messages.

GET /2023-11/admin/email-connections

List all email connections for the company, ordered by is_main then created_at descending. Request example:
Success response — 200 OK:
Note: credentials_enc is encrypted at rest and is never exposed in the response.

POST /2023-11/admin/email-connections

Create a new email connection. The first connection for the company is automatically set as the primary (is_main: true).
  • Request body:
SMTP credentials: Amazon SES credentials: Mailgun credentials: SendGrid credentials: Request example:
Success response — 201 Created:
Error responses:
  • 422 — Validation failure (e.g. invalid provider, missing credential fields)

PUT /2023-11/admin/email-connections/{emailConnection}

Update an email connection. Credentials are merged (not replaced) when provided.
  • Path parameters:
  • Request body: All fields optional (same as store, provider and credentials are sometimes).
Request example:
Success response — 200 OK:

DELETE /2023-11/admin/email-connections/{emailConnection}

Delete an email connection.
  • Path parameters:
Request example:
Success response — 204 No Content: Empty body.

POST /2023-11/admin/email-connections/{emailConnection}/set-main

Promote an email connection to primary. Atomically clears is_main on all other connections for the company.
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:

SMS Connections

SMS connections store credentials for third-party SMS providers. For smsgate providers, webhooks are registered asynchronously when the connection is created or credentials change.

GET /2023-11/admin/sms-connections

List all SMS connections for the company. Request example:
Success response — 200 OK:
Note: credentials_enc is encrypted at rest and never exposed in the response.

POST /2023-11/admin/sms-connections

Create a new SMS connection. Webhooks are registered asynchronously for smsgate provider.
  • Request body:
Request example:
Success response — 201 Created:

PUT /2023-11/admin/sms-connections/{smsConnection}

Update an SMS connection. Credentials are merged. If credentials change on a smsgate connection, webhooks are re-synced asynchronously.
  • Path parameters:
  • Request body: All fields optional.
Request example:
Success response — 200 OK:

DELETE /2023-11/admin/sms-connections/{smsConnection}

Delete an SMS connection. For smsgate, webhooks are removed asynchronously before deletion.
  • Path parameters:
Request example:
Success response — 204 No Content: Empty body.

POST /2023-11/admin/sms-connections/{smsConnection}/set-main

Promote an SMS connection to primary. Atomically clears is_main on all others.
  • Path parameters:
Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:

Web Push

POST /2023-11/admin/push/subscribe

Register a browser Web Push subscription for the authenticated user. Replaces any existing subscription at the same endpoint.
  • Request body:
Request example:
Success response — 200 OK:
Error responses:
  • 401 — No authenticated user
  • 422 — Validation failure

GET /2023-11/admin/push/subscriptions

List all active push subscriptions for the authenticated user. Request example:
Success response — 200 OK:

GET /2023-11/admin/push/test/info

Return debug information about the authenticated user’s push subscriptions. Request example:
Success response — 200 OK:

POST /2023-11/admin/push/test/send

Send a test Web Push notification to all of the authenticated user’s active subscriptions.
  • Request body: All fields optional.
Request example:
Success response — 200 OK:
Error responses:
  • 401 — No authenticated user
  • 404 — No push subscriptions found

POST /2023-11/admin/push/unsubscribe

Remove a Web Push subscription by endpoint.
  • Request body:
Request example:
Success response — 200 OK:

Notification Channels

Notification channels are specific contact points (email address, phone number, push endpoint) associated with a user or customer, used to route system notifications.

GET /2023-11/admin/notification-channels

List notification channels with optional filtering and pagination.
  • Query parameters:
Request example:
Success response — 200 OK:

POST /2023-11/admin/notification-channels

Add a notification channel for the authenticated user (or a specified user via user_id in the request).
  • Request body:
Request example:
Success response — 200 OK:

PUT /2023-11/admin/notification-channels/{notificationChannel}

Update a notification channel.
  • Path parameters:
  • Request body: No fields are currently processed — the controller method is a no-op stub. Send an empty body or omit it entirely.
Request example:
Success response — 200 OK:
Note: The controller method is currently a no-op stub and returns no body. The endpoint is registered but does not perform any update.

DELETE /2023-11/admin/notification-channels/{notificationChannel}

Delete a notification channel.
  • Path parameters:
Request example:
Success response — 200 OK:

Notification Preferences

Notification preferences control which system events trigger notifications for the authenticated user, and via which channels. Supported event values: order.new, shipping.new, payment.received, stock.alert, import.completed, import.failed, export.completed, export.failed, bill.due_reminder, order.payment_reminder, customer.birthdays_weekly.

GET /2023-11/admin/notification-preferences

List all notification preferences for the authenticated user. Request example:
Success response — 200 OK:

POST /2023-11/admin/notification-preferences/create

Create a notification preference. If a preference for the same (event, channel_id) pair already exists, it is updated instead.
  • Request body:
Request example:
Success response — 200 OK:
Error responses:
  • 422 — Invalid event value, non-existent channel_id, or missing enabled

POST /2023-11/admin/notification-preferences/initialize-defaults

Create default preferences (enabled) for every known event and every notification channel belonging to the authenticated user. Existing preferences are not overwritten. Request example: Request body: None — no body required for this action endpoint.
Success response — 200 OK:

PUT /2023-11/admin/notification-preferences/{preference}

Enable or disable a specific notification preference.
  • Path parameters:
  • Request body:
Request example:
Success response — 200 OK:
Error responses:
  • 403 — Preference belongs to another user (enforced by route-model binding scope)
  • 404 — Event type not recognized
  • 422 — Missing or invalid enabled field