{
  "openapi": "3.0.4",
  "info": {
    "title": "CHILI GraFx Platform",
    "description": "API allowing integration with the CHILI GraFx Platform.",
    "version": "v1"
  },
  "paths": {
    "/api/v1/info": {
      "get": {
        "tags": [
          "Info"
        ],
        "summary": "Gets information about API.",
        "responses": {
          "200": {
            "description": "Returns information about API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InfoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/environments/{environmentId}": {
      "get": {
        "tags": [
          "Environments"
        ],
        "summary": "Get environment information.",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "description": "Environment Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "0bfb98c6-4219-421e-9a99-8c8a959f21a9"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns environment information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentModel"
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If environment with such Id is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/environments/{environmentId}/renders": {
      "get": {
        "tags": [
          "Environments"
        ],
        "summary": "Get environment SaaS and Studio renders information.",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "description": "Environment Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "304ea69b-8bbd-4527-bc09-c83bbc185b66"
          },
          {
            "name": "groupBy",
            "in": "query",
            "description": "Groups render information.\nFor `year` returns renders for last 12 months and groups renders by each month.\nFor `month` returns renders for last 30 days and groups renders by each day.\nThese ranges can be overwritten by providing both `startDate` and `endDate` parameters.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "year"
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date of the range from which to return the renders. Required if `endDate` is provided. Format: yyyy-MM-dd.",
            "schema": {
              "type": "string"
            },
            "example": "2000-12-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date of the range from which to return the renders. Required if `startDate` is provided. Format: yyyy-MM-dd.",
            "schema": {
              "type": "string"
            },
            "example": "2022-12-01"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns environment renders information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EnvironmentRenderModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "If groupBy is missing or one of the params has incorrect format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
                  "title": "Bad Request",
                  "status": 400,
                  "detail": "Problem details"
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If environment with such Id is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/environments": {
      "get": {
        "tags": [
          "Environments"
        ],
        "summary": "Get environments under specified subscription.",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "query",
            "description": "Specifies ID of the subscription to read environments from.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "56be7a1e-1b97-498d-8a28-8b1d854ee488"
          },
          {
            "name": "environmentName",
            "in": "query",
            "description": "Specifies environment name to search for.",
            "schema": {
              "type": "string"
            },
            "example": "cp-000-000"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns environments under specified subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BasicEnvironmentModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If subscription with such ID is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscriptions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get all existing subscriptions.",
        "responses": {
          "200": {
            "description": "Returns array of subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BasicSubscriptionModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscriptions/{subscriptionId}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get detailed information about subscription.",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "5e9ce7a7-7d0b-4bbb-a23f-51445aa2cceb"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionModel"
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If subscription not found for the authenticated user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscriptions/{subscriptionId}/renders": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get environments render information included in the subscription.",
        "description": "All environments under that subscription are returned in the specific order by the environment type\n(Production, Sandbox, Development) and then by the descending order based on renders amount.",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "7438213e-aa04-41ad-a6ee-e3f6fce6499f"
          },
          {
            "name": "groupBy",
            "in": "query",
            "description": "Groups render information.\nFor `year` returns renders for last 12 months and groups renders by each month.\nFor `month` returns renders for last 30 days and groups renders by each day.\nThese ranges can be overwritten by providing both `startDate` and `endDate` parameters.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "year"
          },
          {
            "name": "top",
            "in": "query",
            "description": "When top parameter is provided, the information for the `top` number of environments with higher number\nof renders is returned and for all the rest of existing environments in the subscription the renders are\nconcatenated under \"Others\".",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "example": 4
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date of the range from which to return the renders. Required if `endDate` is provided. Format: yyyy-MM-dd.",
            "schema": {
              "type": "string"
            },
            "example": "2000-12-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date of the range from which to return the renders. Required if `startDate` is provided. Format: yyyy-MM-dd.",
            "schema": {
              "type": "string"
            },
            "example": "2022-12-01"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns array of environments render details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SubscriptionRendersModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "If groupBy is missing or one of the params has incorrect format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
                  "title": "Bad Request",
                  "status": 400,
                  "detail": "Problem details"
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If subscription with this id is not found for the authenticated user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscriptions/{subscriptionId}/users": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get users that use the subscription with their individual access permissions.",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "56be7a1e-1b97-498d-8a28-8b1d854ee488"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns array of user details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If subscription with this id is not found for the authenticated user.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscriptions/{subscriptionId}/users/{userId}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get a user under specified subscription.",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "56be7a1e-1b97-498d-8a28-8b1d854ee488"
          },
          {
            "name": "userId",
            "in": "path",
            "description": "User Id.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "auth0|630f8c2b524936fea93c0e75"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a user under specified subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionUserModel"
                }
              }
            }
          },
          "400": {
            "description": "If `subscriptionId` or `userId` are missing or have incorrect format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
                  "title": "Bad Request",
                  "status": 400,
                  "detail": "Problem details"
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If subscription or user are not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscriptions/{subscriptionId}/external-idp-domains": {
      "put": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Configure 3rd party domains allowed in subscription.",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription Id.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "56be7a1e-1b97-498d-8a28-8b1d854ee488"
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "example": "['eu.example.com','sample.net']"
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "If `subscriptionId` is incorrect or provided domains have incorrect format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
                  "title": "Bad Request",
                  "status": 400,
                  "detail": "Problem details"
                }
              }
            }
          },
          "401": {
            "description": "If bearer token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/401",
                  "title": "Unauthorized",
                  "status": 401,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "403": {
            "description": "If a user does not have required role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://httpstatuses.io/403",
                  "title": "Forbidden",
                  "status": 403,
                  "traceId": "00-4c7122268e63dfb01f47bd1a23507588-13f1aab74314c293-00"
                }
              }
            }
          },
          "404": {
            "description": "If the subscription is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "Problem details"
                }
              }
            }
          },
          "200": {
            "description": "If an operation has been successful."
          }
        }
      }
    },
    "/api/ping": {
      "get": {
        "tags": [
          "Info"
        ],
        "summary": "Checks server availability.",
        "responses": {
          "200": {
            "description": "If server is available."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BasicEnvironmentModel": {
        "required": [
          "guid",
          "id",
          "name",
          "type",
          "usedStorage"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Environment Id.",
            "format": "int32",
            "example": 494
          },
          "guid": {
            "type": "string",
            "description": "Environment guid.",
            "format": "uuid",
            "example": "18a3ae5c-3bc5-42eb-b8d8-0307fbbbfea1"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Environment display name.",
            "example": "CHILI Team"
          },
          "region": {
            "type": "string",
            "description": "Environment region.",
            "nullable": true,
            "example": "westeurope"
          },
          "type": {
            "$ref": "#/components/schemas/EnvironmentType"
          },
          "usedStorage": {
            "type": "integer",
            "description": "Total environment used storage.",
            "format": "int64",
            "example": 1093314335
          },
          "backOfficeUri": {
            "type": "string",
            "description": "Backoffice URL.",
            "format": "uri",
            "nullable": true,
            "example": "https://cp-000-000.chili-publish-sandbox.online/cp-000-000/interface.aspx"
          },
          "technicalName": {
            "type": "string",
            "description": "Environment technical name.",
            "nullable": true,
            "example": "ch-01"
          }
        },
        "additionalProperties": false,
        "description": "Response model with the basic information about environment."
      },
      "BasicSubscriptionModel": {
        "required": [
          "clientId",
          "displayName",
          "guid",
          "id",
          "isActive",
          "isGraFxPricebook",
          "isWhitelabeled",
          "name",
          "pricebookVersion",
          "subscriptionType"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Subscription Id.",
            "format": "int32",
            "example": 44
          },
          "guid": {
            "type": "string",
            "description": "Subscription GUID.",
            "format": "uuid",
            "example": "d9aa2149-7f95-4ecc-ab2f-d6d12708f8da"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Subscription name.",
            "example": "CHILI - OnlineTrial"
          },
          "displayName": {
            "minLength": 1,
            "type": "string",
            "description": "Subscription display name.",
            "example": "Temporary subscription"
          },
          "isActive": {
            "type": "boolean",
            "description": "`true` if subscription is still active.",
            "example": true
          },
          "clientId": {
            "type": "string",
            "description": "Client GUID.",
            "format": "uuid",
            "example": "950c78e8-99c0-4681-98b3-a8b2ff11683c"
          },
          "clientName": {
            "type": "string",
            "description": "Client name.",
            "nullable": true,
            "example": "CHILI"
          },
          "isGraFxPricebook": {
            "type": "boolean",
            "description": "Flag which indicates if the subscription belongs to a GraFx pricebook.",
            "example": true
          },
          "subscriptionType": {
            "$ref": "#/components/schemas/SubscriptionType"
          },
          "pricebookVersion": {
            "minLength": 1,
            "type": "string",
            "description": "The pricebook version.",
            "example": "2025"
          },
          "isWhitelabeled": {
            "type": "boolean",
            "description": "Flag which indicates if the subscription is whitelabeled.",
            "example": false
          }
        },
        "additionalProperties": false,
        "description": "Response model with subscription information."
      },
      "EnvironmentModel": {
        "required": [
          "disableCpoToGraFxRedirect",
          "guid",
          "id",
          "isGraFxPricebook",
          "name",
          "renders",
          "subscriptionId",
          "type",
          "usedStorage",
          "usedStorageDetail",
          "watermarkedRenders"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Environment Id.",
            "format": "int32",
            "example": 494
          },
          "guid": {
            "type": "string",
            "description": "Environment Guid.",
            "format": "uuid",
            "example": "8c36fcf4-3b2d-4088-977a-3066af964c2d"
          },
          "backOfficeUri": {
            "type": "string",
            "description": "Backoffice URI",
            "format": "uri",
            "nullable": true,
            "example": "http://localhost/"
          },
          "subscriptionId": {
            "type": "string",
            "description": "Subscription id.",
            "format": "uuid",
            "example": "0bfb98c6-4219-421e-9a99-8c8a959f21a9"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Environment name.",
            "example": "cp-000-001"
          },
          "defaultName": {
            "type": "string",
            "description": "Environment default name.",
            "nullable": true,
            "example": "cp-000-001"
          },
          "type": {
            "$ref": "#/components/schemas/EnvironmentType"
          },
          "usedStorage": {
            "type": "integer",
            "description": "Total used storage in bytes.",
            "format": "int64",
            "example": 2048
          },
          "usedStorageDetail": {
            "$ref": "#/components/schemas/EnvironmentStorageInformationModel"
          },
          "tenantName": {
            "type": "string",
            "description": "Tenant name.",
            "nullable": true,
            "example": "Tenant"
          },
          "region": {
            "type": "string",
            "description": "Region name.",
            "nullable": true,
            "example": "westeurope"
          },
          "renders": {
            "type": "integer",
            "description": "Render count for environment.",
            "format": "int64",
            "example": 2500
          },
          "watermarkedRenders": {
            "type": "integer",
            "description": "Render count (watermarked) for environment.",
            "format": "int64",
            "example": 2500
          },
          "isGraFxPricebook": {
            "type": "boolean",
            "description": "Flag which indicates if the environment's subscription belongs to a GraFx pricebook.",
            "example": true
          },
          "disableCpoToGraFxRedirect": {
            "type": "boolean",
            "description": "Indicates whether CPO to GraFx redirect is disabled.",
            "example": true
          }
        },
        "additionalProperties": false,
        "description": "Response model with the information about environment used by user."
      },
      "EnvironmentRenderDetail": {
        "required": [
          "name",
          "renders"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Render name (`Pdf`, `Image`, 'Studio-Gif', etc).",
            "example": "Pdf"
          },
          "renders": {
            "type": "integer",
            "description": "Renders count.",
            "format": "int64",
            "example": 1024
          }
        },
        "additionalProperties": false,
        "description": "Response model with environment render detail."
      },
      "EnvironmentRenderInformation": {
        "required": [
          "renders",
          "watermarkedRenders"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Environment name.",
            "nullable": true,
            "example": "cp-itm-000"
          },
          "renders": {
            "type": "integer",
            "description": "Total count of render for environment.",
            "format": "int64",
            "example": 4680
          },
          "watermarkedRenders": {
            "type": "integer",
            "description": "Total count of render (watermarked) for environment.",
            "format": "int64",
            "example": 4680
          }
        },
        "additionalProperties": false,
        "description": "Response model with environment render details."
      },
      "EnvironmentRenderModel": {
        "required": [
          "date",
          "renderDetail",
          "totalRenders",
          "totalWatermarkedRenders"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Render date.",
            "format": "date-time",
            "example": "2021-11-01T00:00:00"
          },
          "totalRenders": {
            "type": "integer",
            "description": "Total renders count.",
            "format": "int64",
            "example": 2048
          },
          "totalWatermarkedRenders": {
            "type": "integer",
            "description": "Total renders (watermarked) count.",
            "format": "int64",
            "example": 2048
          },
          "renderDetail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnvironmentRenderDetail"
            },
            "description": "Render details."
          }
        },
        "additionalProperties": false,
        "description": "Response model with environment render information."
      },
      "EnvironmentStorageInformationModel": {
        "required": [
          "assets",
          "backup",
          "cache",
          "documents",
          "fonts",
          "other"
        ],
        "type": "object",
        "properties": {
          "assets": {
            "type": "integer",
            "description": "Used asset storage in bytes.",
            "format": "int64",
            "example": 1280
          },
          "documents": {
            "type": "integer",
            "description": "Used documents storage in bytes.",
            "format": "int64",
            "example": 3560
          },
          "fonts": {
            "type": "integer",
            "description": "Used fonts storage in bytes.",
            "format": "int64",
            "example": 1280
          },
          "cache": {
            "type": "integer",
            "description": "Used cache storage in bytes.",
            "format": "int64",
            "example": 2560
          },
          "backup": {
            "type": "integer",
            "description": "Used backup storage in bytes.",
            "format": "int64",
            "example": 5120
          },
          "other": {
            "type": "integer",
            "description": "Used other storage in bytes.",
            "format": "int64",
            "example": 10240
          }
        },
        "additionalProperties": false,
        "description": "Response model with detailed information about environment storage use."
      },
      "EnvironmentType": {
        "enum": [
          "Development",
          "Sandbox",
          "Production"
        ],
        "type": "string",
        "description": "Environment type."
      },
      "ExperienceExtensions": {
        "type": "object",
        "properties": {
          "isPlainlyEnabled": {
            "type": "boolean",
            "description": "Flag which indicates if the Plainly extension for Experience is enabled for the subscription.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Information about Experience extensions for the subscription."
      },
      "Info": {
        "required": [
          "serverVersion"
        ],
        "type": "object",
        "properties": {
          "serverVersion": {
            "minLength": 1,
            "type": "string",
            "description": "Current version of API.",
            "example": "1.0.0"
          }
        },
        "additionalProperties": false,
        "description": "Model used for providing technical information about API."
      },
      "InfoResponse": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Info"
          }
        },
        "additionalProperties": false,
        "description": "Response model used for providing the information about API."
      },
      "LicenseType": {
        "enum": [
          "Production",
          "Failover",
          "Sandbox"
        ],
        "type": "string",
        "description": "License type."
      },
      "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": { }
      },
      "SubscriptionEnvironmentModel": {
        "required": [
          "guid",
          "id",
          "usedStorage"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Environment Id.",
            "format": "int32",
            "example": 494
          },
          "guid": {
            "type": "string",
            "description": "Environment Guid.",
            "format": "uuid",
            "example": "432cf5d3-b432-4f32-b9dc-f8a14320aa0f"
          },
          "name": {
            "type": "string",
            "description": "Environment name.",
            "nullable": true,
            "example": "cp-eee-001"
          },
          "region": {
            "type": "string",
            "description": "Environment region.",
            "nullable": true,
            "example": "westeurope"
          },
          "type": {
            "$ref": "#/components/schemas/SubscriptionEnvironmentType"
          },
          "usedStorage": {
            "type": "integer",
            "description": "Total environment used storage.",
            "format": "int64",
            "example": 1093314335
          },
          "backOfficeUri": {
            "type": "string",
            "description": "Backoffice URL.",
            "format": "uri",
            "nullable": true,
            "example": "https://cp-000-000.chili-publish-sandbox.online/cp-000-000/interface.aspx"
          }
        },
        "additionalProperties": false,
        "description": "Response model with environment details included in subscription."
      },
      "SubscriptionEnvironmentType": {
        "enum": [
          "Development",
          "Sandbox",
          "Production"
        ],
        "type": "string",
        "description": "Environment type used in subscription."
      },
      "SubscriptionLicenseModel": {
        "required": [
          "coresUsed",
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string",
            "description": "License serial key",
            "example": "CPF-2022-0000001"
          },
          "coresTotal": {
            "type": "integer",
            "description": "Max cores amount",
            "format": "int32",
            "nullable": true,
            "example": 16
          },
          "coresUsed": {
            "type": "integer",
            "description": "Used cores amount",
            "format": "int32",
            "example": 2
          },
          "url": {
            "type": "string",
            "description": "Url to license information",
            "format": "uri",
            "nullable": true,
            "example": "https://chili-publish.com/Licenses/Details/00000000-0000-0000-0000-000000000000"
          },
          "licenseType": {
            "$ref": "#/components/schemas/LicenseType"
          }
        },
        "additionalProperties": false,
        "description": "Response model with license details included in subscription."
      },
      "SubscriptionMembershipType": {
        "enum": [
          "Invitation",
          "Federated"
        ],
        "type": "string"
      },
      "SubscriptionModel": {
        "required": [
          "averageRendersPeriodDays",
          "environments",
          "id",
          "isGraFxPricebook",
          "isPublisherEnabled",
          "isStudioEnabled",
          "isWhitelabeled",
          "maxTemplates",
          "overdueInvoices",
          "pricebookVersion",
          "status",
          "storageUsed",
          "subscriptionTier",
          "subscriptionType",
          "tenantInformation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Subscription Id.",
            "format": "int32",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Subscription name.",
            "nullable": true,
            "example": "CHILI (Online)"
          },
          "displayName": {
            "type": "string",
            "description": "Subscription name.",
            "nullable": true,
            "example": "Temporary subscription"
          },
          "usedRenders": {
            "type": "integer",
            "description": "Used renders.",
            "format": "int64",
            "nullable": true,
            "example": 1000
          },
          "usedWatermarkedRenders": {
            "type": "integer",
            "description": "Used renders (watermarked).",
            "format": "int64",
            "nullable": true,
            "example": 1000
          },
          "averageRenders": {
            "type": "integer",
            "description": "Average renders over the last CHILI.GraFx.Platform.API.Modules.Subscription.Models.SubscriptionModel.AverageRendersPeriodDays days.",
            "format": "int64",
            "nullable": true,
            "example": 1000
          },
          "averageWatermarkedRenders": {
            "type": "integer",
            "description": "Average renders (watermarked) over the last CHILI.GraFx.Platform.API.Modules.Subscription.Models.SubscriptionModel.AverageRendersPeriodDays days.",
            "format": "int64",
            "nullable": true,
            "example": 1000
          },
          "averageRendersPeriodDays": {
            "type": "integer",
            "description": "The number of days over which CHILI.GraFx.Platform.API.Modules.Subscription.Models.SubscriptionModel.AverageRenders and CHILI.GraFx.Platform.API.Modules.Subscription.Models.SubscriptionModel.AverageWatermarkedRenders\nare calculated.",
            "format": "int32",
            "example": 183
          },
          "maxRenders": {
            "type": "integer",
            "description": "Max renders available in subscription.",
            "format": "int64",
            "nullable": true,
            "example": 2500
          },
          "maxStorage": {
            "type": "integer",
            "description": "Max storage available in subscription in bytes.",
            "format": "int64",
            "nullable": true,
            "example": 250000000000
          },
          "storageUsed": {
            "type": "integer",
            "description": "Storage used in bytes.",
            "format": "int64",
            "example": 81959236
          },
          "environments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionEnvironmentModel"
            },
            "description": "Environments in subscription."
          },
          "licenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionLicenseModel"
            },
            "description": "Licenses assigned to the subscription.",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "description": "Subscription start date.",
            "nullable": true,
            "example": "11/12/2022 12:15:32 AM"
          },
          "endDate": {
            "type": "string",
            "description": "Subscription end date.",
            "nullable": true,
            "example": "11/12/2023 12:15:32 PM"
          },
          "subscriptionType": {
            "$ref": "#/components/schemas/SubscriptionType"
          },
          "status": {
            "$ref": "#/components/schemas/SubscriptionStatus"
          },
          "clientName": {
            "type": "string",
            "description": "Client name which uses the subscription.",
            "nullable": true,
            "example": "CHILI Group"
          },
          "billingClientContact": {
            "type": "string",
            "description": "Client billing contact information.",
            "nullable": true,
            "example": "simple@example.com"
          },
          "templateDesignerSeatsTotal": {
            "type": "integer",
            "description": "Max count of template designer seats.",
            "format": "int32",
            "nullable": true,
            "example": 6
          },
          "templateDesignerSeatsUsed": {
            "type": "integer",
            "description": "Using count of template designer seats.",
            "format": "int32",
            "nullable": true,
            "example": 4
          },
          "tenantInformation": {
            "$ref": "#/components/schemas/SubscriptionTenantInformationModel"
          },
          "isGraFxPricebook": {
            "type": "boolean",
            "description": "Flag which indicates if the subscription belongs to a GraFx pricebook.",
            "example": true
          },
          "pricebookVersion": {
            "minLength": 1,
            "type": "string",
            "description": "The pricebook version.",
            "example": "2025"
          },
          "subscriptionTier": {
            "minLength": 1,
            "type": "string",
            "description": "The subscription tier.",
            "example": "Basic"
          },
          "maxTemplates": {
            "type": "integer",
            "description": "The maximum amount of templates.",
            "format": "int32",
            "example": 10
          },
          "isWhitelabeled": {
            "type": "boolean",
            "description": "Flag which indicates if the subscription is whitelabeled.",
            "example": false
          },
          "overdueInvoices": {
            "type": "boolean",
            "description": "Flag which indicates if the account has overdue invoices.",
            "example": false
          },
          "isPublisherEnabled": {
            "type": "boolean",
            "description": "Flag which indicates if Publisher is enabled for the subscription.",
            "example": true
          },
          "isStudioEnabled": {
            "type": "boolean",
            "description": "Flag which indicates if Studio is enabled for the subscription.",
            "example": true
          },
          "isExperienceEnabled": {
            "type": "boolean",
            "description": "Flag which indicates if Experience is enabled for the subscription.",
            "nullable": true,
            "example": true
          },
          "maxSpaces": {
            "type": "integer",
            "description": "The maximum amount of Experience spaces.",
            "format": "int32",
            "nullable": true
          },
          "experienceExtensions": {
            "$ref": "#/components/schemas/ExperienceExtensions"
          }
        },
        "additionalProperties": false,
        "description": "Response model with detailed information about subscription."
      },
      "SubscriptionRendersModel": {
        "required": [
          "date",
          "environments",
          "totalRenders",
          "totalWatermarkedRenders"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Renders of environments date.",
            "format": "date-time",
            "example": "2021-11-01T00:00:00"
          },
          "totalRenders": {
            "type": "integer",
            "description": "Total count of renders for environments.",
            "format": "int64",
            "example": 4680
          },
          "totalWatermarkedRenders": {
            "type": "integer",
            "description": "Total count of renders (watermarked) for environments.",
            "format": "int64",
            "example": 4680
          },
          "environments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnvironmentRenderInformation"
            },
            "description": "Environment render details."
          }
        },
        "additionalProperties": false,
        "description": "Response model with subscription render information."
      },
      "SubscriptionStatus": {
        "enum": [
          "Inactive",
          "Active"
        ],
        "type": "string",
        "description": "Status of user subscription."
      },
      "SubscriptionTenantInformationModel": {
        "required": [
          "productionEnvironmentsUsed",
          "sandboxEnvironmentsUsed"
        ],
        "type": "object",
        "properties": {
          "sandboxEnvironmentsTotal": {
            "type": "integer",
            "description": "Total count of sandbox environments allowed in subscription.",
            "format": "int64",
            "example": 4
          },
          "sandboxEnvironmentsUsed": {
            "type": "integer",
            "description": "Total count of sandbox environments used in subscription.",
            "format": "int64",
            "example": 2
          },
          "productionEnvironmentsTotal": {
            "type": "integer",
            "description": "Total count of production environments allowed in subscription.",
            "format": "int64",
            "nullable": true,
            "example": 4
          },
          "productionEnvironmentsUsed": {
            "type": "integer",
            "description": "Total count of production environments used in subscription.",
            "format": "int64",
            "example": 1
          }
        },
        "additionalProperties": false,
        "description": "Response model with subscription tenant information."
      },
      "SubscriptionType": {
        "enum": [
          "OnPremises",
          "Saas"
        ],
        "type": "string",
        "description": "Subscription type."
      },
      "SubscriptionUserModel": {
        "required": [
          "email",
          "hasFullAccess",
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string",
            "description": "User Id.",
            "example": "auth0|630f8c2b524936fea93c0e75"
          },
          "email": {
            "minLength": 1,
            "type": "string",
            "description": "User email.",
            "example": "simple@example.com"
          },
          "firstName": {
            "type": "string",
            "description": "User first name.",
            "nullable": true,
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "User last name.",
            "nullable": true,
            "example": "Doe"
          },
          "avatar": {
            "type": "string",
            "description": "Link to avatar picture.",
            "nullable": true,
            "example": "https://example.com/some-image.png"
          },
          "lastSeen": {
            "type": "integer",
            "description": "Last login datetime in seconds (unit timestamp).",
            "format": "int64",
            "nullable": true,
            "example": 1668540708
          },
          "status": {
            "$ref": "#/components/schemas/UserStatus"
          },
          "subscriptionRoles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Subscription roles.",
            "nullable": true,
            "example": [
              "TD",
              "SA"
            ]
          },
          "environmentRoles": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Environment roles.",
            "nullable": true,
            "example": {
              "ba8d5ad0-2ca0-4bae-8cab-da8d4f28425e": [
                "EA",
                "CA"
              ],
              "f5357acf-ce44-4393-8933-2d1a64b2a973": [
                "EU"
              ]
            }
          },
          "hasFullAccess": {
            "type": "boolean",
            "description": "If a user is a Chili Administrator.",
            "example": false
          },
          "createdAt": {
            "type": "integer",
            "description": "The datetime of user creation in seconds (unix timestamp).",
            "format": "int64",
            "nullable": true,
            "example": 1668540708
          },
          "isFederated": {
            "type": "boolean",
            "description": "Is user federated.",
            "example": true
          },
          "membershipType": {
            "$ref": "#/components/schemas/SubscriptionMembershipType"
          }
        },
        "additionalProperties": false,
        "description": "Response model with subscription user information."
      },
      "UserModel": {
        "required": [
          "email",
          "hasFullAccess",
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string",
            "description": "User Id.",
            "example": "auth0|630f8c2b524936fea93c0e75"
          },
          "email": {
            "minLength": 1,
            "type": "string",
            "description": "User email.",
            "example": "simple@example.com"
          },
          "firstName": {
            "type": "string",
            "description": "User first name.",
            "nullable": true,
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "User last name.",
            "nullable": true,
            "example": "Doe"
          },
          "avatar": {
            "type": "string",
            "description": "Link to avatar picture.",
            "nullable": true,
            "example": "https://www.chili-publish.com/"
          },
          "lastSeen": {
            "type": "integer",
            "description": "Last login datetime in seconds (unit timestamp).",
            "format": "int64",
            "nullable": true,
            "example": 1668540708
          },
          "status": {
            "$ref": "#/components/schemas/UserStatus"
          },
          "subscriptionRoles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Subscription roles.",
            "nullable": true,
            "example": [
              "TD",
              "SA"
            ]
          },
          "hasFullAccess": {
            "type": "boolean",
            "description": "If a user is a Chili Administrator.",
            "example": false
          },
          "isFederated": {
            "type": "boolean",
            "description": "Is user federated.",
            "example": true
          },
          "membershipType": {
            "$ref": "#/components/schemas/SubscriptionMembershipType"
          }
        },
        "additionalProperties": false,
        "description": "Response model with user information."
      },
      "UserStatus": {
        "enum": [
          "Active",
          "Blocked",
          "Pending",
          "Inactive"
        ],
        "type": "string",
        "description": "Status of a user."
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Enter a bearer token (JWT):",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "Info"
    },
    {
      "name": "Environments"
    },
    {
      "name": "Subscriptions"
    }
  ]
}