{
  "openapi": "3.0.3",
  "info": {
    "title": "Design Builder API v2",
    "version": "0.0.3"
  },
  "tags": [
    {
      "name": "design-builder",
      "description": "Available design-builder over designs provided by Design Builder v2"
    }
  ],
  "servers": [
    {
      "url": "https://design-builder-api.sls.epilot.io"
    }
  ],
  "security": [
    {
      "custom_authorizer": []
    }
  ],
  "paths": {
    "/v1/designs": {
      "get": {
        "operationId": "getAllDesigns",
        "summary": "getAllDesigns",
        "description": "Scan all designs linked to a organization, based in orgId attribute from JWT auth token",
        "tags": [
          "design-builder"
        ],
        "responses": {
          "200": {
            "description": "Success - designs loaded with success. Empty array if org has no designs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAllDesignsRes"
                }
              }
            }
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "addDesign",
        "summary": "addDesign",
        "description": "Create a brand new design linked to a organization, based in orgId attribute from JWT auth token",
        "tags": [
          "design-builder"
        ],
        "requestBody": {
          "description": "Design payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDesignReq"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success - design created with success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddDesignRes"
                }
              }
            }
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/{designId}": {
      "get": {
        "operationId": "getDesign",
        "summary": "getDesign",
        "description": "Search for a especific design owned by user organization",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "designId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success - design loaded with success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDesignRes"
                }
              }
            }
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDesign",
        "summary": "deleteDesign",
        "description": "Search and delete for a especific design owned by user organization",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "designId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success - design deleted with success."
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateDesign",
        "summary": "updateDesign",
        "description": "Update a especific design owned by user organization",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "designId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          }
        ],
        "requestBody": {
          "description": "Design payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDesignReq"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success - design updated with success."
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/{designId}/parse": {
      "get": {
        "operationId": "getThemeFromDesign",
        "summary": "getThemeFromDesign",
        "description": "Search for a especific design owned by user organization and parse them to a new or old theme",
        "security": [],
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "designId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          },
          {
            "in": "query",
            "name": "orgId",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Organization id of the user"
          },
          {
            "in": "query",
            "name": "theme",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Theme"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success - design parsed with success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParseThemeFromDesignResp"
                }
              }
            }
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/files": {
      "post": {
        "operationId": "uploadFile",
        "summary": "uploadFile",
        "description": "Upload a new file for the user organization bucket",
        "tags": [
          "design-builder"
        ],
        "requestBody": {
          "description": "Upload file payload",
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadFileReq"
              },
              "encoding": {
                "file_data": {
                  "contentType": "image/*, application/x-font-ttf, application/x-font-opentype, application/font-woff, application/font-woff2"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success - upload with success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadFileRes"
                }
              }
            }
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getFiles",
        "summary": "getFiles",
        "description": "List all files for the user organization bucket",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string",
              "enum": [
                "LOGO",
                "FONT",
                "IMAGE"
              ]
            },
            "required": false,
            "description": "Type of files to be returned",
            "example": "LOGO"
          }
        ],
        "responses": {
          "200": {
            "description": "Success - files loaded with success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetFilesRes"
                }
              }
            }
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/limit": {
      "get": {
        "deprecated": true,
        "operationId": "getLimit",
        "summary": "getLimit",
        "description": "Gets designs number limit from database per organization",
        "tags": [
          "design-builder"
        ],
        "responses": {
          "200": {
            "description": "Success - limit loaded with success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "number"
                }
              }
            }
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/brands": {
      "get": {
        "deprecated": true,
        "operationId": "getBrands",
        "summary": "getBrands",
        "description": "Scan all brands linked to a organization, based in orgId attribute from JWT auth token",
        "tags": [
          "design-builder"
        ],
        "responses": {
          "200": {
            "description": "Success - brands loaded with success. Empty array if org has no designs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetBrandsRes"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/consumer/{application}/{consumerId}": {
      "get": {
        "operationId": "getConsumerDesign",
        "summary": "getConsumerDesign",
        "description": "Search for a especific design owned by user organization",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "consumerId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          },
          {
            "in": "path",
            "name": "application",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Application"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success - design loaded with success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDesignRes"
                }
              }
            }
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/addConsumer/{application}/{designId}": {
      "put": {
        "operationId": "addConsumer",
        "summary": "addConsumer",
        "description": "Add a consumer that uses a specific design",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "designId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          },
          {
            "in": "path",
            "name": "application",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Type of application that uses the design",
            "example": "journey"
          }
        ],
        "requestBody": {
          "description": "widget id payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddConsumerReq"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success - design updated with success."
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/designs/removeConsumer/{application}/{designId}": {
      "put": {
        "operationId": "removeConsumer",
        "summary": "removeConsumer",
        "description": "Remove a consumer that uses a specific design",
        "tags": [
          "design-builder"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "designId",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DesignId"
            }
          },
          {
            "in": "path",
            "name": "application",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Type of application that uses the design",
            "example": "journey"
          }
        ],
        "requestBody": {
          "description": "widget id payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveConsumerReq"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success - design updated with success."
          },
          "400": {
            "description": "Validation Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "401": {
            "description": "Authentication Errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          },
          "404": {
            "description": "No design found"
          },
          "500": {
            "description": "Other errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResp"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "custom_authorizer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "UploadFileReq": {
        "type": "object",
        "properties": {
          "file_type": {
            "type": "string",
            "enum": [
              "LOGO",
              "FONT",
              "IMAGE"
            ]
          },
          "file_data": {
            "type": "string",
            "format": "base64"
          },
          "display_name": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          }
        },
        "required": [
          "file_type",
          "file_name",
          "file_data"
        ]
      },
      "UploadFileRes": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/FileData"
          }
        ]
      },
      "GetFilesRes": {
        "type": "array",
        "items": {
          "allOf": [
            {
              "$ref": "#/components/schemas/FileData"
            }
          ]
        }
      },
      "GetAllDesignsRes": {
        "type": "object",
        "properties": {
          "designs": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ItemMetada"
                },
                {
                  "$ref": "#/components/schemas/DesignItem"
                },
                {
                  "$ref": "#/components/schemas/Custom_Style"
                },
                {
                  "$ref": "#/components/schemas/Journey"
                }
              ]
            }
          }
        }
      },
      "GetBrandsRes": {
        "type": "object",
        "properties": {
          "brands": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BrandItem"
                }
              ]
            }
          }
        }
      },
      "AddDesignReq": {
        "type": "object",
        "properties": {
          "design": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DesignItem"
              },
              {
                "$ref": "#/components/schemas/Custom_Style"
              },
              {
                "$ref": "#/components/schemas/Journey"
              }
            ]
          }
        },
        "required": [
          "design"
        ]
      },
      "AddDesignRes": {
        "type": "object",
        "properties": {
          "design": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ItemMetada"
              },
              {
                "$ref": "#/components/schemas/DesignItem"
              },
              {
                "$ref": "#/components/schemas/Custom_Style"
              },
              {
                "$ref": "#/components/schemas/Journey"
              }
            ]
          }
        }
      },
      "GetDesignRes": {
        "type": "object",
        "properties": {
          "design": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ItemMetada"
              },
              {
                "$ref": "#/components/schemas/DesignItem"
              },
              {
                "$ref": "#/components/schemas/Custom_Style"
              },
              {
                "$ref": "#/components/schemas/Journey"
              }
            ]
          }
        }
      },
      "UpdateDesignReq": {
        "type": "object",
        "properties": {
          "design": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DesignItem"
              },
              {
                "$ref": "#/components/schemas/Custom_Style"
              },
              {
                "$ref": "#/components/schemas/Journey"
              }
            ]
          }
        },
        "required": [
          "design"
        ]
      },
      "ItemMetada": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "description": "Creation date and time",
            "example": "2021-01-30T08:30:00Z"
          },
          "created_by": {
            "type": "string"
          },
          "edited": {
            "type": "boolean"
          },
          "last_modified_at": {
            "type": "string"
          }
        }
      },
      "AddConsumerReq": {
        "type": "object",
        "properties": {
          "consumer_id": {
            "$ref": "#/components/schemas/DesignId"
          },
          "consumer_name": {
            "type": "string"
          },
          "should_delete": {
            "type": "string"
          }
        },
        "required": [
          "consumer_id",
          "consumer_name"
        ]
      },
      "RemoveConsumerReq": {
        "type": "object",
        "properties": {
          "consumer_id": {
            "$ref": "#/components/schemas/DesignId"
          },
          "should_delete": {
            "type": "string",
            "deprecated": true
          }
        },
        "required": [
          "consumer_id"
        ]
      },
      "DesignItem": {
        "type": "object",
        "properties": {
          "brand_id": {
            "type": "string"
          },
          "brand_name": {
            "type": "string"
          },
          "user": {
            "type": "object",
            "properties": {
              "emailaddress": {
                "type": "string"
              },
              "fullname": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "userid": {
                "type": "string"
              }
            }
          },
          "style_name": {
            "type": "string"
          },
          "style": {
            "type": "object",
            "properties": {
              "logo": {
                "type": "object",
                "$ref": "#/components/schemas/LogoData"
              },
              "palette": {
                "type": "object",
                "$ref": "#/components/schemas/PaletteData"
              },
              "typography": {
                "type": "object",
                "$ref": "#/components/schemas/TypographyData"
              },
              "shape": {
                "type": "object",
                "$ref": "#/components/schemas/ShapeData"
              },
              "consumer": {
                "type": "object",
                "$ref": "#/components/schemas/ConsumerData"
              }
            },
            "required": [
              "palette",
              "typography",
              "consumer"
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "_manifest": {
            "type": "array",
            "description": "The manifest IDs associated with this design",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "style_name",
          "status",
          "edited",
          "style"
        ]
      },
      "BrandItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "created_date": {
            "type": "string"
          },
          "main_brand": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "updated_date": {
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Custom_Style": {
        "type": "object",
        "properties": {
          "custom_theme": {
            "type": "string"
          },
          "use_custom_theme": {
            "type": "boolean"
          }
        }
      },
      "Journey": {
        "type": "object",
        "properties": {
          "design_tokens": {
            "type": "object",
            "description": "Design tokens for journey customization",
            "properties": {
              "coupon": {
                "type": "string"
              },
              "cashback": {
                "type": "string"
              },
              "custom_css": {
                "type": "string"
              },
              "accent_color": {
                "type": "string",
                "description": "Accent color, defaults to primary"
              },
              "outline_color": {
                "type": "string",
                "description": "Global outline/focus color"
              },
              "divider_color": {
                "type": "string",
                "description": "Divider line color"
              },
              "link_color": {
                "type": "string",
                "description": "Link text color"
              },
              "link_hover_color": {
                "type": "string",
                "description": "Link hover text color"
              },
              "font_size_scale": {
                "type": "string",
                "description": "Font size scale factor",
                "enum": [
                  "xs",
                  "sm",
                  "md",
                  "lg",
                  "xl"
                ]
              },
              "topbar_height": {
                "type": "number",
                "description": "Topbar minimum height in pixels"
              },
              "topbar_logo_alignment": {
                "type": "string",
                "description": "Logo/content alignment in the top bar",
                "enum": [
                  "flex-start",
                  "center",
                  "flex-end"
                ]
              },
              "logo_size": {
                "type": "number",
                "description": "Logo size in pixels"
              },
              "input_background": {
                "type": "string",
                "description": "Input field background color"
              },
              "input_border_color": {
                "type": "string",
                "description": "Input field border color"
              },
              "input_text_color": {
                "type": "string",
                "description": "Input field text color"
              },
              "input_label_color": {
                "type": "string",
                "description": "Input field label color"
              },
              "input_border_radius": {
                "type": "number",
                "description": "Input field border radius in pixels"
              },
              "input_height": {
                "type": "number",
                "description": "Input field height in pixels"
              },
              "input_variant": {
                "type": "string",
                "description": "Input field variant style",
                "enum": [
                  "outlined",
                  "filled",
                  "underlined"
                ]
              },
              "button_primary_bg": {
                "type": "string",
                "description": "Primary button background color or gradient"
              },
              "button_primary_text": {
                "type": "string",
                "description": "Primary button text color"
              },
              "button_primary_hover_bg": {
                "type": "string",
                "description": "Primary button hover background color or gradient"
              },
              "button_primary_hover_text": {
                "type": "string",
                "description": "Primary button hover text color"
              },
              "button_outlined_border": {
                "type": "string",
                "description": "Outlined button border color"
              },
              "button_outlined_text": {
                "type": "string",
                "description": "Outlined button text color"
              },
              "button_outlined_hover_bg": {
                "type": "string",
                "description": "Outlined button hover background color"
              },
              "button_outlined_hover_text": {
                "type": "string",
                "description": "Outlined button hover text color"
              },
              "button_ghost_bg": {
                "type": "string",
                "description": "Ghost button background color"
              },
              "button_ghost_text": {
                "type": "string",
                "description": "Ghost button text color"
              },
              "button_ghost_hover_bg": {
                "type": "string",
                "description": "Ghost button hover background color"
              },
              "button_ghost_hover_text": {
                "type": "string",
                "description": "Ghost button hover text color"
              },
              "button_border_radius": {
                "type": "number",
                "description": "Button border radius in pixels"
              },
              "button_height": {
                "type": "number",
                "description": "Button height in pixels"
              },
              "card_background": {
                "type": "string",
                "description": "Card background color"
              },
              "card_border_color": {
                "type": "string",
                "description": "Card border color for outlined variant"
              },
              "card_variant": {
                "type": "string",
                "description": "Card visual variant",
                "enum": [
                  "shadow",
                  "outlined"
                ]
              },
              "summary_card_background": {
                "type": "string",
                "description": "Summary card background color"
              },
              "toggle_selected_bg": {
                "type": "string",
                "description": "Toggle button selected background color"
              },
              "toggle_selected_text": {
                "type": "string",
                "description": "Toggle button selected text color"
              },
              "toggle_hover_bg": {
                "type": "string",
                "description": "Toggle button hover background color"
              },
              "toggle_hover_text": {
                "type": "string",
                "description": "Toggle button hover text color"
              },
              "toggle_border_color": {
                "type": "string",
                "description": "Toggle group wrapper border color"
              },
              "dropdown_hover_bg": {
                "type": "string",
                "description": "Dropdown option hover background color"
              },
              "dropdown_hover_text": {
                "type": "string",
                "description": "Dropdown option hover text color"
              },
              "dropdown_selected_bg": {
                "type": "string",
                "description": "Dropdown option selected background color"
              },
              "dropdown_selected_text": {
                "type": "string",
                "description": "Dropdown option selected text color"
              },
              "switch_unchecked_color": {
                "type": "string",
                "description": "Switch unchecked thumb color"
              },
              "switch_unchecked_bg": {
                "type": "string",
                "description": "Switch unchecked track background color"
              },
              "switch_border_radius": {
                "type": "number",
                "description": "Switch border radius in pixels"
              },
              "checkbox_unchecked_color": {
                "type": "string",
                "description": "Checkbox unchecked border color"
              },
              "checkbox_label_color": {
                "type": "string",
                "description": "Checkbox label text color"
              },
              "radio_unchecked_color": {
                "type": "string",
                "description": "Radio button unchecked border color"
              },
              "radio_label_color": {
                "type": "string",
                "description": "Radio button label text color"
              },
              "datepicker_selected_bg": {
                "type": "string",
                "description": "Date picker selected date background color"
              },
              "datepicker_selected_color": {
                "type": "string",
                "description": "Date picker selected date text color"
              },
              "datepicker_border_radius": {
                "type": "number",
                "description": "Date picker border radius in pixels"
              },
              "chip_background": {
                "type": "string",
                "description": "Chip background color"
              },
              "chip_hover_background": {
                "type": "string",
                "description": "Chip hover background color"
              },
              "chip_text_color": {
                "type": "string",
                "description": "Chip text color"
              },
              "chip_hover_text_color": {
                "type": "string",
                "description": "Chip hover text color"
              }
            }
          }
        }
      },
      "ConsumerData": {
        "type": "object",
        "properties": {
          "widgets": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WidgetData"
                }
              ]
            }
          },
          "customer_portals": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CustomerPortalData"
                }
              ]
            }
          }
        },
        "required": [
          "widgets",
          "customer_portals"
        ]
      },
      "WidgetData": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WidgetPortalData"
          }
        ]
      },
      "CustomerPortalData": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WidgetPortalData"
          }
        ]
      },
      "LogoData": {
        "type": "object",
        "properties": {
          "main": {
            "type": "object",
            "$ref": "#/components/schemas/FileData"
          }
        }
      },
      "PaletteData": {
        "type": "object",
        "properties": {
          "primary": {
            "type": "string"
          },
          "secondary": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "background": {
            "type": "string"
          },
          "paper": {
            "type": "string"
          },
          "navbar": {
            "type": "string"
          },
          "portal_login_background": {
            "type": "string"
          }
        },
        "required": [
          "primary",
          "secondary",
          "error",
          "background",
          "paper",
          "navbar"
        ]
      },
      "TypographyData": {
        "type": "object",
        "properties": {
          "font": {
            "type": "object",
            "$ref": "#/components/schemas/FontData"
          },
          "primary": {
            "type": "string"
          },
          "secondary": {
            "type": "string"
          }
        },
        "required": [
          "font",
          "primary",
          "secondary"
        ]
      },
      "ShapeData": {
        "type": "object",
        "properties": {
          "border_radius": {
            "type": "number"
          }
        }
      },
      "FontData": {
        "type": "object",
        "properties": {
          "font_id": {
            "type": "string"
          },
          "font_name": {
            "type": "string"
          },
          "font_family": {
            "type": "string"
          },
          "font_weight_regular": {
            "type": "string"
          },
          "font_weight_medium": {
            "type": "string"
          },
          "font_weight_bold": {
            "type": "string"
          },
          "urls": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/FontResponseUrl"
                }
              ]
            }
          }
        },
        "required": [
          "font_id",
          "font_name",
          "urls"
        ]
      },
      "FontResponseUrl": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "WOFF2",
              "WOFF",
              "TTF",
              "EOT"
            ]
          },
          "url": {
            "type": "string"
          }
        }
      },
      "WidgetPortalData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "ErrorResp": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "error": {
            "type": "object"
          }
        }
      },
      "FileData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string",
            "enum": [
              "LOGO",
              "FONT",
              "IMAGE"
            ]
          },
          "s3_object_key": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "file_id": {
            "type": "string",
            "description": "ID of the source file entity in the epilot file-entity system. Set when the file was picked from the File Manager (rather than uploaded directly to the design-builder bucket). Consumers resolve the live `public_url` via this reference. The org id is derived from the journey's owning org at render time (same convention as journey image blocks), so blueprint cross-org installs work without any extra remapping."
          }
        },
        "required": [
          "name",
          "s3_object_key",
          "url"
        ]
      },
      "DesignId": {
        "type": "string",
        "minLength": 36,
        "maxLength": 36,
        "description": "Id of the design",
        "example": "4a062990-a6a3-11eb-9828-4f3da7d4935a"
      },
      "Theme": {
        "type": "string",
        "enum": [
          "NEW",
          "OLD"
        ],
        "description": "Type of theme to be parsed and returned",
        "example": "NEW"
      },
      "Application": {
        "type": "string",
        "description": "Type of application that uses the design",
        "example": "journey"
      },
      "DesignParameters": {
        "type": "object",
        "properties": {
          "designId": {
            "$ref": "#/components/schemas/DesignId"
          },
          "theme": {
            "$ref": "#/components/schemas/Theme"
          },
          "application": {
            "$ref": "#/components/schemas/Application"
          }
        }
      },
      "ParseThemeFromDesignResp": {
        "type": "object",
        "properties": {
          "theme": {
            "$ref": "#/components/schemas/Theme"
          },
          "design": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "last_modified_at": {
                "type": "string"
              },
              "style_name": {
                "type": "string"
              },
              "style": {
                "type": "object",
                "properties": {
                  "logo": {
                    "$ref": "#/components/schemas/LogoData"
                  },
                  "palette": {
                    "$ref": "#/components/schemas/PaletteData"
                  },
                  "typography": {
                    "$ref": "#/components/schemas/TypographyData"
                  }
                }
              },
              "custom_theme": {
                "type": "string"
              },
              "use_custom_theme": {
                "type": "boolean"
              },
              "journey_design_tokens": {
                "type": "object",
                "description": "Design tokens for journey customization (renamed from design_tokens)"
              }
            }
          }
        }
      }
    }
  }
}
