Skip to main content

Design Builder API v2

Usageโ€‹

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.design.getAllDesigns(...)

Tree-shakeable importโ€‹

import { getClient, authorize } from '@epilot/sdk/design'

const designClient = getClient()
authorize(designClient, () => '<token>')
const { data } = await designClient.getAllDesigns(...)

Operationsโ€‹

design-builder

Schemas

getAllDesignsโ€‹

Scan all designs linked to a organization, based in orgId attribute from JWT auth token

GET /v1/designs

const { data } = await client.getAllDesigns()
Response
{
"designs": [
{
"id": "string",
"created_at": "2021-01-30T08:30:00Z",
"created_by": "string",
"edited": true,
"last_modified_at": "string",
"brand_id": "string",
"brand_name": "string",
"user": {},
"style_name": "string",
"style": {},
"is_default": true,
"_manifest": ["string"],
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {},
"version": 1,
"colors": {},
"typography": {},
"shape": {},
"components": {},
"assets": {},
"consumer": {}
}
]
}

addDesignโ€‹

Create a brand new design linked to a organization, based in orgId attribute from JWT auth token

POST /v1/designs

const { data } = await client.addDesign(
null,
{
design: {
brand_id: 'string',
brand_name: 'string',
user: {
emailaddress: 'string',
fullname: 'string',
name: 'string',
userid: 'string'
},
style_name: 'string',
style: {
logo: { /* ... */ },
palette: { /* ... */ },
typography: { /* ... */ },
shape: { /* ... */ },
consumer: { /* ... */ }
},
is_default: true,
_manifest: ['string'],
custom_theme: 'string',
use_custom_theme: true,
design_tokens: {
coupon: 'string',
cashback: 'string',
custom_css: 'string',
accent_color: 'string',
outline_color: 'string',
divider_color: 'string',
link_color: 'string',
link_hover_color: 'string',
font_size_scale: 'xs',
topbar_height: 0,
topbar_logo_alignment: 'flex-start',
logo_size: 0,
input_background: 'string',
input_border_color: 'string',
input_text_color: 'string',
input_label_color: 'string',
input_border_radius: 0,
input_height: 0,
input_variant: 'outlined',
button_primary_bg: 'string',
button_primary_text: 'string',
button_primary_hover_bg: 'string',
button_primary_hover_text: 'string',
button_outlined_border: 'string',
button_outlined_text: 'string',
button_outlined_hover_bg: 'string',
button_outlined_hover_text: 'string',
button_ghost_bg: 'string',
button_ghost_text: 'string',
button_ghost_hover_bg: 'string',
button_ghost_hover_text: 'string',
button_border_radius: 0,
button_height: 0,
card_background: 'string',
card_border_color: 'string',
card_variant: 'shadow',
summary_card_background: 'string',
toggle_selected_bg: 'string',
toggle_selected_text: 'string',
toggle_hover_bg: 'string',
toggle_hover_text: 'string',
toggle_border_color: 'string',
dropdown_hover_bg: 'string',
dropdown_hover_text: 'string',
dropdown_selected_bg: 'string',
dropdown_selected_text: 'string',
switch_unchecked_color: 'string',
switch_unchecked_bg: 'string',
switch_border_radius: 0,
checkbox_unchecked_color: 'string',
checkbox_label_color: 'string',
radio_unchecked_color: 'string',
radio_label_color: 'string',
datepicker_selected_bg: 'string',
datepicker_selected_color: 'string',
datepicker_border_radius: 0,
chip_background: 'string',
chip_hover_background: 'string',
chip_text_color: 'string',
chip_hover_text_color: 'string'
},
version: 1,
colors: {},
typography: {},
shape: {},
components: {},
assets: {},
consumer: {
widgets: [ /* ... */ ],
customer_portals: [ /* ... */ ]
}
}
},
)
Response
{
"design": {
"id": "string",
"created_at": "2021-01-30T08:30:00Z",
"created_by": "string",
"edited": true,
"last_modified_at": "string",
"brand_id": "string",
"brand_name": "string",
"user": {
"emailaddress": "string",
"fullname": "string",
"name": "string",
"userid": "string"
},
"style_name": "string",
"style": {
"logo": {},
"palette": {},
"typography": {},
"shape": {},
"consumer": {}
},
"is_default": true,
"_manifest": ["string"],
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string",
"accent_color": "string",
"outline_color": "string",
"divider_color": "string",
"link_color": "string",
"link_hover_color": "string",
"font_size_scale": "xs",
"topbar_height": 0,
"topbar_logo_alignment": "flex-start",
"logo_size": 0,
"input_background": "string",
"input_border_color": "string",
"input_text_color": "string",
"input_label_color": "string",
"input_border_radius": 0,
"input_height": 0,
"input_variant": "outlined",
"button_primary_bg": "string",
"button_primary_text": "string",
"button_primary_hover_bg": "string",
"button_primary_hover_text": "string",
"button_outlined_border": "string",
"button_outlined_text": "string",
"button_outlined_hover_bg": "string",
"button_outlined_hover_text": "string",
"button_ghost_bg": "string",
"button_ghost_text": "string",
"button_ghost_hover_bg": "string",
"button_ghost_hover_text": "string",
"button_border_radius": 0,
"button_height": 0,
"card_background": "string",
"card_border_color": "string",
"card_variant": "shadow",
"summary_card_background": "string",
"toggle_selected_bg": "string",
"toggle_selected_text": "string",
"toggle_hover_bg": "string",
"toggle_hover_text": "string",
"toggle_border_color": "string",
"dropdown_hover_bg": "string",
"dropdown_hover_text": "string",
"dropdown_selected_bg": "string",
"dropdown_selected_text": "string",
"switch_unchecked_color": "string",
"switch_unchecked_bg": "string",
"switch_border_radius": 0,
"checkbox_unchecked_color": "string",
"checkbox_label_color": "string",
"radio_unchecked_color": "string",
"radio_label_color": "string",
"datepicker_selected_bg": "string",
"datepicker_selected_color": "string",
"datepicker_border_radius": 0,
"chip_background": "string",
"chip_hover_background": "string",
"chip_text_color": "string",
"chip_hover_text_color": "string"
},
"version": 1,
"colors": {},
"typography": {},
"shape": {},
"components": {},
"assets": {},
"consumer": {
"widgets": [],
"customer_portals": []
}
}
}

