{
  "openapi": "3.1.0",
  "info": {
    "title": "Replify Partner Service API",
    "description": "API for managing partners, organizations, users, and agents in the Replify platform",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "{baseUrl}",
      "variables": {
        "baseUrl": {
          "default": "https://api.heylibby.ai",
          "description": "Base URL of the Replify API"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/partners": {
      "get": {
        "summary": "Get partners",
        "description": "Get list of partners or filter by domain or name",
        "operationId": "getPartners",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter partners by domain"
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter partners by name"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved partners",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Partner"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "summary": "Create a partner",
        "description": "Create a new partner",
        "operationId": "createPartner",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnerInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully created partner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Partner"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/partners/{partnerId}": {
      "get": {
        "summary": "Get partner by ID",
        "description": "Get a specific partner by ID",
        "operationId": "getPartnerById",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved partner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Partner"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "summary": "Update partner",
        "description": "Update an existing partner",
        "operationId": "updatePartner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated partner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Partner"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/partners/{partnerId}/users": {
      "get": {
        "summary": "Get partner users",
        "description": "Get all users for a specific partner",
        "operationId": "getPartnerUsers",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved partner users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "summary": "Create partner user",
        "description": "Create a new user for a specific partner",
        "operationId": "createPartnerUser",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully created partner user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/partners/{partnerId}/organizations": {
      "get": {
        "summary": "Get partner organizations",
        "description": "Get all organizations for a specific partner",
        "operationId": "getPartnerOrganizations",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved partner organizations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Organization"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/partners/{partnerId}/organizations/{organizationId}/users": {
      "get": {
        "summary": "Get partner organization users",
        "description": "Get all users for a specific organization of a partner",
        "operationId": "getPartnerOrganizationUsers",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved organization users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/partners/{partnerId}/organizations/{organizationId}": {
      "put": {
        "summary": "Update partner organization",
        "description": "Update an organization for a specific partner",
        "operationId": "updatePartnerOrganization",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/partners/{partnerId}/admin-report": {
      "get": {
        "summary": "Get partner admin report",
        "description": "Get an admin report for a specific partner",
        "operationId": "getPartnerAdminReport",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved admin report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerAdminReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/partners/{partnerId}/pricing": {
      "get": {
        "summary": "Get partner pricing options",
        "description": "Get pricing options for a specific partner",
        "operationId": "getPricingOptions",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved pricing options",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PricingOption"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/users": {
      "post": {
        "summary": "Create partner user external",
        "description": "Create a new user for the authenticated partner",
        "operationId": "createPartnerUserExternal",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully created user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/users/partial": {
      "post": {
        "summary": "Create partial partner user external",
        "description": "Create a partial user for the authenticated partner",
        "operationId": "createPartialPartnerUserExternal",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartialUserInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully created partial user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/users/{externalUserId}": {
      "put": {
        "summary": "Update partner user external",
        "description": "Update a user for the authenticated partner",
        "operationId": "updatePartnerUserExternal",
        "parameters": [
          {
            "name": "externalUserId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/users/subscription": {
      "get": {
        "summary": "Get partner user external subscription by query",
        "description": "Get subscription information for a user by organization ID or user email",
        "operationId": "getPartnerUserExternalSubscriptionByQuery",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The organization ID to get subscription for"
          },
          {
            "name": "userEmail",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "The user email to get subscription for"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved subscription",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/users/{externalUserId}/subscription": {
      "get": {
        "summary": "Get partner user external subscription by external user ID",
        "description": "Get subscription information for a user by external user ID",
        "operationId": "getPartnerUserExternalSubscriptionByExternalUserId",
        "parameters": [
          {
            "name": "externalUserId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved subscription",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/users/usage": {
      "get": {
        "summary": "Get partner user external usage",
        "description": "Get usage information for a user by organization ID or user email",
        "operationId": "getPartnerUserExternalUsageByQuery",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The organization ID to get usage for"
          },
          {
            "name": "userEmail",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "The user email to get usage for"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The start date for usage data"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The end date for usage data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/admins": {
      "post": {
        "summary": "Create admin",
        "description": "Create a new admin user",
        "operationId": "createAdmin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdminInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully created admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "HTTP status code"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          },
          "details": {
            "type": "object",
            "description": "Additional error details"
          }
        },
        "required": [
          "statusCode",
          "message"
        ]
      },
      "Partner": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          },
          "partnerName": {
            "type": "string"
          },
          "logoImgUrl": {
            "type": "string",
            "nullable": true
          },
          "showBrandingToggle": {
            "type": "boolean",
            "default": false
          },
          "showCharacterToggle": {
            "type": "boolean",
            "default": false
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "defaultAgentName": {
            "type": "string",
            "nullable": true
          },
          "defaultService": {
            "type": "string",
            "nullable": true
          },
          "brandUIColors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BrandUIColor"
            },
            "nullable": true
          },
          "customHeaderLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerHeaderLink"
            },
            "nullable": true
          },
          "socialLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerSocialLink"
            },
            "nullable": true
          },
          "showEmbeddedChat": {
            "type": "boolean",
            "default": false
          },
          "chatAgentId": {
            "type": "string",
            "nullable": true
          },
          "chatTemplateColors": {
            "type": "object",
            "nullable": true
          },
          "billingEmail": {
            "type": "string",
            "nullable": true
          },
          "supportEmail": {
            "type": "string",
            "nullable": true
          },
          "notificationEmail": {
            "type": "string",
            "nullable": true
          },
          "emailDomain": {
            "type": "string",
            "nullable": true
          },
          "pricing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pricing"
            },
            "nullable": true
          },
          "partnerType": {
            "type": "string",
            "nullable": true
          },
          "siteImages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteImage"
            },
            "nullable": true
          },
          "paymentMethodId": {
            "type": "string",
            "nullable": true
          },
          "partnerRedirectLink": {
            "type": "string",
            "nullable": true
          },
          "partnerUpgradeMessage": {
            "type": "string",
            "nullable": true
          },
          "collectionEmail": {
            "type": "string",
            "nullable": true
          },
          "stripeCollectionCustomerId": {
            "type": "string",
            "nullable": true
          },
          "stripeTrackingCustomerId": {
            "type": "string",
            "nullable": true
          },
          "trackingEmail": {
            "type": "string",
            "nullable": true
          },
          "purchaseLink": {
            "type": "string",
            "nullable": true
          },
          "defaultAgentLimit": {
            "type": "integer",
            "default": 1
          },
          "demoLink": {
            "type": "string",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "default": "AI Receptionist"
          },
          "allowedQueryParams": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "id",
          "createdDate",
          "updatedDate",
          "partnerName"
        ]
      },
      "CreatePartnerInput": {
        "type": "object",
        "properties": {
          "partnerName": {
            "type": "string"
          },
          "logoImgUrl": {
            "type": "string",
            "nullable": true
          },
          "showBrandingToggle": {
            "type": "boolean",
            "default": false
          },
          "showCharacterToggle": {
            "type": "boolean",
            "default": false
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "defaultAgentName": {
            "type": "string",
            "nullable": true
          },
          "defaultService": {
            "type": "string",
            "nullable": true
          },
          "brandUIColors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BrandUIColor"
            },
            "nullable": true
          },
          "customHeaderLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerHeaderLink"
            },
            "nullable": true
          },
          "socialLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerSocialLink"
            },
            "nullable": true
          },
          "showEmbeddedChat": {
            "type": "boolean",
            "default": false
          },
          "chatAgentId": {
            "type": "string",
            "nullable": true
          },
          "chatTemplateColors": {
            "type": "object",
            "nullable": true
          },
          "billingEmail": {
            "type": "string",
            "nullable": true
          },
          "supportEmail": {
            "type": "string",
            "nullable": true
          },
          "notificationEmail": {
            "type": "string",
            "nullable": true
          },
          "emailDomain": {
            "type": "string",
            "nullable": true
          },
          "pricing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pricing"
            },
            "nullable": true
          },
          "partnerType": {
            "type": "string",
            "nullable": true
          },
          "siteImages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteImage"
            },
            "nullable": true
          },
          "paymentMethodId": {
            "type": "string",
            "nullable": true
          },
          "partnerRedirectLink": {
            "type": "string",
            "nullable": true
          },
          "partnerUpgradeMessage": {
            "type": "string",
            "nullable": true
          },
          "collectionEmail": {
            "type": "string",
            "nullable": true
          },
          "trackingEmail": {
            "type": "string",
            "nullable": true
          },
          "purchaseLink": {
            "type": "string",
            "nullable": true
          },
          "defaultAgentLimit": {
            "type": "integer",
            "default": 1
          },
          "demoLink": {
            "type": "string",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "default": "AI Receptionist"
          },
          "allowedQueryParams": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "partnerName"
        ]
      },
      "UpdatePartnerInput": {
        "type": "object",
        "properties": {
          "partnerName": {
            "type": "string"
          },
          "logoImgUrl": {
            "type": "string",
            "nullable": true
          },
          "showBrandingToggle": {
            "type": "boolean"
          },
          "showCharacterToggle": {
            "type": "boolean"
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "defaultAgentName": {
            "type": "string",
            "nullable": true
          },
          "defaultService": {
            "type": "string",
            "nullable": true
          },
          "brandUIColors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BrandUIColor"
            },
            "nullable": true
          },
          "customHeaderLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerHeaderLink"
            },
            "nullable": true
          },
          "socialLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerSocialLink"
            },
            "nullable": true
          },
          "showEmbeddedChat": {
            "type": "boolean"
          },
          "chatAgentId": {
            "type": "string",
            "nullable": true
          },
          "chatTemplateColors": {
            "type": "object",
            "nullable": true
          },
          "billingEmail": {
            "type": "string",
            "nullable": true
          },
          "supportEmail": {
            "type": "string",
            "nullable": true
          },
          "notificationEmail": {
            "type": "string",
            "nullable": true
          },
          "emailDomain": {
            "type": "string",
            "nullable": true
          },
          "pricing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pricing"
            },
            "nullable": true
          },
          "partnerType": {
            "type": "string",
            "nullable": true
          },
          "siteImages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteImage"
            },
            "nullable": true
          },
          "paymentMethodId": {
            "type": "string",
            "nullable": true
          },
          "partnerRedirectLink": {
            "type": "string",
            "nullable": true
          },
          "partnerUpgradeMessage": {
            "type": "string",
            "nullable": true
          },
          "collectionEmail": {
            "type": "string",
            "nullable": true
          },
          "trackingEmail": {
            "type": "string",
            "nullable": true
          },
          "purchaseLink": {
            "type": "string",
            "nullable": true
          },
          "defaultAgentLimit": {
            "type": "integer"
          },
          "demoLink": {
            "type": "string",
            "nullable": true
          },
          "productName": {
            "type": "string"
          },
          "allowedQueryParams": {
            "type": "object",
            "nullable": true
          }
        }
      },
      "BrandUIColor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ]
      },
      "PartnerHeaderLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "url"
        ]
      },
      "PartnerSocialLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "facebook",
              "twitter",
              "linkedin",
              "instagram",
              "youtube"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "url"
        ]
      },
      "SiteImage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "logo",
              "hero",
              "favicon"
            ]
          },
          "imageUrl": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "imageUrl"
        ]
      },
      "Pricing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tier": {
            "type": "string",
            "enum": [
              "customerFreePlan",
              "customerBasicPlan",
              "customerPlusPlan"
            ]
          },
          "stripePriceId": {
            "type": "string"
          },
          "stripeProductId": {
            "type": "string"
          }
        },
        "required": [
          "tier",
          "stripePriceId",
          "stripeProductId"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "adminOwned": {
            "type": "boolean",
            "default": false
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "unsubscribe": {
            "type": "boolean",
            "default": true
          },
          "lastSession": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "cognitoUid": {
            "type": "string",
            "nullable": true
          },
          "orgId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "lastLogin": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "default": "active"
          }
        },
        "required": [
          "id",
          "email",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateUserInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "userType": {
            "type": "string",
            "enum": [
              "standard",
              "admin",
              "partnerAdmin",
              "partnerEditor"
            ]
          },
          "tier": {
            "type": "string",
            "enum": [
              "customerFreePlan",
              "customerBasicPlan",
              "customerPlusPlan",
              "customerBasicFreeTrialPlan"
            ],
            "nullable": true
          },
          "businessName": {
            "type": "string",
            "nullable": true
          },
          "service": {
            "type": "string",
            "nullable": true
          },
          "agentTimezone": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "email",
          "userType"
        ]
      },
      "CreatePartialUserInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "email",
          "orgId"
        ]
      },
      "UpdateUserInput": {
        "type": "object",
        "properties": {
          "paymentTier": {
            "type": "string",
            "enum": [
              "customerFreePlan",
              "customerBasicPlan",
              "customerPlusPlan",
              "customerBasicFreeTrialPlan"
            ],
            "nullable": true
          },
          "email": {
            "type": "string",
            "format": "email",
            "nullable": true
          }
        }
      },
      "Organization": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "referralCode": {
            "type": "string",
            "nullable": true
          },
          "referredByCode": {
            "type": "string",
            "nullable": true
          },
          "paymentTier": {
            "type": "string",
            "default": "customerFreePlan",
            "nullable": true
          },
          "stripeCustomerId": {
            "type": "string",
            "nullable": true
          },
          "referralPromoUsed": {
            "type": "string",
            "nullable": true
          },
          "referralUICustomization": {
            "type": "object",
            "nullable": true
          },
          "adminOwned": {
            "type": "boolean",
            "default": false
          },
          "partnerId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "tempDemoOrg": {
            "type": "boolean",
            "default": false
          },
          "agentLimit": {
            "type": "integer",
            "default": 1
          },
          "userLimit": {
            "type": "integer",
            "default": 1
          }
        },
        "required": [
          "id",
          "createdDate"
        ]
      },
      "UpdateOrganizationInput": {
        "type": "object",
        "properties": {
          "paymentTier": {
            "type": "string",
            "enum": [
              "customerFreePlan",
              "customerBasicPlan",
              "customerPlusPlan",
              "customerBasicFreeTrialPlan"
            ]
          },
          "referralCode": {
            "type": "string",
            "nullable": true
          },
          "referredByCode": {
            "type": "string",
            "nullable": true
          },
          "agentLimit": {
            "type": "integer"
          },
          "userLimit": {
            "type": "integer"
          }
        }
      },
      "PartnerAdminReport": {
        "type": "object",
        "properties": {
          "userCount": {
            "type": "integer"
          },
          "userCountByTier": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "email": {
                  "type": "string",
                  "format": "email"
                },
                "signUpDate": {
                  "type": "string",
                  "format": "date-time"
                },
                "businessName": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "paymentTier": {
                  "type": "string"
                },
                "conversations": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "PricingOption": {
        "type": "object",
        "properties": {
          "cost": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "paymentTier": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "SubscriptionInfo": {
        "type": "object",
        "properties": {
          "userEmail": {
            "type": "string",
            "format": "email",
            "nullable": true
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "subscriptionPlan": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "startDate": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "agentLimit": {
                "type": "integer"
              },
              "userLimit": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "integer"
                  },
                  "isUnlimited": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "UsageInfo": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "userEmail": {
            "type": "string",
            "format": "email",
            "nullable": true
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "totalAgentsCreated": {
            "type": "integer"
          },
          "totalUsersCreated": {
            "type": "integer"
          },
          "usage": {
            "type": "object",
            "properties": {
              "conversations": {
                "type": "integer"
              },
              "lastUpdatedDate": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "requestedDateRange": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "end": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        }
      },
      "CreateAdminInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          }
        },
        "required": [
          "email"
        ]
      }
    }
  }
}