{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudinary/json-schema/cloudinary-contract-list-collections-response-schema.json",
  "title": "Contract.ListCollectionsResponse",
  "description": "Response returned by the **List collections** endpoint. `data` and `total_count` are always present, so a search that matches nothing returns `{\"data\": [], \"total_count\": 0}` rather than an empty object. `next_cursor` follows the usual cursor convention and is omitted once there are no further pages.\n",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudinary-collections-openapi.yml#/components/schemas/Contract.ListCollectionsResponse",
  "type": "object",
  "required": [
    "data",
    "total_count"
  ],
  "properties": {
    "data": {
      "type": "array",
      "description": "The page of collections.",
      "items": {
        "$ref": "#/$defs/Entity.Collection"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page. Omitted when there are no further pages."
    },
    "total_count": {
      "type": "integer",
      "description": "Total number of collections matching the query across all pages."
    }
  },
  "$defs": {
    "Entity.Collection": {
      "type": "object",
      "description": "A collection resource.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The external ID of the collection."
        },
        "name": {
          "type": "string",
          "description": "Name of the collection."
        },
        "creator_type": {
          "type": "string",
          "enum": [
            "user",
            "api"
          ],
          "description": "Indicates whether the collection was created by a Console user or through the API."
        },
        "creator_id": {
          "type": "string",
          "description": "Who created the collection. When `creator_type` is `user`, this is the external ID of the Console user; Enterprise customers can get more details about the user with the [Get user](provisioning_api#tag/users/GET/users/{user_id}) endpoint of the Provisioning API. When `creator_type` is `api`, this is the API key used to create the collection."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the collection was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the collection was last modified."
        },
        "description": {
          "type": "string",
          "description": "Optional description of the collection."
        },
        "type": {
          "type": "string",
          "enum": [
            "manual",
            "dynamic"
          ],
          "description": "The type of collection. `manual` holds an explicit asset list and starts empty until you add assets with the **Add assets to a collection** endpoint; `dynamic` is defined by a saved filter expression and is populated automatically."
        },
        "configuration": {
          "$ref": "#/$defs/Entity.CollectionConfiguration"
        },
        "asset_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Number of assets in the collection. Returned by the `Get a collection` and `List collections` endpoints. Omitted from the responses of the endpoints that create, update, or change the assets of a collection.\n"
        },
        "cover_asset_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Delivery URL of an automatically selected cover asset for the collection. Returned by the `Get a collection` and `List collections` endpoints. Omitted from the responses of the endpoints that create, update, or change the assets of a collection.\n"
        }
      }
    },
    "Entity.CollectionConfiguration": {
      "type": "object",
      "description": "Configuration for a `dynamic` collection. Required when creating a `dynamic` collection, and not allowed for a `manual` collection.\n",
      "properties": {
        "expression": {
          "type": "string",
          "description": "The [search expression](search_expressions) that defines which assets are included in a dynamic collection. Cloudinary evaluates the expression against your product environment's assets, so the collection's contents update as assets begin or stop matching the criteria. In the Media Library, a collection whose expression was set through the API shows it as a single **Expression** filter; any filters added to the collection there are combined with it using AND.\n"
        }
      }
    }
  }
}