getDesignโ€‹

Search for a especific design owned by user organization

GET /v1/designs/{designId}

const { data } = await client.getDesign({
designId: 'example',
})
Response
{
"design": {
"id": "string",
"created_at": "2021-01-30T08:30:00Z",
"created_by": "string",
"edited": true,
"last_modified_at": "string",
"brand_id": "string",
"brand_name": "string",
"user": {
"emailaddress": "string",
"fullname": "string",
"name": "string",
"userid": "string"
},
"style_name": "string",
"style": {
"logo": {},
"palette": {},
"typography": {},
"shape": {},
"consumer": {}
},
"is_default": true,
"_manifest": ["string"],
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string",
"accent_color": "string",
"outline_color": "string",
"divider_color": "string",
"link_color": "string",
"link_hover_color": "string",
"font_size_scale": "xs",
"topbar_height": 0,
"topbar_logo_alignment": "flex-start",
"logo_size": 0,
"input_background": "string",
"input_border_color": "string",
"input_text_color": "string",
"input_label_color": "string",
"input_border_radius": 0,
"input_height": 0,
"input_variant": "outlined",
"button_primary_bg": "string",
"button_primary_text": "string",
"button_primary_hover_bg": "string",
"button_primary_hover_text": "string",
"button_outlined_border": "string",
"button_outlined_text": "string",
"button_outlined_hover_bg": "string",
"button_outlined_hover_text": "string",
"button_ghost_bg": "string",
"button_ghost_text": "string",
"button_ghost_hover_bg": "string",
"button_ghost_hover_text": "string",
"button_border_radius": 0,
"button_height": 0,
"card_background": "string",
"card_border_color": "string",
"card_variant": "shadow",
"summary_card_background": "string",
"toggle_selected_bg": "string",
"toggle_selected_text": "string",
"toggle_hover_bg": "string",
"toggle_hover_text": "string",
"toggle_border_color": "string",
"dropdown_hover_bg": "string",
"dropdown_hover_text": "string",
"dropdown_selected_bg": "string",
"dropdown_selected_text": "string",
"switch_unchecked_color": "string",
"switch_unchecked_bg": "string",
"switch_border_radius": 0,
"checkbox_unchecked_color": "string",
"checkbox_label_color": "string",
"radio_unchecked_color": "string",
"radio_label_color": "string",
"datepicker_selected_bg": "string",
"datepicker_selected_color": "string",
"datepicker_border_radius": 0,
"chip_background": "string",
"chip_hover_background": "string",
"chip_text_color": "string",
"chip_hover_text_color": "string"
},
"version": 1,
"colors": {},
"typography": {},
"shape": {},
"components": {},
"assets": {},
"consumer": {
"widgets": [],
"customer_portals": []
}
}
}

deleteDesignโ€‹

Search and delete for a especific design owned by user organization

DELETE /v1/designs/{designId}

const { data } = await client.deleteDesign({
designId: 'example',
})

updateDesignโ€‹

Update a especific design owned by user organization. A body with version: 1 is validated against the design document v1 schema and stored as v1. A v1 body leaves the stored style, design_tokens

PUT /v1/designs/{designId}

const { data } = await client.updateDesign(
{
designId: 'example',
If-Match: 'example',
},
{
design: {
brand_id: 'string',
brand_name: 'string',
user: {
emailaddress: 'string',
fullname: 'string',
name: 'string',
userid: 'string'
},
style_name: 'string',
style: {
logo: { /* ... */ },
palette: { /* ... */ },
typography: { /* ... */ },
shape: { /* ... */ },
consumer: { /* ... */ }
},
is_default: true,
_manifest: ['string'],
custom_theme: 'string',
use_custom_theme: true,
design_tokens: {
coupon: 'string',
cashback: 'string',
custom_css: 'string',
accent_color: 'string',
outline_color: 'string',
divider_color: 'string',
link_color: 'string',
link_hover_color: 'string',
font_size_scale: 'xs',
topbar_height: 0,
topbar_logo_alignment: 'flex-start',
logo_size: 0,
input_background: 'string',
input_border_color: 'string',
input_text_color: 'string',
input_label_color: 'string',
input_border_radius: 0,
input_height: 0,
input_variant: 'outlined',
button_primary_bg: 'string',
button_primary_text: 'string',
button_primary_hover_bg: 'string',
button_primary_hover_text: 'string',
button_outlined_border: 'string',
button_outlined_text: 'string',
button_outlined_hover_bg: 'string',
button_outlined_hover_text: 'string',
button_ghost_bg: 'string',
button_ghost_text: 'string',
button_ghost_hover_bg: 'string',
button_ghost_hover_text: 'string',
button_border_radius: 0,
button_height: 0,
card_background: 'string',
card_border_color: 'string',
card_variant: 'shadow',
summary_card_background: 'string',
toggle_selected_bg: 'string',
toggle_selected_text: 'string',
toggle_hover_bg: 'string',
toggle_hover_text: 'string',
toggle_border_color: 'string',
dropdown_hover_bg: 'string',
dropdown_hover_text: 'string',
dropdown_selected_bg: 'string',
dropdown_selected_text: 'string',
switch_unchecked_color: 'string',
switch_unchecked_bg: 'string',
switch_border_radius: 0,
checkbox_unchecked_color: 'string',
checkbox_label_color: 'string',
radio_unchecked_color: 'string',
radio_label_color: 'string',
datepicker_selected_bg: 'string',
datepicker_selected_color: 'string',
datepicker_border_radius: 0,
chip_background: 'string',
chip_hover_background: 'string',
chip_text_color: 'string',
chip_hover_text_color: 'string'
},
version: 1,
colors: {},
typography: {},
shape: {},
components: {},
assets: {},
consumer: {
widgets: [ /* ... */ ],
customer_portals: [ /* ... */ ]
}
}
},
)

