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": {
"emailaddress": "string",
"fullname": "string",
"name": "string",
"userid": "string"
},
"style_name": "string",
"style": {
"logo": {
"main": {
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "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"
},
"shape": {
"border_radius": 0
},
"consumer": {
"widgets": [
{
"id": "string",
"name": "string"
}
],
"customer_portals": [
{
"id": "string",
"name": "string"
}
]
}
},
"is_default": true,
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string"
}
}
]
}
]

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: {
main: {
name: 'string',
display_name: 'string',
file_type: 'LOGO',
s3_object_key: 'string',
url: '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'
},
shape: {
border_radius: 0
},
consumer: {
widgets: [
{
id: 'string',
name: 'string'
}
],
customer_portals: [
{
id: 'string',
name: 'string'
}
]
}
},
is_default: true,
custom_theme: 'string',
use_custom_theme: true,
design_tokens: {
coupon: 'string',
cashback: 'string',
custom_css: 'string'
}
}
},
)
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": {
"main": {
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "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"
},
"shape": {
"border_radius": 0
},
"consumer": {
"widgets": [
{
"id": "string",
"name": "string"
}
],
"customer_portals": [
{
"id": "string",
"name": "string"
}
]
}
},
"is_default": true,
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string"
}
}
}

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": {
"main": {
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "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"
},
"shape": {
"border_radius": 0
},
"consumer": {
"widgets": [
{
"id": "string",
"name": "string"
}
],
"customer_portals": [
{
"id": "string",
"name": "string"
}
]
}
},
"is_default": true,
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string"
}
}
}

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

PUT /v1/designs/{designId}

const { data } = await client.updateDesign(
{
designId: 'example',
},
{
design: {
brand_id: 'string',
brand_name: 'string',
user: {
emailaddress: 'string',
fullname: 'string',
name: 'string',
userid: 'string'
},
style_name: 'string',
style: {
logo: {
main: {
name: 'string',
display_name: 'string',
file_type: 'LOGO',
s3_object_key: 'string',
url: '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'
},
shape: {
border_radius: 0
},
consumer: {
widgets: [
{
id: 'string',
name: 'string'
}
],
customer_portals: [
{
id: 'string',
name: 'string'
}
]
}
},
is_default: true,
custom_theme: 'string',
use_custom_theme: true,
design_tokens: {
coupon: 'string',
cashback: 'string',
custom_css: 'string'
}
}
},
)

getThemeFromDesignโ€‹

Search for a especific design owned by user organization and parse them to a new or old theme

GET /v1/designs/{designId}/parse

const { data } = await client.getThemeFromDesign({
designId: 'example',
orgId: 'example',
theme: 'example',
})
Response
{}

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"
}

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"
}
]

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": {
"main": {
"name": "string",
"display_name": "string",
"file_type": "LOGO",
"s3_object_key": "string",
"url": "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"
},
"shape": {
"border_radius": 0
},
"consumer": {
"widgets": [
{
"id": "string",
"name": "string"
}
],
"customer_portals": [
{
"id": "string",
"name": "string"
}
]
}
},
"is_default": true,
"custom_theme": "string",
"use_custom_theme": true,
"design_tokens": {
"coupon": "string",
"cashback": "string",
"custom_css": "string"
}
}
}

addConsumerโ€‹

Add a consumer that uses a specific design

PUT /v1/designs/addConsumer/{application}/{designId}

const { data } = await client.addConsumer(
{
designId: 'example',
application: 'example',
},
{
consumer_id: 'string',
consumer_name: 'string',
should_delete: 'string'
},
)

removeConsumerโ€‹

Remove a consumer that uses a specific design

PUT /v1/designs/removeConsumer/{application}/{designId}

const { data } = await client.removeConsumer(
{
designId: 'example',
application: 'example',
},
{
consumer_id: 'string',
consumer_name: 'string',
should_delete: 'string'
},
)

Schemasโ€‹

UploadFileReqโ€‹

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

UploadFileResโ€‹

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

GetFilesResโ€‹

type GetFilesRes = Array<{
name: string
display_name?: string
file_type?: "LOGO" | "FONT"
s3_object_key: string
url: 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
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
}
}>
}

GetBrandsResโ€‹

type GetBrandsRes = {
brands?: Array<{
id: string
name: string
created_by?: string
created_date?: string
main_brand?: string
organization_id?: string
updated_date?: string
updated_by?: string
status?: string
}>
}

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
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
}
}
}

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
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
}
}
}

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
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
}
}
}

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
custom_theme?: string
use_custom_theme?: boolean
design_tokens?: {
coupon?: { ... }
cashback?: { ... }
custom_css?: { ... }
}
}
}

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
should_delete?: 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
}

BrandItemโ€‹

type BrandItem = {
id: string
name: string
created_by?: string
created_date?: string
main_brand?: string
organization_id?: string
updated_date?: string
updated_by?: string
status?: string
}

Custom_Styleโ€‹

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

Journeyโ€‹

type Journey = {
design_tokens?: {
coupon?: string
cashback?: string
custom_css?: 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"
s3_object_key: string
url: 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
}

ErrorRespโ€‹

type ErrorResp = {
message?: string
}

FileDataโ€‹

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