{
  "info": {
    "title": "core/tenants",
    "version": ""
  },
  "paths": {
    "/api/core/tenants": {
      "get": {
        "tags": [
          "tenants"
        ],
        "summary": "List tenants",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantsResponse"
                }
              }
            },
            "description": "Tenants retrieved successfully."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad request. The request contains invalid query parameters or an invalid SCIM filter expression."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Forbidden. The user does not have permission to access tenants, or the feature is not enabled."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Unexpected error."
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string",
              "example": "subscriptionId eq \"12345\" and status eq \"active\""
            },
            "required": false,
            "description": "SCIM filter expression.\n\nSupported attributes are `subscriptionId` (required), `regionCode`, `countryCode`,\n`name`, `hostnames`, `createdAt`, `updatedAt`, `id`, `status`, and `originalId`.\n\nSupports logical operators (`and`, `or`, `not`) and comparison operators\n(`eq`, `ne`, `gt`, `ge`, `lt`, `le`, `co`).\n\nOperator support varies by attribute. For example:\n- `regionCode`, `status`: support `eq`, `ne`\n- `subscriptionId`, `name`, `hostnames`, `id`, `originalId`: support `eq` only\n"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100,
              "minimum": 0
            },
            "required": false,
            "description": "Maximum number of results to return (0-100, default 20)."
          },
          {
            "in": "query",
            "name": "next",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cursor for the next page of results (tenant ObjectId)."
          },
          {
            "in": "query",
            "name": "prev",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cursor for the previous page of results (tenant ObjectId)."
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "example": "-createdAt,name"
            },
            "required": false,
            "description": "Comma-separated list of fields to sort by. Prefix with `-` for descending order, `+` or no prefix for ascending. Supported fields are `name`, `regionCode`, `countryCode`, `hostnames`, `createdAt`, `updatedAt`, `status`, `subscriptionId`."
          },
          {
            "in": "query",
            "name": "totalResults",
            "schema": {
              "enum": [
                "true",
                "false"
              ],
              "type": "string"
            },
            "required": false,
            "description": "When set to `true`, includes the total count of matching tenants in the response. Default is `false`."
          }
        ],
        "description": "Use this operation to retrieve a list of tenants across multiple organizations. Filter results using SCIM filter expressions and sort by supported fields. Returns paginated results with optional total count.",
        "operationId": "getTenants",
        "x-qlik-visibility": "public",
        "x-qlik-stability": "stable",
        "x-qlik-deprecated": false,
        "x-qlik-tier": {
          "tier": "1",
          "limit": 1000
        }
      }
    },
    "/api/core/tenants/{tenantId}": {
      "get": {
        "tags": [
          "tenants"
        ],
        "summary": "Get a tenant",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantsResponse"
                }
              }
            },
            "description": "Tenant retrieved successfully."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad request. The request contains an invalid tenant identifier."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Forbidden. The user does not have permission to access this tenant, or the feature is not enabled."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "The requested tenant was not found."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Unexpected error."
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "tenantId",
            "schema": {
              "type": "string",
              "example": "TiQ8GPVr8qI714Lp5ChAAFFaU24MJy69"
            },
            "required": true,
            "description": "The identifier of the tenant to retrieve."
          }
        ],
        "description": "Use this operation to retrieve a specific Qlik Cloud tenant by its identifier.",
        "operationId": "getTenantById",
        "x-qlik-visibility": "public",
        "x-qlik-stability": "stable",
        "x-qlik-deprecated": false,
        "x-qlik-tier": {
          "tier": "1",
          "limit": 1000
        }
      }
    },
    "/api/core/tenants/actions/count": {
      "get": {
        "tags": [
          "tenants"
        ],
        "summary": "Count tenants",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantCountResponse"
                }
              }
            },
            "description": "Tenant count retrieved successfully."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad request. The request contains an invalid filter expression or is missing the required `subscriptionId` attribute."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Forbidden. The user does not have permission to count tenants."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Unexpected error."
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string",
              "example": "subscriptionId eq \"12345\" and status eq \"active\""
            },
            "required": true,
            "description": "SCIM filter query string. Must include the `subscriptionId` attribute."
          }
        ],
        "description": "Use this operation to count Qlik Cloud tenants matching a SCIM filter expression. Primarily used for subscription-based queries. The `subscriptionId` attribute is required in the filter expression.",
        "operationId": "countTenants",
        "x-qlik-visibility": "public",
        "x-qlik-stability": "stable",
        "x-qlik-deprecated": false,
        "x-qlik-tier": {
          "tier": "1",
          "limit": 1000
        }
      }
    },
    "/api/core/tenants/actions/filter": {
      "post": {
        "tags": [
          "tenants"
        ],
        "summary": "Filter tenants",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantsFilterResponse"
                }
              }
            },
            "description": "Tenants filtered successfully."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Bad request. The request contains an invalid SCIM filter or invalid query parameters."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Forbidden. The user does not have permission to filter tenants, or the feature is not enabled."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                }
              }
            },
            "description": "Unexpected error."
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100,
              "minimum": 0
            },
            "required": false,
            "description": "Maximum number of results to return (0-100, default 20)."
          },
          {
            "in": "query",
            "name": "next",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cursor for the next page of results (tenant ObjectId)."
          },
          {
            "in": "query",
            "name": "prev",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cursor for the previous page of results (tenant ObjectId)."
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "example": "-createdAt,name"
            },
            "required": false,
            "description": "Comma-separated list of fields to sort by. Prefix with `-` for descending order, `+` or no prefix for ascending. Supported fields are `name`, `regionCode`, `countryCode`, `hostnames`, `createdAt`, `updatedAt`, `status`, `subscriptionId`."
          },
          {
            "in": "query",
            "name": "totalResults",
            "schema": {
              "enum": [
                "true",
                "false"
              ],
              "type": "string"
            },
            "required": false,
            "description": "When set to `true`, includes the total count of matching tenants in the response. Default is `false`."
          }
        ],
        "description": "Use this operation to search and filter Qlik Cloud tenants using a SCIM filter expression provided in the request body. Supports complex queries with logical and comparison operators.",
        "operationId": "filterTenants",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantFilterRequest"
              }
            }
          },
          "required": true,
          "description": "Request body containing the SCIM filter expression used to select tenants."
        },
        "x-qlik-visibility": "public",
        "x-qlik-stability": "stable",
        "x-qlik-deprecated": false,
        "x-qlik-tier": {
          "tier": "2",
          "limit": 100
        }
      }
    }
  },
  "openapi": "3.0.0",
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "code",
          "status",
          "title"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "TENANTS-8",
            "description": "The error code."
          },
          "meta": {
            "type": "object",
            "description": "Additional properties relating to the error."
          },
          "title": {
            "type": "string",
            "example": "Not found",
            "description": "Summary of the problem."
          },
          "detail": {
            "type": "string",
            "example": "The requested tenant could not be found.",
            "description": "A human-readable explanation specific to this occurrence of the error."
          },
          "source": {
            "type": "object",
            "properties": {
              "pointer": {
                "type": "string",
                "example": "/filter",
                "description": "A JSON Pointer to the property that caused the error."
              },
              "parameter": {
                "type": "string",
                "example": "filter",
                "description": "The URI query parameter that caused the error."
              }
            },
            "description": "References to the source of the error."
          },
          "status": {
            "type": "string",
            "example": "404",
            "description": "The HTTP status code."
          }
        },
        "description": "An error object describing the error."
      },
      "Errors": {
        "type": "object",
        "example": {
          "errors": [
            {
              "code": "TENANTS-8",
              "title": "Not found",
              "status": "404"
            }
          ],
          "traceId": "000000000000000079cf1ebeae103de1"
        },
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "description": "An array of errors related to the operation."
          },
          "traceId": {
            "type": "string",
            "example": "000000000000000079cf1ebeae103de1",
            "description": "A unique identifier for tracing the error."
          }
        },
        "description": "The error response object describing the error from the handling of an HTTP request."
      },
      "Tenant": {
        "type": "object",
        "required": [
          "id",
          "hostnames",
          "regionCode",
          "countryCode",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "TiQ8GPVr8qI714Lp5ChAAFFaU24MJy69",
            "readOnly": true,
            "description": "The unique identifier of the tenant (`originalId`)."
          },
          "name": {
            "type": "string",
            "example": "QlikTenant",
            "description": "The display name of the tenant."
          },
          "links": {
            "type": "object",
            "readOnly": true,
            "properties": {
              "self": {
                "type": "object",
                "required": [
                  "href"
                ],
                "properties": {
                  "href": {
                    "type": "string",
                    "example": "http://foo.example/api/v1/tenants/TiQ8GPVr8qI714Lp5ChAAFFaU24MJy69",
                    "description": "URL that defines the resource."
                  }
                },
                "description": "A link to this tenant."
              }
            }
          },
          "status": {
            "enum": [
              "active",
              "disabled",
              "deleted",
              "deactivated"
            ],
            "type": "string",
            "example": "active",
            "description": "The status of the tenant."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2023-01-15T10:30:00.000Z",
            "readOnly": true,
            "description": "The timestamp for when the tenant was created."
          },
          "createdBy": {
            "type": "string",
            "example": "TiQ8GPVr8qI714Lp5ChAAFFaU24MJy7A",
            "description": "The identifier of the user who created the tenant."
          },
          "hostnames": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "foo.example.qlikcloud.com"
            },
            "example": [
              "example-tenant.us.qlikcloud.com",
              "example-tenant.example.com"
            ],
            "description": "List of case-insensitive hostnames mapped to the tenant."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2023-06-20T14:45:00.000Z",
            "readOnly": true,
            "description": "The timestamp for when the tenant was last updated."
          },
          "regionCode": {
            "enum": [
              "us-east-1",
              "us-east-2",
              "us-west-1",
              "us-west-2",
              "eu-west-1",
              "eu-west-2",
              "eu-west-3",
              "eu-north-1",
              "eu-central-1",
              "ap-southeast-1",
              "ap-southeast-2",
              "ap-northeast-1",
              "ap-south-1",
              "il-central-1",
              "me-central-1",
              "sa-east-1",
              "ca-central-1"
            ],
            "type": "string",
            "example": "us-east-1",
            "readOnly": true,
            "description": "The region code where the tenant is located."
          },
          "countryCode": {
            "enum": [
              "US",
              "IE",
              "GB",
              "DE",
              "SG",
              "AU",
              "JP",
              "IN",
              "IL",
              "AE",
              "BR",
              "FR",
              "SE",
              "CA"
            ],
            "type": "string",
            "example": "US",
            "readOnly": true,
            "description": "The country code for the tenant."
          },
          "licenseEndsAt": {
            "type": "string",
            "format": "date",
            "example": "2024-12-31",
            "nullable": true,
            "description": "The date when the license ends."
          },
          "licenseNumber": {
            "type": "string",
            "example": "1234567890123456",
            "description": "The license number associated with the tenant."
          },
          "subscriptionId": {
            "type": "string",
            "example": "9876543210987654",
            "description": "The parent subscription ID (license number) for the tenant."
          },
          "licenseStartsAt": {
            "type": "string",
            "format": "date",
            "example": "2023-01-01",
            "nullable": true,
            "description": "The date when the license starts."
          },
          "deletionStartsAt": {
            "type": "string",
            "format": "date-time",
            "example": "2024-06-30T00:00:00.000Z",
            "nullable": true,
            "description": "The scheduled date for tenant deletion."
          }
        },
        "description": "A tenant resource representing a Qlik Cloud tenant."
      },
      "TenantCountResponse": {
        "type": "object",
        "required": [
          "total"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "example": 42,
            "description": "The total number of tenants matching the filter criteria."
          }
        },
        "description": "Response containing the total count of tenants matching a filter."
      },
      "TenantFilterRequest": {
        "type": "object",
        "example": {
          "filter": "subscriptionId eq \"9876543210987654\" and status eq \"active\""
        },
        "properties": {
          "filter": {
            "type": "string",
            "example": "subscriptionId eq \"12345\" and (status eq \"active\" or status eq \"disabled\") and regionCode eq \"us-east-1\"",
            "description": "SCIM filter expression.\n\nSupported attributes are `subscriptionId` (required), `regionCode`, `countryCode`,\n`name`, `hostnames`, `createdAt`, `updatedAt`, `id`, `status`, and `originalId`.\n\nSupports logical operators (`and`, `or`, `not`) and comparison operators\n(`eq`, `ne`, `gt`, `ge`, `lt`, `le`, `co`).\n\nOperator support varies by attribute. For example:\n- `regionCode`, `status`: support `eq`, `ne`\n- `subscriptionId`, `name`, `hostnames`, `id`, `originalId`: support `eq` only\n"
          }
        },
        "description": "Request body for filtering tenants using SCIM filter expressions."
      },
      "TenantsFilterResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tenant"
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string",
                    "example": "https://api.qlikcloud.com/core/tenants/actions/filter",
                    "description": "The URL of the current request."
                  }
                }
              }
            }
          },
          "paging": {
            "type": "object",
            "properties": {
              "next": {
                "type": "string",
                "example": "limit=20&next=507f191e810c19729de860ea",
                "description": "Query string for the next page of results."
              },
              "prev": {
                "type": "string",
                "example": "limit=20&prev=507f1f77bcf86cd799439011",
                "description": "Query string for the previous page of results."
              }
            },
            "description": "Pagination information for navigating through results."
          },
          "totalResults": {
            "type": "integer",
            "example": 42,
            "description": "Total number of tenants matching the filter. Only included when the `totalResults` query parameter is set to `true`."
          }
        },
        "description": "A paginated list of Qlik Cloud tenants returned by the filter operation. Includes cursor-based pagination and an optional total count."
      },
      "TenantsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tenant"
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string",
                    "example": "https://api.qlikcloud.com/core/tenants",
                    "description": "The URL of the current request."
                  }
                }
              }
            }
          },
          "paging": {
            "type": "object",
            "properties": {
              "next": {
                "type": "string",
                "example": "limit=20&next=507f191e810c19729de860ea",
                "description": "Query string for the next page of results."
              },
              "prev": {
                "type": "string",
                "example": "limit=20&prev=507f1f77bcf86cd799439011",
                "description": "Query string for the previous page of results."
              }
            },
            "description": "Pagination information for navigating through results."
          },
          "totalResults": {
            "type": "integer",
            "example": 150,
            "description": "Total number of tenants matching the query. Only included when the `totalResults` query parameter is set to `true`."
          }
        },
        "description": "A paginated list of Qlik Cloud tenants. Includes cursor-based pagination and an optional total count."
      }
    }
  },
  "servers": [
    {
      "url": "https://console.qlikcloud.com"
    }
  ]
}