duplicateDesignโ€‹

Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design

POST /v1/designs/{designId}/duplicate

const { data } = await client.duplicateDesign({
designId: 'example',
})
Response
{
"design": {
"id": "string",
"created_at": "2021-01-30T08:30:00Z",
"created_by": "string",
"edited": true,
"last_modified_at": "string",
"brand_id": "string",
"brand_name": "string",
"user": {
"emailaddress": "string",
"fullname": "string",
"name": "string",
"userid": "string"
},
"style_name": "string",
"style": {
"logo": {},
"palette": {},
"typography": {},
"shape": {},
"consumer": {}
},
"is_default": true,
"_manifest": ["string"],
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string",
"accent_color": "string",
"outline_color": "string",
"divider_color": "string",
"link_color": "string",
"link_hover_color": "string",
"font_size_scale": "xs",
"topbar_height": 0,
"topbar_logo_alignment": "flex-start",
"logo_size": 0,
"input_background": "string",
"input_border_color": "string",
"input_text_color": "string",
"input_label_color": "string",
"input_border_radius": 0,
"input_height": 0,
"input_variant": "outlined",
"button_primary_bg": "string",
"button_primary_text": "string",
"button_primary_hover_bg": "string",
"button_primary_hover_text": "string",
"button_outlined_border": "string",
"button_outlined_text": "string",
"button_outlined_hover_bg": "string",
"button_outlined_hover_text": "string",
"button_ghost_bg": "string",
"button_ghost_text": "string",
"button_ghost_hover_bg": "string",
"button_ghost_hover_text": "string",
"button_border_radius": 0,
"button_height": 0,
"card_background": "string",
"card_border_color": "string",
"card_variant": "shadow",
"summary_card_background": "string",
"toggle_selected_bg": "string",
"toggle_selected_text": "string",
"toggle_hover_bg": "string",
"toggle_hover_text": "string",
"toggle_border_color": "string",
"dropdown_hover_bg": "string",
"dropdown_hover_text": "string",
"dropdown_selected_bg": "string",
"dropdown_selected_text": "string",
"switch_unchecked_color": "string",
"switch_unchecked_bg": "string",
"switch_border_radius": 0,
"checkbox_unchecked_color": "string",
"checkbox_label_color": "string",
"radio_unchecked_color": "string",
"radio_label_color": "string",
"datepicker_selected_bg": "string",
"datepicker_selected_color": "string",
"datepicker_border_radius": 0,
"chip_background": "string",
"chip_hover_background": "string",
"chip_text_color": "string",
"chip_hover_text_color": "string"
},
"version": 1,
"colors": {},
"typography": {},
"shape": {},
"components": {},
"assets": {},
"consumer": {
"widgets": [],
"customer_portals": []
}
}
}

generateDesignโ€‹

Generates a design (palette, text colours, font, logo and border radius) from a public website with AI. The result is cached per organization and URL for 30 days.

POST /v1/designs/generate

const { data } = await client.generateDesign(
null,
{
url: 'https://www.twl.de'
},
)
Response
{
"design": {
"style": {
"logo": {
"main": {
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "string",
"file_id": "string"
}
},
"palette": {
"primary": "string",
"secondary": "string",
"error": "string",
"background": "string",
"paper": "string",
"navbar": "string",
"portal_login_background": "string"
},
"typography": {
"font": {
"font_id": "string",
"font_name": "string",
"font_family": "string",
"font_weight_regular": "string",
"font_weight_medium": "string",
"font_weight_bold": "string",
"urls": [
{
"type": "WOFF2",
"url": "string"
}
]
},
"primary": "string",
"secondary": "string"
}
},
"theme": {
"shape": {
"borderRadius": "8"
}
}
},
"cached": true
}

generateDesignDocumentโ€‹

