{
  "openapi": "3.0.4",
  "info": {
    "title": "KauntManagementService",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kaunt.com",
      "description": "Management API"
    }
  ],
  "paths": {
    "/v1/partners/{partnerId}/tenants/{tenantId}/apikeys": {
      "get": {
        "tags": [
          "APIKeys"
        ],
        "summary": "Get API keys",
        "description": "Returns all API keys associated with the specified tenant, including their environment and status.",
        "operationId": "Get API Key",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantApiKeysResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "APIKeys"
        ],
        "summary": "Create API key",
        "description": "Creates a new API key for the specified tenant in the given environment. Optionally provide a name for identification.",
        "operationId": "Create API Key",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "environment",
            "in": "query",
            "description": "The environment in which the API key should be created",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/APIEnvironment"
            },
            "example": "Production"
          },
          {
            "name": "name",
            "in": "query",
            "description": "The name given to the API key",
            "schema": {
              "type": "string"
            },
            "example": "My API Key"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "APIKeys"
        ],
        "summary": "Delete API key",
        "description": "Permanently deletes the specified API key. This action cannot be undone.",
        "operationId": "Delete API Key",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "The id of the API key to delete",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "5a3f649c-65b8-403a-8bc4-d86e90e34b3c"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "List companies",
        "description": "Retrieves all companies associated with the specified tenant.",
        "operationId": "Get Companies for Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CompanyDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies/{companyName}/dimensions": {
      "get": {
        "tags": [
          "Dimensions"
        ],
        "summary": "List dimensions",
        "description": "Retrieves a paginated list of dimensions for a specific company. Supports filtering by external dimension ID and value.",
        "operationId": "Get Dimensions for Company",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "acme-corp"
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The maximum number of dimensions per page",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 10
          },
          {
            "name": "pageNo",
            "in": "query",
            "description": "The page number to retrieve",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 1
          },
          {
            "name": "externalDimensionId",
            "in": "query",
            "description": "Filter by external dimension ID",
            "schema": {
              "type": "string"
            },
            "example": "CostCenter"
          },
          {
            "name": "externalDimensionValueId",
            "in": "query",
            "description": "Filter by external dimension value ID",
            "schema": {
              "type": "string"
            },
            "example": "CC-001"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionPageDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies/{companyName}/dimensions/{dimensionId}": {
      "get": {
        "tags": [
          "Dimensions"
        ],
        "summary": "Get dimension",
        "description": "Retrieves a specific dimension by its ID for a given company.",
        "operationId": "Get Dimension by ID",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "acme-corp"
          },
          {
            "name": "dimensionId",
            "in": "path",
            "description": "The id of the dimension",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "227aebd0-36a4-4d17-b96d-c5b5d071abd4"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Dimensions"
        ],
        "summary": "Update dimension",
        "description": "Updates properties of a specific dimension. Returns 404 if the dimension does not exist.",
        "operationId": "Update Dimension",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "acme-corp"
          },
          {
            "name": "dimensionId",
            "in": "path",
            "description": "The id of the dimension",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "227aebd0-36a4-4d17-b96d-c5b5d071abd4"
          }
        ],
        "requestBody": {
          "description": "The properties to update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDimensionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDimensionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDimensionRequest"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies/{companyName}/insights/invoicecoding/counts": {
      "get": {
        "tags": [
          "Insights"
        ],
        "summary": "Get invoice coding counts",
        "description": "Retrieves the count of invoice coding data for a given tenant and company within a specified date range.",
        "operationId": "GetInvoiceCodingCounts",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "kaunt"
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "The start date of the range (inclusive). Format: yyyy-MM-dd.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "The end date of the range (inclusive). Format: yyyy-MM-dd.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-12-31"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCodingCountDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies/{companyName}/insights/invoicecoding/proposals/trends": {
      "get": {
        "tags": [
          "Insights"
        ],
        "summary": "Get invoice coding proposal trends",
        "description": "Retrieves the trends of invoice coding proposals for a given tenant and company within a specified date range.",
        "operationId": "GetInvoiceCodingProposalTrends",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "kaunt"
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "The start date of the range (inclusive). Format: yyyy-MM-dd.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "The end date of the range (inclusive). Format: yyyy-MM-dd.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-12-31"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCodingProposalTrendDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies/{companyName}/insights/invoicecoding/dimensions/performance-metrics": {
      "get": {
        "tags": [
          "Insights"
        ],
        "summary": "Get dimension performance metrics",
        "description": "Retrieves the performance of invoice coding dimensions for a given tenant and company within a specified date range.",
        "operationId": "GetInvoiceCodingDimensionPerformance",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "kaunt"
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "The start date of the range (inclusive). Format: yyyy-MM-dd.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "The end date of the range (inclusive). Format: yyyy-MM-dd.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-12-31"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCodingDimensionProposalPerformanceDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/companies/{companyName}/insights/invoicecoding/proposals/precision-metrics": {
      "get": {
        "tags": [
          "Insights"
        ],
        "summary": "Get dimension precision metrics",
        "description": "Retrieves the precision of invoice coding dimensions for a given tenant and company within a pre-determined date range.",
        "operationId": "GetInvoiceCodingDimensionPrecision",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "companyName",
            "in": "path",
            "description": "The name of the company",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "kaunt"
          },
          {
            "name": "precisionPerformancePeriodEnum",
            "in": "query",
            "description": "The time period for precision calculation. Valid values: PastMonth, Past3Months, Past6Months, PastYear",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PrecisionPerformancePeriodEnum"
            },
            "example": "Past3Months"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCodingDimensionPrecisionDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get partner",
        "description": "Retrieves the partner details including name, logo, and configuration.",
        "operationId": "Get Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/allowed-regions": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get allowed regions",
        "description": "Returns the regions a partner is allowed to use and create tenants in.",
        "operationId": "Get Allowed Regions For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KauntRegionEnum"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/dataretention": {
      "put": {
        "tags": [
          "Partners"
        ],
        "summary": "Set data retention policy",
        "description": "Sets or updates the data retention policy for the partner. The retention duration must be a valid ISO 8601 duration.",
        "operationId": "Set Data Retention Policy For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The data retention policy",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataRetentionPolicyRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DataRetentionPolicyRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DataRetentionPolicyRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRetentionPolicyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get data retention policy",
        "description": "Returns the data retention policy configured for the partner. If no policy is set, the system default is returned.",
        "operationId": "Get Data Retention Policy For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRetentionPolicyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/consumption/services": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get services consumption",
        "description": "Retrieves services consumption data (proposals, document AI, form recognizer) for a partner within a specified date range.",
        "operationId": "Get Services Consumption",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "from",
            "in": "query",
            "description": "The start date of the range. Format YYYY-MM-DD. Inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          },
          {
            "name": "to",
            "in": "query",
            "description": "The end date of the range. Format YYYY-MM-DD. Inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2027-01-01"
          },
          {
            "name": "regions",
            "in": "query",
            "description": "Optional list of regions to filter by. If not specified, uses partner's allowed regions.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/KauntRegionEnum"
              }
            },
            "example": "EU1_FRANCE"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicesConsumptionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/consumption/services": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "List tenant services consumption",
        "description": "Retrieves a paginated list of tenants with their services consumption data.",
        "operationId": "Get Tenants Services Consumption",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "from",
            "in": "query",
            "description": "The start date of the range. Format YYYY-MM-DD. Inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          },
          {
            "name": "to",
            "in": "query",
            "description": "The end date of the range. Format YYYY-MM-DD. Inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2027-01-01"
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The number of tenants per page (default: 50, max: 100)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            },
            "example": 50
          },
          {
            "name": "pageNo",
            "in": "query",
            "description": "The page number (default: 1)",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            },
            "example": 1
          },
          {
            "name": "regions",
            "in": "query",
            "description": "Optional list of regions to filter by. If not specified, uses partner's allowed regions.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/KauntRegionEnum"
              }
            },
            "example": "EU1_FRANCE"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantServicesConsumptionListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/clients": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get M2M clients",
        "description": "Returns the machine-to-machine OAuth2 clients configured for the partner.",
        "operationId": "Get M2M Clients",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerClientsResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/clients/{clientId}/rotate-secret": {
      "post": {
        "tags": [
          "Partners"
        ],
        "summary": "Rotate M2M client secret",
        "description": "Rotates the client secret for a partner's M2M client.\nThe old secret is immediately invalidated for new token requests.\nExisting access tokens remain valid until they expire.",
        "operationId": "Rotate M2M Client Secret",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "clientId",
            "in": "path",
            "description": "The M2M client client_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "abc123def456"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateCredentialSecretResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/smartallocationsettings": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get smart allocation settings for a partner",
        "operationId": "Get Smart Allocation Settings For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartAllocationSettingsResponseDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Partners"
        ],
        "summary": "Set smart allocation settings for a partner",
        "operationId": "Set Smart Allocation Settings For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The smart allocation settings",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartAllocationSettingsRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartAllocationSettingsRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SmartAllocationSettingsRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartAllocationSettingsResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/postingtextsettings": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get posting text settings for a partner",
        "description": "Returns the partner-level posting text settings. Tenants without an explicit override inherit this value.",
        "operationId": "Get Posting Text Settings For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingTextSettingsResponseDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Partners"
        ],
        "summary": "Set posting text settings for a partner",
        "description": "Sets the partner-level posting text settings. Applies to all tenants without an explicit override.",
        "operationId": "Set Posting Text Settings For Partner",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The posting text settings",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostingTextSettingsRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostingTextSettingsRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostingTextSettingsRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingTextSettingsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants": {
      "post": {
        "tags": [
          "Tenants"
        ],
        "summary": "Create tenant",
        "description": "Creates a new tenant for the partner in the specified region.",
        "operationId": "Create Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The tenant to be created",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantRequestDto"
              },
              "example": "kaunttenant"
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantRequestDto"
              },
              "example": "kaunttenant"
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TenantRequestDto"
              },
              "example": "kaunttenant"
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "List tenants",
        "description": "Returns a paginated list of tenants belonging to the partner.",
        "operationId": "Retrieve Tenants",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The number of tenants to return per page",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 10
          },
          {
            "name": "pageNo",
            "in": "query",
            "description": "The page number to retrieve",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 1
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDtoViewPage"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}": {
      "delete": {
        "tags": [
          "Tenants"
        ],
        "summary": "Soft-delete tenant",
        "description": "Marks the tenant for deletion. Actual deletion occurs after 24 hours.",
        "operationId": "Soft Delete Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get tenant",
        "description": "Retrieves detailed information about a specific tenant.",
        "operationId": "Retrieve Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/postingtextsettings": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get posting text settings",
        "description": "Returns the effective posting text settings for the tenant.\nIf the tenant has no explicit override, the partner-level default is returned.",
        "operationId": "Get Posting Text Settings",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingTextSettingsResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Update posting text settings",
        "description": "Updates the posting text settings for a tenant. Set PostingTextType to null to clear the override and inherit the partner-level setting.",
        "operationId": "Update Posting Text Settings",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "requestBody": {
          "description": "The posting text settings",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostingTextSettingsRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostingTextSettingsRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostingTextSettingsRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingTextSettingsResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/dataretention": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get data retention policy",
        "description": "Returns the effective data retention policy for the tenant. Falls back to the partner policy, then the system default.",
        "operationId": "Get Data Retention Policy",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRetentionPolicyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Set data retention policy",
        "description": "Sets or updates the data retention policy for a specific tenant. Overrides the partner-level policy.",
        "operationId": "Set Data Retention Policy For Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "requestBody": {
          "description": "The data retention policy",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataRetentionPolicyRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DataRetentionPolicyRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DataRetentionPolicyRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataRetentionPolicyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/webhooklogs": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get webhook logs",
        "description": "Returns a paginated list of webhook delivery attempts for the tenant.",
        "operationId": "Get Webhook Logs",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The number of logs to retrieve per page",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 20
          },
          {
            "name": "pageNo",
            "in": "query",
            "description": "The page number to retrieve",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 1
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCallResponseDtoViewPage"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/consumption/services": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get tenant services consumption",
        "description": "Retrieves services consumption data (proposals, document AI, form recognizer) for a specific tenant within a specified date range.",
        "operationId": "Get Tenant Services Consumption",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          {
            "name": "from",
            "in": "query",
            "description": "The start date of the range. Format YYYY-MM-DD. Inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          },
          {
            "name": "to",
            "in": "query",
            "description": "The end date of the range. Format YYYY-MM-DD. Inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2027-01-01"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantServicesConsumptionResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/tenants/{tenantId}/smartallocationsettings": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Get smart allocation settings for a tenant (resolves inheritance from partner)",
        "operationId": "Get Smart Allocation Settings For Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartAllocationSettingsResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Set smart allocation settings for a tenant (set null to inherit from partner)",
        "operationId": "Set Smart Allocation Settings For Tenant",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "tenantId",
            "in": "path",
            "description": "The id of the tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          }
        ],
        "requestBody": {
          "description": "The smart allocation settings",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartAllocationSettingsRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartAllocationSettingsRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SmartAllocationSettingsRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartAllocationSettingsResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/users": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete user",
        "description": "Removes a user from the partner organization by their email address.",
        "operationId": "Delete Users",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "emailAddress",
            "in": "query",
            "description": "The email address of the user to delete",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "kaunt@kaunt.com"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Invite user",
        "description": "Sends an invitation to a user to join the partner organization with the specified role.",
        "operationId": "Invite Users",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The user invitation details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List users",
        "description": "Returns all users associated with the partner, including their roles and invitation status.",
        "operationId": "Get Users",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerWithUsersResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update user role",
        "description": "Updates the role of an existing user within the partner organization.",
        "operationId": "Update Users",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The user details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create webhook",
        "description": "Creates a new webhook for the partner. If no API environment is specified, defaults to Production. Optionally scope the webhook to a specific tenant.",
        "operationId": "Create Webhook",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "requestBody": {
          "description": "The webhook details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequestDto"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "description": "Returns all webhooks configured for the partner, including tenant-scoped webhooks.",
        "operationId": "List Webhooks",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerWithWebhooksResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/partners/{partnerId}/webhooks/{webhookId}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete webhook",
        "description": "Permanently deletes the specified webhook. This action cannot be undone.",
        "operationId": "Delete Webhook",
        "parameters": [
          {
            "name": "partnerId",
            "in": "path",
            "description": "The id of the partner",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "The id of the webhook to delete",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57df86a8-154e-4633-bb2d-d941659cf261"
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "APIEnvironment": {
        "enum": [
          "Sandbox",
          "Production"
        ],
        "type": "string"
      },
      "APIKey": {
        "required": [
          "apiEnvironment",
          "clientId",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The client ID of the API key",
            "example": "64ab81fc-70dc-4e28-b841-6bc091f1f258"
          },
          "name": {
            "type": "string",
            "description": "The name given to the API key",
            "nullable": true,
            "example": "PROD1"
          },
          "createdAt": {
            "type": "string",
            "description": "The timestamp of when the API key was created",
            "format": "date-time",
            "example": "2025-01-15T09:30:00"
          },
          "apiEnvironment": {
            "$ref": "#/components/schemas/APIEnvironment"
          }
        },
        "additionalProperties": false,
        "description": "Represents an individual API key associated with a tenant."
      },
      "APIKeyResponseDto": {
        "required": [
          "apiEnvironment",
          "clientId",
          "clientSecret"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "Client ID of the API Key",
            "example": "64ab81fc-70dc-4e28-b841-6bc091f1f258"
          },
          "name": {
            "type": "string",
            "description": "Name of the API Key",
            "nullable": true,
            "example": "PROD1"
          },
          "clientSecret": {
            "type": "string",
            "description": "Client secret. Make sure to keep this secure. The secret will only be shown once."
          },
          "apiEnvironment": {
            "$ref": "#/components/schemas/APIEnvironment"
          }
        },
        "additionalProperties": false,
        "description": "Response containing the details of an API key, including the client secret."
      },
      "ClientDto": {
        "required": [
          "clientId",
          "name"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The unique client identifier of the M2M application.",
            "example": "abc123def456"
          },
          "name": {
            "type": "string",
            "description": "The display name of the M2M client.",
            "example": "My M2M Client"
          },
          "secretRotatedAt": {
            "type": "string",
            "description": "The date and time when the client secret was last rotated, or null if never rotated.",
            "format": "date-time",
            "nullable": true,
            "example": "2025-06-15T10:30:00+00:00"
          }
        },
        "additionalProperties": false,
        "description": "Represents an individual M2M OAuth2 client credential."
      },
      "CompanyDto": {
        "required": [
          "companyId",
          "companyName"
        ],
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "description": "The name of the company."
          },
          "companyId": {
            "type": "string",
            "description": "The unique identifier of the company."
          }
        },
        "additionalProperties": false,
        "description": "DTO representing a company."
      },
      "DailyTrendResponseDto": {
        "required": [
          "date"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The date for the trend data point.",
            "format": "date-time"
          },
          "total": {
            "type": "integer",
            "description": "The total value for the trend data point on the specified date.",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "DataRetentionPolicyRequestDto": {
        "required": [
          "retentionDuration"
        ],
        "type": "object",
        "properties": {
          "retentionDuration": {
            "minLength": 1,
            "pattern": "^P(\\d+Y)?(\\d+M)?(\\d+D)?$",
            "type": "string",
            "description": "The retention duration for the data in ISO 8601 format.",
            "example": "P2Y"
          }
        },
        "additionalProperties": false,
        "description": "Request to create or update a data retention policy for a partner or tenant."
      },
      "DataRetentionPolicyResponseDto": {
        "required": [
          "retentionDuration"
        ],
        "type": "object",
        "properties": {
          "retentionDuration": {
            "type": "string",
            "description": "The retention duration for the data in ISO 8601 format.",
            "example": "P2Y"
          }
        },
        "additionalProperties": false,
        "description": "Response containing the data retention policy settings for a tenant."
      },
      "DimensionDto": {
        "required": [
          "externalDimensionId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "externalDimensionId": {
            "type": "string"
          },
          "externalDimensionName": {
            "type": "string",
            "nullable": true
          },
          "isBlocked": {
            "type": "boolean"
          },
          "dimensionType": {
            "$ref": "#/components/schemas/DimensionType"
          },
          "dimensionValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionValueDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DimensionPageDto": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "previousPage": {
            "type": "string",
            "nullable": true
          },
          "nextPage": {
            "type": "string",
            "nullable": true
          },
          "currentPage": {
            "type": "integer",
            "format": "int32"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DimensionPerformanceDto": {
        "required": [
          "dimensionName"
        ],
        "type": "object",
        "properties": {
          "dimensionName": {
            "type": "string",
            "description": "The name of the dimension."
          },
          "highPerformancePercentage": {
            "type": "number",
            "description": "The percentage of high confidence coding proposals for the dimension.",
            "format": "float"
          },
          "mediumPerformancePercentage": {
            "type": "number",
            "description": "The percentage of medium confidence coding proposals for the dimension.",
            "format": "float"
          },
          "lowPerformancePercentage": {
            "type": "number",
            "description": "The percentage of low confidence coding proposals for the dimension.",
            "format": "float"
          }
        },
        "additionalProperties": false,
        "description": "Details about the performance of a specific dimension."
      },
      "DimensionPrecisionDto": {
        "required": [
          "confidenceLevel",
          "dimensionName"
        ],
        "type": "object",
        "properties": {
          "dimensionName": {
            "type": "string",
            "description": "The name of the dimension."
          },
          "confidenceLevel": {
            "type": "string",
            "description": "The confidence level of the precision metric (e.g., High, Medium, Low)."
          },
          "sampleSize": {
            "type": "integer",
            "description": "The number of samples used to calculate the precision.",
            "format": "int32"
          },
          "precision": {
            "type": "number",
            "description": "The precision percentage for the dimension and confidence level.\n\nA value between 0 and 100 representing the accuracy of coding proposals.",
            "format": "float"
          }
        },
        "additionalProperties": false,
        "description": "Details about the precision of a specific dimension."
      },
      "DimensionType": {
        "enum": [
          "DependentDimension",
          "IndependentDimension",
          "OptionalIndependentDimension"
        ],
        "type": "string"
      },
      "DimensionValueDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "externalDimensionValueId": {
            "type": "string",
            "nullable": true
          },
          "externalDimensionValueName": {
            "type": "string",
            "nullable": true
          },
          "isBlocked": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "DocumentAIPagesConsumedInfo": {
        "required": [
          "pagesConsumedFromApi",
          "pagesConsumedFromInvoiceCodingProposalRequests",
          "pagesConsumedFromPostedInvoiceRequests",
          "totalPagesConsumed"
        ],
        "type": "object",
        "properties": {
          "pagesConsumedFromApi": {
            "type": "integer",
            "description": "The number of pages consumed from API requests",
            "format": "int64"
          },
          "pagesConsumedFromPostedInvoiceRequests": {
            "type": "integer",
            "description": "The number of pages consumed from posted invoice requests",
            "format": "int64"
          },
          "pagesConsumedFromInvoiceCodingProposalRequests": {
            "type": "integer",
            "description": "The number of pages consumed from invoice coding proposal requests",
            "format": "int64"
          },
          "totalPagesConsumed": {
            "type": "integer",
            "description": "Total pages consumed across all sources",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ErrorResponse": {
        "required": [
          "errorMessage"
        ],
        "type": "object",
        "properties": {
          "errorMessage": {
            "type": "string",
            "description": "A human-readable description of the error.",
            "example": "Resource not found"
          }
        },
        "additionalProperties": false,
        "description": "Standard error response returned by the API when a request fails."
      },
      "InviteUserRequestDto": {
        "required": [
          "emailAddress",
          "role"
        ],
        "type": "object",
        "properties": {
          "emailAddress": {
            "minLength": 1,
            "type": "string",
            "description": "Email address to invite",
            "format": "email",
            "example": "user@example.com"
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          }
        },
        "additionalProperties": false,
        "description": "Request to invite a user to a partner organization."
      },
      "InvoiceCodingCountDto": {
        "type": "object",
        "properties": {
          "totalProposals": {
            "type": "integer",
            "description": "The total number of invoice coding proposals.",
            "format": "int32"
          },
          "totalPostings": {
            "type": "integer",
            "description": "The total number of postings.",
            "format": "int32"
          },
          "totalInvoices": {
            "type": "integer",
            "description": "The total number of invoices.",
            "format": "int32"
          },
          "lastProposalReceivedTime": {
            "type": "string",
            "description": "The timestamp of the last received proposal.",
            "format": "date-time",
            "nullable": true
          },
          "lastPostingReceivedTime": {
            "type": "string",
            "description": "The timestamp of the last received posting.",
            "format": "date-time",
            "nullable": true
          },
          "lastInvoiceReceivedTime": {
            "type": "string",
            "description": "The timestamp of the last received invoice.",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO representing counts and timestamps related to invoice coding."
      },
      "InvoiceCodingDimensionPrecisionDto": {
        "required": [
          "dimensionPrecisions",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The start date of the precision period (inclusive).",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "description": "The end date of the precision period (inclusive).",
            "format": "date-time"
          },
          "dimensionPrecisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionPrecisionDto"
            },
            "description": "The list of dimension precisions within the specified period."
          }
        },
        "additionalProperties": false,
        "description": "DTO representing the precision of invoice coding dimension proposals over a specified period."
      },
      "InvoiceCodingDimensionProposalPerformanceDto": {
        "required": [
          "dimensionPerformances",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The start date of the performance period (inclusive).",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "description": "The end date of the performance period (inclusive).",
            "format": "date-time"
          },
          "dimensionPerformances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionPerformanceDto"
            },
            "description": "The list of dimension performances within the specified period."
          }
        },
        "additionalProperties": false,
        "description": "DTO representing the performance of invoice coding dimension proposals over a specified period."
      },
      "InvoiceCodingProposalTrendDto": {
        "required": [
          "dailyTrends",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The start date of the trend data range (inclusive).",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "description": "The end date of the trend data range (inclusive).",
            "format": "date-time"
          },
          "dailyTrends": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailyTrendResponseDto"
            },
            "description": "A list of daily trend data points within the specified date range."
          }
        },
        "additionalProperties": false,
        "description": "DTO representing trends in invoice coding proposals."
      },
      "KauntPostingTextSettingsEnum": {
        "enum": [
          "LINE_ITEM_TEXT",
          "OPENAI_GPT35_TURBO_KAUNT_CATEGORY",
          "CONTEXT_LEARNED"
        ],
        "type": "string"
      },
      "KauntRegionEnum": {
        "enum": [
          "EU1_FRANCE",
          "US1_ARIZONA"
        ],
        "type": "string"
      },
      "PartnerClientsResponseDto": {
        "required": [
          "clients"
        ],
        "type": "object",
        "properties": {
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientDto"
            },
            "description": "The list of M2M clients belonging to the partner."
          }
        },
        "additionalProperties": false,
        "description": "Response containing a list of M2M OAuth2 clients associated with a partner."
      },
      "PartnerResponseDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the partner",
            "example": "Kaunt"
          },
          "id": {
            "type": "string",
            "description": "UUID of the partner",
            "example": "92f74e96-a654-47e2-84c8-7a8843cda443"
          }
        },
        "additionalProperties": false,
        "description": "Response representing a partner within the Kaunt platform."
      },
      "PartnerWithUsersResponseDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the partner",
            "example": "Kaunt"
          },
          "id": {
            "type": "string",
            "description": "UUID of the partner",
            "example": "92f74e96-a654-47e2-84c8-7a8843cda443"
          },
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponseDto"
            },
            "description": "List of users associated with the partner"
          }
        },
        "additionalProperties": false,
        "description": "Response representing a partner along with its associated users."
      },
      "PartnerWithWebhooksResponseDto": {
        "required": [
          "id",
          "name",
          "partnerWebhooks",
          "tenantWebhooks"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the partner",
            "example": "Kaunt"
          },
          "id": {
            "type": "string",
            "description": "UUID of the partner",
            "example": "92f74e96-a654-47e2-84c8-7a8843cda443"
          },
          "partnerWebhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookResponseDto"
            },
            "description": "List of webhooks associated with the partner"
          },
          "tenantWebhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantsWithWebhooksReponseDto"
            },
            "description": "List of tenants with their associated webhooks"
          }
        },
        "additionalProperties": false,
        "description": "Response representing a partner along with its partner-level and tenant-level webhooks."
      },
      "PostingTextSettingsRequestDto": {
        "type": "object",
        "properties": {
          "postingTextType": {
            "$ref": "#/components/schemas/KauntPostingTextSettingsEnum"
          }
        },
        "additionalProperties": false
      },
      "PostingTextSettingsResponseDto": {
        "required": [
          "postingTextType"
        ],
        "type": "object",
        "properties": {
          "postingTextType": {
            "type": "string",
            "description": "The posting text type for the tenant",
            "example": "InvoiceNumber"
          }
        },
        "additionalProperties": false,
        "description": "Response containing the posting text settings for a tenant."
      },
      "PrecisionPerformancePeriodEnum": {
        "enum": [
          "PastMonth",
          "Past3Months",
          "Past6Months",
          "PastYear"
        ],
        "type": "string"
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "Role": {
        "enum": [
          "PartnerPlatformOwner",
          "BasicPlatformUser"
        ],
        "type": "string"
      },
      "RotateCredentialSecretResponseDto": {
        "required": [
          "clientId",
          "clientSecret"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The client ID of the M2M application.",
            "example": "abc123def456"
          },
          "clientSecret": {
            "type": "string",
            "description": "The new client secret. Store this securely — it cannot be retrieved again."
          }
        },
        "additionalProperties": false,
        "description": "Response containing the new client secret after a credential rotation."
      },
      "ServicesConsumptionResponseDto": {
        "required": [
          "documentAI",
          "formRecognizerPagesConsumed",
          "from",
          "id",
          "name",
          "to",
          "totalProposals"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier of the partner"
          },
          "name": {
            "type": "string",
            "description": "The name of the partner"
          },
          "from": {
            "type": "string",
            "description": "The start date of the range. Format YYYY-MM-DD. Inclusive",
            "format": "date"
          },
          "to": {
            "type": "string",
            "description": "The end date of the range. Format YYYY-MM-DD. Inclusive",
            "format": "date"
          },
          "totalProposals": {
            "type": "integer",
            "description": "The total number of invoice coding proposals created",
            "format": "int64"
          },
          "formRecognizerPagesConsumed": {
            "type": "integer",
            "description": "The number of Azure Form Recognizer pages consumed",
            "format": "int64"
          },
          "documentAI": {
            "$ref": "#/components/schemas/DocumentAIPagesConsumedInfo"
          }
        },
        "additionalProperties": false,
        "description": "Response DTO for services consumption data (proposals, document AI, form recognizer).\nCombines what was previously separate AI coding and document AI consumption endpoints."
      },
      "SmartAllocationSettingsRequestDto": {
        "type": "object",
        "properties": {
          "isEnabled": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SmartAllocationSettingsResponseDto": {
        "type": "object",
        "properties": {
          "isEnabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TenantApiKeysResponseDto": {
        "required": [
          "id",
          "name",
          "region"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the tenant",
            "example": "KauntTenant"
          },
          "id": {
            "type": "string",
            "description": "UUID of the tenant",
            "example": "75de5c95-4a0c-4fee-8811-434a9ecd7e79"
          },
          "region": {
            "$ref": "#/components/schemas/KauntRegionEnum"
          },
          "markedForDeletion": {
            "type": "boolean",
            "description": " Indicates whether the tenant is marked for deletion.\nThis property is used to track tenants that are scheduled for removal from the system.\nWhen set to true, it signifies that the tenant is in the process of being deleted\nand should not be used for any further operations.",
            "example": false
          },
          "disabledModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of disabled models for the tenant."
          },
          "apiKeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/APIKey"
            },
            "description": "The collection of API keys associated with the tenant."
          }
        },
        "additionalProperties": false,
        "description": "Response containing a tenant's details along with its associated API keys."
      },
      "TenantRequestDto": {
        "required": [
          "name",
          "region"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Name of the tenant",
            "example": "KauntTenant"
          },
          "region": {
            "minLength": 1,
            "type": "string",
            "description": "The region of the tenant. The region is used to determine the location of the tenant's data.",
            "example": "EU1_FRANCE"
          }
        },
        "additionalProperties": false,
        "description": "Request to create or update a tenant within a partner organization."
      },
      "TenantResponseDto": {
        "required": [
          "id",
          "name",
          "region"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the tenant",
            "example": "KauntTenant"
          },
          "id": {
            "type": "string",
            "description": "UUID of the tenant",
            "example": "75de5c95-4a0c-4fee-8811-434a9ecd7e79"
          },
          "region": {
            "$ref": "#/components/schemas/KauntRegionEnum"
          },
          "markedForDeletion": {
            "type": "boolean",
            "description": " Indicates whether the tenant is marked for deletion.\nThis property is used to track tenants that are scheduled for removal from the system.\nWhen set to true, it signifies that the tenant is in the process of being deleted\nand should not be used for any further operations.",
            "example": false
          },
          "disabledModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of disabled models for the tenant."
          }
        },
        "additionalProperties": false,
        "description": "Response representing a tenant within the Kaunt platform."
      },
      "TenantResponseDtoViewPage": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "integer",
            "description": "Number of entries in the returned resultset",
            "format": "int32",
            "example": 5
          },
          "previousPage": {
            "type": "string",
            "description": "URL of the previous page",
            "nullable": true,
            "example": "https://api.kaunt.com/v1/resources?page=1"
          },
          "nextPage": {
            "type": "string",
            "description": "URL of the next page",
            "nullable": true,
            "example": "https://api.kaunt.com/v1/resources?page=3"
          },
          "currentPage": {
            "type": "integer",
            "description": "Index of the current page",
            "format": "int32",
            "example": 2
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantResponseDto"
            },
            "description": "Collection of the response DTO model instances.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A paginated view of a collection of items."
      },
      "TenantServicesConsumptionItemDto": {
        "required": [
          "documentAI",
          "formRecognizerPagesConsumed",
          "region",
          "tenantId",
          "tenantName",
          "totalProposals"
        ],
        "type": "object",
        "properties": {
          "region": {
            "$ref": "#/components/schemas/KauntRegionEnum"
          },
          "tenantId": {
            "type": "string",
            "description": "The unique identifier of the tenant",
            "format": "uuid"
          },
          "tenantName": {
            "type": "string",
            "description": "The name of the tenant"
          },
          "totalProposals": {
            "type": "integer",
            "description": "The total number of invoice coding proposals created",
            "format": "int64"
          },
          "formRecognizerPagesConsumed": {
            "type": "integer",
            "description": "The number of Azure Form Recognizer pages consumed",
            "format": "int64"
          },
          "documentAI": {
            "$ref": "#/components/schemas/DocumentAIPagesConsumedInfo"
          }
        },
        "additionalProperties": false
      },
      "TenantServicesConsumptionListResponseDto": {
        "required": [
          "currentPage",
          "from",
          "hasNextPage",
          "partnerId",
          "tenants",
          "to"
        ],
        "type": "object",
        "properties": {
          "partnerId": {
            "type": "string",
            "description": "The unique identifier of the partner"
          },
          "from": {
            "type": "string",
            "description": "The start date of the range. Format YYYY-MM-DD. Inclusive",
            "format": "date"
          },
          "to": {
            "type": "string",
            "description": "The end date of the range. Format YYYY-MM-DD. Inclusive",
            "format": "date"
          },
          "currentPage": {
            "type": "integer",
            "description": "The current page number",
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean",
            "description": "Whether there are more pages available"
          },
          "tenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantServicesConsumptionItemDto"
            },
            "description": "The list of tenant services consumption data"
          }
        },
        "additionalProperties": false,
        "description": "Paginated response DTO containing tenant services consumption data."
      },
      "TenantServicesConsumptionResponseDto": {
        "required": [
          "documentAI",
          "formRecognizerPagesConsumed",
          "from",
          "tenantId",
          "tenantName",
          "to",
          "totalProposals"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The unique identifier of the tenant",
            "format": "uuid"
          },
          "tenantName": {
            "type": "string",
            "description": "The name of the tenant"
          },
          "from": {
            "type": "string",
            "description": "The start date of the range. Format YYYY-MM-DD. Inclusive",
            "format": "date"
          },
          "to": {
            "type": "string",
            "description": "The end date of the range. Format YYYY-MM-DD. Inclusive",
            "format": "date"
          },
          "totalProposals": {
            "type": "integer",
            "description": "The total number of invoice coding proposals created",
            "format": "int64"
          },
          "formRecognizerPagesConsumed": {
            "type": "integer",
            "description": "The number of Azure Form Recognizer pages consumed",
            "format": "int64"
          },
          "documentAI": {
            "$ref": "#/components/schemas/DocumentAIPagesConsumedInfo"
          }
        },
        "additionalProperties": false,
        "description": "Response DTO for single tenant services consumption data."
      },
      "TenantsWithWebhooksReponseDto": {
        "required": [
          "id",
          "name",
          "region",
          "webhooks"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the tenant",
            "example": "KauntTenant"
          },
          "id": {
            "type": "string",
            "description": "UUID of the tenant",
            "example": "75de5c95-4a0c-4fee-8811-434a9ecd7e79"
          },
          "region": {
            "$ref": "#/components/schemas/KauntRegionEnum"
          },
          "markedForDeletion": {
            "type": "boolean",
            "description": " Indicates whether the tenant is marked for deletion.\nThis property is used to track tenants that are scheduled for removal from the system.\nWhen set to true, it signifies that the tenant is in the process of being deleted\nand should not be used for any further operations.",
            "example": false
          },
          "disabledModels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of disabled models for the tenant."
          },
          "webhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookResponseDto"
            },
            "description": "The collection of webhooks associated with the tenant."
          }
        },
        "additionalProperties": false,
        "description": "Response representing a tenant along with its associated webhooks."
      },
      "UpdateDimensionRequest": {
        "type": "object",
        "properties": {
          "isBlocked": {
            "type": "boolean",
            "description": "Indicates whether the dimension is blocked from further use.",
            "nullable": true,
            "example": true
          },
          "dimensionType": {
            "$ref": "#/components/schemas/DimensionType"
          }
        },
        "additionalProperties": false,
        "description": "Request to update the properties of an existing dimension."
      },
      "UserResponseDto": {
        "required": [
          "email",
          "roles"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the user",
            "nullable": true,
            "example": "KauntUser"
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "kaunt@kaunt.com"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Role",
            "example": "PartnerPlatformOwner"
          }
        },
        "additionalProperties": false,
        "description": "Response representing a user within the Kaunt platform."
      },
      "WebhookCallResponseDto": {
        "required": [
          "calledAt",
          "correlationId",
          "eventType",
          "tenantId",
          "webhookId",
          "webhookRequestId",
          "webhookUrl"
        ],
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "description": "The name of the company.",
            "nullable": true
          },
          "tenantId": {
            "type": "string",
            "description": "The unique identifier of the tenant."
          },
          "correlationId": {
            "type": "string",
            "description": "The correlation ID associated with the webhook call.",
            "format": "uuid"
          },
          "webhookId": {
            "type": "string",
            "description": "The unique identifier of the webhook.",
            "format": "uuid"
          },
          "webhookRequestId": {
            "type": "string",
            "description": "The unique identifier of the webhook request.",
            "format": "uuid"
          },
          "webhookUrl": {
            "type": "string",
            "description": "The URL of the webhook."
          },
          "eventType": {
            "type": "string",
            "description": "The type of event that triggered the webhook."
          },
          "calledAt": {
            "type": "string",
            "description": "The timestamp when the webhook was called.",
            "format": "date-time"
          },
          "attemptNumber": {
            "type": "integer",
            "description": "The attempt number of the webhook call.",
            "format": "int32"
          },
          "responseTimeMilliseconds": {
            "type": "integer",
            "description": "The response time of the webhook call in milliseconds.",
            "format": "int32"
          },
          "httpResponseStatusCode": {
            "type": "integer",
            "description": "The HTTP response status code returned by the webhook.",
            "format": "int32",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "description": "The error message returned by the webhook, if any.",
            "nullable": true
          },
          "isSuccess": {
            "type": "boolean",
            "description": "Indicates whether the webhook call was successful."
          }
        },
        "additionalProperties": false,
        "description": "DTO representing a webhook call attempt and its details."
      },
      "WebhookCallResponseDtoViewPage": {
        "type": "object",
        "properties": {
          "currentPage": {
            "type": "integer",
            "description": "Index of the current page",
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookCallResponseDto"
            },
            "description": "Collection of the response DTO model instances.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebhookRequestDto": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL of the webhook",
            "example": "https://foo.com/webhooks/bar"
          },
          "description": {
            "type": "string",
            "description": "Description of the webhook",
            "nullable": true,
            "example": "Webhook for X production"
          },
          "tenantId": {
            "type": "string",
            "description": "TenantId where the webhook belongs",
            "nullable": true,
            "example": "05ed0ffa-1bf5-4bd1-9970-df7a78a948fe"
          },
          "apiEnvironment": {
            "type": "string",
            "description": "API Environment where the webhook belongs",
            "nullable": true,
            "example": "Production"
          }
        },
        "additionalProperties": false,
        "description": "Request to create a webhook subscription for a partner, optionally scoped to a specific tenant."
      },
      "WebhookResponseDto": {
        "required": [
          "apiEnvironment",
          "id",
          "signingSecretKey",
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL of the webhook",
            "example": "https://foo.com/webhooks/bar"
          },
          "description": {
            "type": "string",
            "description": "Description of the webhook",
            "nullable": true,
            "example": "Webhook for X production"
          },
          "id": {
            "type": "string",
            "description": "UUID of the webhook",
            "format": "uuid",
            "example": "92f74e96-a654-47e2-84c8-7a8843cda443"
          },
          "apiEnvironment": {
            "$ref": "#/components/schemas/APIEnvironment"
          },
          "signingSecretKey": {
            "type": "string",
            "description": "Signature key secret",
            "example": "92f74e96a65447e284c87a8843cda443"
          }
        },
        "additionalProperties": false,
        "description": "Response representing a webhook configuration, including its environment and signing secret."
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Please enter a valid token",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "APIKeys"
    },
    {
      "name": "Companies"
    },
    {
      "name": "Dimensions"
    },
    {
      "name": "Insights"
    },
    {
      "name": "Partners"
    },
    {
      "name": "Tenants"
    },
    {
      "name": "Users"
    },
    {
      "name": "Webhooks"
    }
  ]
}