{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/safetyculture/json-schema/safetyculture-s12-directory-v1-search-folders-response-schema.json",
  "title": "SearchFoldersResponse",
  "description": "Result returned from `SearchFoldersResponse`",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/safetyculture-directory-sites-api-openapi.yml#/components/schemas/s12.directory.v1.SearchFoldersResponse",
  "type": "object",
  "properties": {
    "folders": {
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "#/$defs/s12.directory.v1.FolderWithAncestors"
      },
      "description": "An array of folders with their ancestors that match the search results"
    },
    "folder_count": {
      "type": "integer",
      "format": "int32",
      "description": "The total number of folders found for the search query"
    },
    "next_page_token": {
      "type": "string",
      "description": "Optional. base64 encoded. If this field is present, the value should be\nused in subsequent calls to SearchFolders to get the next page of results.\nOtherwise, no further calls should be made."
    },
    "folders_enabled": {
      "type": "boolean",
      "description": "Whether or not the org settings setting is enabled."
    }
  },
  "$defs": {
    "s12.directory.v1.Folder": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "An unique identifier for the folder. Must be a valid UUID.\nFor example: '00001d65-d336-485a-8331-7b53f37e8f51'"
        },
        "name": {
          "type": "string",
          "description": "Name associated with folder"
        },
        "org_id": {
          "type": "string",
          "description": "The organisation that the folder belongs to"
        },
        "creator_id": {
          "type": "string",
          "description": "The user id responsible for creating the folder\nFor example: 'user_5441fffcde344415bb7ccaceda27e196'"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "The creation timestamp of the folder (Date, Time, Timezone)\nFor example: '2020-04-28T04:14:31:00Z'"
        },
        "modified_at": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of the last modification for the folder (Date, Time,\nTimezone) For example: '2020-04-28T04:14:00Z'"
        },
        "meta_label": {
          "type": "string",
          "description": "Additional meta information that can be associated with the folder\ne.g. 'location'"
        },
        "members_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of users with a direct association of type 'MEMBER' for the folder"
        },
        "deleted": {
          "type": "boolean",
          "description": "Whether a folder has been marked as deleted or not."
        }
      },
      "description": "Folder represents the main directory object",
      "title": "Folder"
    },
    "s12.directory.v1.FolderWithAncestors": {
      "type": "object",
      "properties": {
        "folder": {
          "allOf": [
            {
              "$ref": "#/$defs/s12.directory.v1.Folder"
            }
          ],
          "description": "The folder we are interested in"
        },
        "ancestors": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/$defs/s12.directory.v1.Folder"
          },
          "description": "The folders ancestors. For example, when returning a `location` leaf node,\nthe ancestors will be the [`area`,`region`] folders, when applicable"
        },
        "members_count": {
          "type": "integer",
          "format": "int32",
          "description": "Members count are the count of active users associated with the folder."
        },
        "has_children": {
          "type": "boolean",
          "description": "Whether the folder has children or not"
        }
      },
      "description": "FolderWithAncestors represents a a folder with an array of ancestor folders",
      "title": "FolderWithAncestors"
    }
  }
}