Reads a public website and returns a v1 design document plus one finding for each id in fixed order. This version chooses the favicon in code and derives the site name. The other findings are `not_fou

POST /v1/designs/document/generate

const { data } = await client.generateDesignDocument(
null,
{
url: 'https://www.stadtwerke-musterstadt.de'
},
)
Response
{
"document": {
"version": 1,
"colors": {},
"typography": {},
"shape": {},
"components": {},
"assets": {},
"consumer": {
"widgets": [
{
"id": "string",
"name": "string"
}
],
"customer_portals": [
{
"id": "string",
"name": "string"
}
]
}
},
"findings": [
{
"id": "primary_color",
"status": "found",
"detail": {
"family": "string"
}
},
{
"id": "primary_color",
"status": "found",
"detail": {
"family": "string"
}
}
],
"site_name": "Stadtwerke Musterstadt",
"cached": true
}

uploadFileโ€‹

Upload a new file for the user organization bucket

POST /v1/designs/files

const { data } = await client.uploadFile()
Response
{
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "string",
"file_id": "string"
}

getFilesโ€‹

List all files for the user organization bucket

GET /v1/designs/files

const { data } = await client.getFiles({
type: 'example',
})
Response
[
{
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "string",
"file_id": "string"
}
]

getConsumerDesignโ€‹

Search for a especific design owned by user organization

GET /v1/designs/consumer/{application}/{consumerId}

const { data } = await client.getConsumerDesign({
consumerId: 'example',
application: 'example',
})
Response
{
"design": {
"id": "string",
"created_at": "2021-01-30T08:30:00Z",
"created_by": "string",
"edited": true,
"last_modified_at": "string",
"brand_id": "string",
"brand_name": "string",
"user": {
"emailaddress": "string",
"fullname": "string",
"name": "string",
"userid": "string"
},
"style_name": "string",
"style": {
"logo": {},
"palette": {},
"typography": {},
"shape": {},
"consumer": {}
},
"is_default": true,
"_manifest": ["string"],
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string",
"accent_color": "string",
"outline_color": "string",
"divider_color": "string",
"link_color": "string",
"link_hover_color": "string",
"font_size_scale": "xs",
"topbar_height": 0,
"topbar_logo_alignment": "flex-start",
"logo_size": 0,
"input_background": "string",
"input_border_color": "string",
"input_text_color": "string",
"input_label_color": "string",
"input_border_radius": 0,
"input_height": 0,
"input_variant": "outlined",
"button_primary_bg": "string",
"button_primary_text": "string",
"button_primary_hover_bg": "string",
"button_primary_hover_text": "string",
"button_outlined_border": "string",
"button_outlined_text": "string",
"button_outlined_hover_bg": "string",
"button_outlined_hover_text": "string",
"button_ghost_bg": "string",
"button_ghost_text": "string",
"button_ghost_hover_bg": "string",
"button_ghost_hover_text": "string",
"button_border_radius": 0,
"button_height": 0,
"card_background": "string",
"card_border_color": "string",
"card_variant": "shadow",
"summary_card_background": "string",
"toggle_selected_bg": "string",
"toggle_selected_text": "string",
"toggle_hover_bg": "string",
"toggle_hover_text": "string",
"toggle_border_color": "string",
"dropdown_hover_bg": "string",
"dropdown_hover_text": "string",
"dropdown_selected_bg": "string",
"dropdown_selected_text": "string",
"switch_unchecked_color": "string",
"switch_unchecked_bg": "string",
"switch_border_radius": 0,
"checkbox_unchecked_color": "string",
"checkbox_label_color": "string",
"radio_unchecked_color": "string",
"radio_label_color": "string",
"datepicker_selected_bg": "string",
"datepicker_selected_color": "string",
"datepicker_border_radius": 0,
"chip_background": "string",
"chip_hover_background": "string",
"chip_text_color": "string",
"chip_hover_text_color": "string"
},
"version": 1,
"colors": {},
"typography": {},
"shape": {},
"components": {},
"assets": {},
"consumer": {
"widgets": [],
"customer_portals": []
}
}
}

Schemasโ€‹

UploadFileReqโ€‹

type UploadFileReq = {
file_type: "LOGO" | "FONT" | "IMAGE"
file_data: string // base64
display_name?: string
file_name: string
}

UploadFileResโ€‹

type UploadFileRes = {
name: string
display_name?: string
file_type?: "LOGO" | "FONT" | "IMAGE"
s3_object_key: string
url: string
file_id?: string
}

GetFilesResโ€‹

type GetFilesRes = Array<{
name: string
display_name?: string
file_type?: "LOGO" | "FONT" | "IMAGE"
s3_object_key: string
url: string
file_id?: string
}>

GetAllDesignsResโ€‹

type GetAllDesignsRes = {
designs?: Array<{
id?: string
created_at?: string
created_by?: string
edited: boolean
last_modified_at?: string
brand_id?: string
brand_name?: string
user?: {
emailaddress?: { ... }
fullname?: { ... }
name?: { ... }
userid?: { ... }
}
style_name: string
style: {
logo?: { ... }
palette: { ... }
typography: { ... }
shape?: { ... }
consumer: { ... }
}
is_default?: boolean
_manifest?: string[]
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
accent_color?: { ... }
outline_color?: { ... }
divider_color?: { ... }
link_color?: { ... }
link_hover_color?: { ... }
font_size_scale?: { ... }
topbar_height?: { ... }
topbar_logo_alignment?: { ... }
logo_size?: { ... }
input_background?: { ... }
input_border_color?: { ... }
input_text_color?: { ... }
input_label_color?: { ... }
input_border_radius?: { ... }
input_height?: { ... }
input_variant?: { ... }
button_primary_bg?: { ... }
button_primary_text?: { ... }
button_primary_hover_bg?: { ... }
button_primary_hover_text?: { ... }
button_outlined_border?: { ... }
button_outlined_text?: { ... }
button_outlined_hover_bg?: { ... }
button_outlined_hover_text?: { ... }
button_ghost_bg?: { ... }
button_ghost_text?: { ... }
button_ghost_hover_bg?: { ... }
button_ghost_hover_text?: { ... }
button_border_radius?: { ... }
button_height?: { ... }
card_background?: { ... }
card_border_color?: { ... }
card_variant?: { ... }
summary_card_background?: { ... }
toggle_selected_bg?: { ... }
toggle_selected_text?: { ... }
toggle_hover_bg?: { ... }
toggle_hover_text?: { ... }
toggle_border_color?: { ... }
dropdown_hover_bg?: { ... }
dropdown_hover_text?: { ... }
dropdown_selected_bg?: { ... }
dropdown_selected_text?: { ... }
switch_unchecked_color?: { ... }
switch_unchecked_bg?: { ... }
switch_border_radius?: { ... }
checkbox_unchecked_color?: { ... }
checkbox_label_color?: { ... }
radio_unchecked_color?: { ... }
radio_label_color?: { ... }
datepicker_selected_bg?: { ... }
datepicker_selected_color?: { ... }
datepicker_border_radius?: { ... }
chip_background?: { ... }
chip_hover_background?: { ... }
chip_text_color?: { ... }
chip_hover_text_color?: { ... }
}
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
}>
// ...
}

AddDesignReqโ€‹

type AddDesignReq = {
design: {
brand_id?: string
brand_name?: string
user?: {
emailaddress?: { ... }
fullname?: { ... }
name?: { ... }
userid?: { ... }
}
style_name: string
style: {
logo?: { ... }
palette: { ... }
typography: { ... }
shape?: { ... }
consumer: { ... }
}
is_default?: boolean
_manifest?: string[]
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
accent_color?: { ... }
outline_color?: { ... }
divider_color?: { ... }
link_color?: { ... }
link_hover_color?: { ... }
font_size_scale?: { ... }
topbar_height?: { ... }
topbar_logo_alignment?: { ... }
logo_size?: { ... }
input_background?: { ... }
input_border_color?: { ... }
input_text_color?: { ... }
input_label_color?: { ... }
input_border_radius?: { ... }
input_height?: { ... }
input_variant?: { ... }
button_primary_bg?: { ... }
button_primary_text?: { ... }
button_primary_hover_bg?: { ... }
button_primary_hover_text?: { ... }
button_outlined_border?: { ... }
button_outlined_text?: { ... }
button_outlined_hover_bg?: { ... }
button_outlined_hover_text?: { ... }
button_ghost_bg?: { ... }
button_ghost_text?: { ... }
button_ghost_hover_bg?: { ... }
button_ghost_hover_text?: { ... }
button_border_radius?: { ... }
button_height?: { ... }
card_background?: { ... }
card_border_color?: { ... }
card_variant?: { ... }
summary_card_background?: { ... }
toggle_selected_bg?: { ... }
toggle_selected_text?: { ... }
toggle_hover_bg?: { ... }
toggle_hover_text?: { ... }
toggle_border_color?: { ... }
dropdown_hover_bg?: { ... }
dropdown_hover_text?: { ... }
dropdown_selected_bg?: { ... }
dropdown_selected_text?: { ... }
switch_unchecked_color?: { ... }
switch_unchecked_bg?: { ... }
switch_border_radius?: { ... }
checkbox_unchecked_color?: { ... }
checkbox_label_color?: { ... }
radio_unchecked_color?: { ... }
radio_label_color?: { ... }
datepicker_selected_bg?: { ... }
datepicker_selected_color?: { ... }
datepicker_border_radius?: { ... }
chip_background?: { ... }
chip_hover_background?: { ... }
chip_text_color?: { ... }
chip_hover_text_color?: { ... }
}
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
}
}

AddDesignResโ€‹

type AddDesignRes = {
design?: {
id?: string
created_at?: string
created_by?: string
edited: boolean
last_modified_at?: string
brand_id?: string
brand_name?: string
user?: {
emailaddress?: { ... }
fullname?: { ... }
name?: { ... }
userid?: { ... }
}
style_name: string
style: {
logo?: { ... }
palette: { ... }
typography: { ... }
shape?: { ... }
consumer: { ... }
}
is_default?: boolean
_manifest?: string[]
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
accent_color?: { ... }
outline_color?: { ... }
divider_color?: { ... }
link_color?: { ... }
link_hover_color?: { ... }
font_size_scale?: { ... }
topbar_height?: { ... }
topbar_logo_alignment?: { ... }
logo_size?: { ... }
input_background?: { ... }
input_border_color?: { ... }
input_text_color?: { ... }
input_label_color?: { ... }
input_border_radius?: { ... }
input_height?: { ... }
input_variant?: { ... }
button_primary_bg?: { ... }
button_primary_text?: { ... }
button_primary_hover_bg?: { ... }
button_primary_hover_text?: { ... }
button_outlined_border?: { ... }
button_outlined_text?: { ... }
button_outlined_hover_bg?: { ... }
button_outlined_hover_text?: { ... }
button_ghost_bg?: { ... }
button_ghost_text?: { ... }
button_ghost_hover_bg?: { ... }
button_ghost_hover_text?: { ... }
button_border_radius?: { ... }
button_height?: { ... }
card_background?: { ... }
card_border_color?: { ... }
card_variant?: { ... }
summary_card_background?: { ... }
toggle_selected_bg?: { ... }
toggle_selected_text?: { ... }
toggle_hover_bg?: { ... }
toggle_hover_text?: { ... }
toggle_border_color?: { ... }
dropdown_hover_bg?: { ... }
dropdown_hover_text?: { ... }
dropdown_selected_bg?: { ... }
dropdown_selected_text?: { ... }
switch_unchecked_color?: { ... }
switch_unchecked_bg?: { ... }
switch_border_radius?: { ... }
checkbox_unchecked_color?: { ... }
checkbox_label_color?: { ... }
radio_unchecked_color?: { ... }
radio_label_color?: { ... }
datepicker_selected_bg?: { ... }
datepicker_selected_color?: { ... }
datepicker_border_radius?: { ... }
chip_background?: { ... }
chip_hover_background?: { ... }
chip_text_color?: { ... }
chip_hover_text_color?: { ... }
}
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
}
// ...
}

GetDesignResโ€‹

type GetDesignRes = {
design?: {
id?: string
created_at?: string
created_by?: string
edited: boolean
last_modified_at?: string
brand_id?: string
brand_name?: string
user?: {
emailaddress?: { ... }
fullname?: { ... }
name?: { ... }
userid?: { ... }
}
style_name: string
style: {
logo?: { ... }
palette: { ... }
typography: { ... }
shape?: { ... }
consumer: { ... }
}
is_default?: boolean
_manifest?: string[]
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
accent_color?: { ... }
outline_color?: { ... }
divider_color?: { ... }
link_color?: { ... }
link_hover_color?: { ... }
font_size_scale?: { ... }
topbar_height?: { ... }
topbar_logo_alignment?: { ... }
logo_size?: { ... }
input_background?: { ... }
input_border_color?: { ... }
input_text_color?: { ... }
input_label_color?: { ... }
input_border_radius?: { ... }
input_height?: { ... }
input_variant?: { ... }
button_primary_bg?: { ... }
button_primary_text?: { ... }
button_primary_hover_bg?: { ... }
button_primary_hover_text?: { ... }
button_outlined_border?: { ... }
button_outlined_text?: { ... }
button_outlined_hover_bg?: { ... }
button_outlined_hover_text?: { ... }
button_ghost_bg?: { ... }
button_ghost_text?: { ... }
button_ghost_hover_bg?: { ... }
button_ghost_hover_text?: { ... }
button_border_radius?: { ... }
button_height?: { ... }
card_background?: { ... }
card_border_color?: { ... }
card_variant?: { ... }
summary_card_background?: { ... }
toggle_selected_bg?: { ... }
toggle_selected_text?: { ... }
toggle_hover_bg?: { ... }
toggle_hover_text?: { ... }
toggle_border_color?: { ... }
dropdown_hover_bg?: { ... }
dropdown_hover_text?: { ... }
dropdown_selected_bg?: { ... }
dropdown_selected_text?: { ... }
switch_unchecked_color?: { ... }
switch_unchecked_bg?: { ... }
switch_border_radius?: { ... }
checkbox_unchecked_color?: { ... }
checkbox_label_color?: { ... }
radio_unchecked_color?: { ... }
radio_label_color?: { ... }
datepicker_selected_bg?: { ... }
datepicker_selected_color?: { ... }
datepicker_border_radius?: { ... }
chip_background?: { ... }
chip_hover_background?: { ... }
chip_text_color?: { ... }
chip_hover_text_color?: { ... }
}
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
}
// ...
}

UpdateDesignReqโ€‹

type UpdateDesignReq = {
design: {
brand_id?: string
brand_name?: string
user?: {
emailaddress?: { ... }
fullname?: { ... }
name?: { ... }
userid?: { ... }
}
style_name: string
style: {
logo?: { ... }
palette: { ... }
typography: { ... }
shape?: { ... }
consumer: { ... }
}
is_default?: boolean
_manifest?: string[]
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
accent_color?: { ... }
outline_color?: { ... }
divider_color?: { ... }
link_color?: { ... }
link_hover_color?: { ... }
font_size_scale?: { ... }
topbar_height?: { ... }
topbar_logo_alignment?: { ... }
logo_size?: { ... }
input_background?: { ... }
input_border_color?: { ... }
input_text_color?: { ... }
input_label_color?: { ... }
input_border_radius?: { ... }
input_height?: { ... }
input_variant?: { ... }
button_primary_bg?: { ... }
button_primary_text?: { ... }
button_primary_hover_bg?: { ... }
button_primary_hover_text?: { ... }
button_outlined_border?: { ... }
button_outlined_text?: { ... }
button_outlined_hover_bg?: { ... }
button_outlined_hover_text?: { ... }
button_ghost_bg?: { ... }
button_ghost_text?: { ... }
button_ghost_hover_bg?: { ... }
button_ghost_hover_text?: { ... }
button_border_radius?: { ... }
button_height?: { ... }
card_background?: { ... }
card_border_color?: { ... }
card_variant?: { ... }
summary_card_background?: { ... }
toggle_selected_bg?: { ... }
toggle_selected_text?: { ... }
toggle_hover_bg?: { ... }
toggle_hover_text?: { ... }
toggle_border_color?: { ... }
dropdown_hover_bg?: { ... }
dropdown_hover_text?: { ... }
dropdown_selected_bg?: { ... }
dropdown_selected_text?: { ... }
switch_unchecked_color?: { ... }
switch_unchecked_bg?: { ... }
switch_border_radius?: { ... }
checkbox_unchecked_color?: { ... }
checkbox_label_color?: { ... }
radio_unchecked_color?: { ... }
radio_label_color?: { ... }
datepicker_selected_bg?: { ... }
datepicker_selected_color?: { ... }
datepicker_border_radius?: { ... }
chip_background?: { ... }
chip_hover_background?: { ... }
chip_text_color?: { ... }
chip_hover_text_color?: { ... }
}
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
}
}

ItemMetadaโ€‹

type ItemMetada = {
id?: string
created_at?: string
created_by?: string
edited?: boolean
last_modified_at?: string
}

AddConsumerReqโ€‹

type AddConsumerReq = {
consumer_id: string
consumer_name: string
}

RemoveConsumerReqโ€‹

type RemoveConsumerReq = {
consumer_id: string
}

DesignItemโ€‹

type DesignItem = {
brand_id?: string
brand_name?: string
user?: {
emailaddress?: string
fullname?: string
name?: string
userid?: string
}
style_name: string
style: {
logo?: {
main?: { ... }
}
palette: {
primary: { ... }
secondary: { ... }
error: { ... }
background: { ... }
paper: { ... }
navbar: { ... }
portal_login_background?: { ... }
}
typography: {
font: { ... }
primary: { ... }
secondary: { ... }
}
shape?: {
border_radius?: { ... }
}
consumer: {
widgets: { ... }
customer_portals: { ... }
}
}
is_default?: boolean
_manifest?: string[]
}

Design_Document_V1โ€‹

Groups of the design document v1. A design is v1 when version is 1, otherwise it is the old shape (style, design_tokens, custom_theme). The authoritative contract for the groups is the schema exported by @epilot/design-document. A v1 design keeps style, design_tokens, custom_theme and

type Design_Document_V1 = {
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: Array<{
id: { ... }
name: { ... }
}>
customer_portals: Array<{
id: { ... }
name: { ... }
}>
}
}

UpdateDesignConflictโ€‹

type UpdateDesignConflict = {
message?: string
design?: {
id?: string
created_at?: string
created_by?: string
edited: boolean
last_modified_at?: string
brand_id?: string
brand_name?: string
user?: {
emailaddress?: { ... }
fullname?: { ... }
name?: { ... }
userid?: { ... }
}
style_name: string
style: {
logo?: { ... }
palette: { ... }
typography: { ... }
shape?: { ... }
consumer: { ... }
}
is_default?: boolean
_manifest?: string[]
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
accent_color?: { ... }
outline_color?: { ... }
divider_color?: { ... }
link_color?: { ... }
link_hover_color?: { ... }
font_size_scale?: { ... }
topbar_height?: { ... }
topbar_logo_alignment?: { ... }
logo_size?: { ... }
input_background?: { ... }
input_border_color?: { ... }
input_text_color?: { ... }
input_label_color?: { ... }
input_border_radius?: { ... }
input_height?: { ... }
input_variant?: { ... }
button_primary_bg?: { ... }
button_primary_text?: { ... }
button_primary_hover_bg?: { ... }
button_primary_hover_text?: { ... }
button_outlined_border?: { ... }
button_outlined_text?: { ... }
button_outlined_hover_bg?: { ... }
button_outlined_hover_text?: { ... }
button_ghost_bg?: { ... }
button_ghost_text?: { ... }
button_ghost_hover_bg?: { ... }
button_ghost_hover_text?: { ... }
button_border_radius?: { ... }
button_height?: { ... }
card_background?: { ... }
card_border_color?: { ... }
card_variant?: { ... }
summary_card_background?: { ... }
toggle_selected_bg?: { ... }
toggle_selected_text?: { ... }
toggle_hover_bg?: { ... }
toggle_hover_text?: { ... }
toggle_border_color?: { ... }
dropdown_hover_bg?: { ... }
dropdown_hover_text?: { ... }
dropdown_selected_bg?: { ... }
dropdown_selected_text?: { ... }
switch_unchecked_color?: { ... }
switch_unchecked_bg?: { ... }
switch_border_radius?: { ... }
checkbox_unchecked_color?: { ... }
checkbox_label_color?: { ... }
radio_unchecked_color?: { ... }
radio_label_color?: { ... }
datepicker_selected_bg?: { ... }
datepicker_selected_color?: { ... }
datepicker_border_radius?: { ... }
chip_background?: { ... }
chip_hover_background?: { ... }
chip_text_color?: { ... }
chip_hover_text_color?: { ... }
}
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
// ...
}

Custom_Styleโ€‹

type Custom_Style = {
custom_theme?: string
use_custom_theme?: boolean
}

Journeyโ€‹

type Journey = {
design_tokens?: {
coupon?: string
cashback?: string
custom_css?: string
accent_color?: string
outline_color?: string
divider_color?: string
link_color?: string
link_hover_color?: string
font_size_scale?: "xs" | "sm" | "md" | "lg" | "xl"
topbar_height?: number
topbar_logo_alignment?: "flex-start" | "center" | "flex-end"
logo_size?: number
input_background?: string
input_border_color?: string
input_text_color?: string
input_label_color?: string
input_border_radius?: number
input_height?: number
input_variant?: "outlined" | "filled" | "underlined"
button_primary_bg?: string
button_primary_text?: string
button_primary_hover_bg?: string
button_primary_hover_text?: string
button_outlined_border?: string
button_outlined_text?: string
button_outlined_hover_bg?: string
button_outlined_hover_text?: string
button_ghost_bg?: string
button_ghost_text?: string
button_ghost_hover_bg?: string
button_ghost_hover_text?: string
button_border_radius?: number
button_height?: number
card_background?: string
card_border_color?: string
card_variant?: "shadow" | "outlined"
summary_card_background?: string
toggle_selected_bg?: string
toggle_selected_text?: string
toggle_hover_bg?: string
toggle_hover_text?: string
toggle_border_color?: string
dropdown_hover_bg?: string
dropdown_hover_text?: string
dropdown_selected_bg?: string
dropdown_selected_text?: string
switch_unchecked_color?: string
switch_unchecked_bg?: string
switch_border_radius?: number
checkbox_unchecked_color?: string
checkbox_label_color?: string
radio_unchecked_color?: string
radio_label_color?: string
datepicker_selected_bg?: string
datepicker_selected_color?: string
datepicker_border_radius?: number
chip_background?: string
chip_hover_background?: string
chip_text_color?: string
chip_hover_text_color?: string
}
}

ConsumerDataโ€‹

type ConsumerData = {
widgets: Array<{
id: string
name: string
}>
customer_portals: Array<{
id: string
name: string
}>
}

WidgetDataโ€‹

type WidgetData = {
id: string
name: string
}

CustomerPortalDataโ€‹

type CustomerPortalData = {
id: string
name: string
}

LogoDataโ€‹

type LogoData = {
main?: {
name: string
display_name?: string
file_type?: "LOGO" | "FONT" | "IMAGE"
s3_object_key: string
url: string
file_id?: string
}
}

PaletteDataโ€‹

type PaletteData = {
primary: string
secondary: string
error: string
background: string
paper: string
navbar: string
portal_login_background?: string
}

TypographyDataโ€‹

type TypographyData = {
font: {
font_id: string
font_name: string
font_family?: string
font_weight_regular?: string
font_weight_medium?: string
font_weight_bold?: string
urls: Array<{
type?: { ... }
url?: { ... }
}>
}
primary: string
secondary: string
}

ShapeDataโ€‹

type ShapeData = {
border_radius?: number
}

FontDataโ€‹

type FontData = {
font_id: string
font_name: string
font_family?: string
font_weight_regular?: string
font_weight_medium?: string
font_weight_bold?: string
urls: Array<{
type?: "WOFF2" | "WOFF" | "TTF" | "EOT"
url?: string
}>
}

FontResponseUrlโ€‹

type FontResponseUrl = {
type?: "WOFF2" | "WOFF" | "TTF" | "EOT"
url?: string
}

WidgetPortalDataโ€‹

type WidgetPortalData = {
id: string
name: string
}

GenerateDesignReqโ€‹

type GenerateDesignReq = {
url: string // uri
}

GenerateDesignResโ€‹

type GenerateDesignRes = {
design: {
style: {
logo: { ... }
palette: { ... }
typography: { ... }
}
theme: {
shape: { ... }
}
}
cached: boolean
}

GenerateDesignDocumentReqโ€‹

type GenerateDesignDocumentReq = {
url: string // uri
}

FindingIdโ€‹

type FindingId = "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon"

FindingStatusโ€‹

type FindingStatus = "found" | "not_found" | "not_available"

FindingDetailโ€‹

type FindingDetail = {
family: string
}

DesignFindingโ€‹

type DesignFinding = {
id: "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon"
status: "found" | "not_found" | "not_available"
detail?: {
family: string
}
}

GenerateDesignDocumentResโ€‹

type GenerateDesignDocumentRes = {
document: {
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
consumer?: {
widgets: { ... }
customer_portals: { ... }
}
}
findings: Array<{
id: "primary_color" | "fonts" | "corners" | "primary_button" | "logo" | "favicon"
status: "found" | "not_found" | "not_available"
detail?: {
family: { ... }
}
}>
site_name: string
cached: boolean
}

GeneratedDesignโ€‹

Partial design to merge into the design being edited

type GeneratedDesign = {
style: {
logo: {
main?: { ... }
}
palette: {
primary: { ... }
secondary: { ... }
error: { ... }
background: { ... }
paper: { ... }
navbar: { ... }
portal_login_background?: { ... }
}
typography: {
font: { ... }
primary: { ... }
secondary: { ... }
}
}
theme: {
shape: {
borderRadius: { ... }
}
}
}

ErrorRespโ€‹

type ErrorResp = {
message?: string
code?: string
error?: object
}

FileDataโ€‹

type FileData = {
name: string
display_name?: string
file_type?: "LOGO" | "FONT" | "IMAGE"
s3_object_key: string
url: string
file_id?: string
}

DesignIdโ€‹

Id of the design

type DesignId = string

Themeโ€‹

Type of theme to be parsed and returned

type Theme = "NEW" | "OLD"

Applicationโ€‹

Type of application that uses the design

type Application = string

DesignParametersโ€‹

type DesignParameters = {
designId?: string
theme?: "NEW" | "OLD"
application?: string
}

ParseThemeFromDesignRespโ€‹

type ParseThemeFromDesignResp = {
theme?: "NEW" | "OLD"
design?: {
id?: string
last_modified_at?: string
style_name?: string
style?: {
logo?: { ... }
palette?: { ... }
typography?: { ... }
}
custom_theme?: string
use_custom_theme?: boolean
journey_design_tokens?: object
version?: 1
colors?: Record<string, unknown>
typography?: Record<string, unknown>
shape?: Record<string, unknown>
components?: Record<string, unknown>
assets?: Record<string, unknown>
journey?: Record<string, unknown>
}
}