{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canva/json-schema/canva-get-design-analytics-viewers-response-schema.json",
  "title": "GetDesignAnalyticsViewersResponse",
  "description": "Successful response from a `getDesignAnalyticsViewers` request.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canva-analytics-api-openapi.yml#/components/schemas/GetDesignAnalyticsViewersResponse",
  "properties": {
    "items": {
      "description": "The list of viewers.",
      "items": {
        "$ref": "#/$defs/Viewer"
      },
      "type": "array"
    },
    "continuation": {
      "description": "If the success response contains a continuation token, there are more viewers you can list. You can use this token as a query parameter and retrieve more viewers from the list, for example `/v1/designs/{designId}/analytics/viewers?continuation={continuation}`.\n\nTo retrieve all viewers, you might need to make multiple requests.",
      "type": "string"
    }
  },
  "required": [
    "items"
  ],
  "type": "object",
  "$defs": {
    "DesignAnalyticsViewerFormFactor": {
      "description": "The device form factor used to view the design.",
      "enum": [
        "small",
        "large"
      ],
      "type": "string",
      "x-enum-descriptions": [
        "A small device, such as a phone.",
        "A large device, such as a laptop, desktop, or large tablet."
      ]
    },
    "DesignAnalyticsViewerType": {
      "description": "How the viewer accessed the design.",
      "enum": [
        "editor",
        "commenter",
        "viewer"
      ],
      "type": "string",
      "x-enum-descriptions": [
        "The viewer accessed the design with edit access.",
        "The viewer accessed the design with comment access.",
        "The viewer accessed the design with view-only access."
      ]
    },
    "DesignAnalyticsViewerVisibility": {
      "description": "How this viewer should be presented to the caller.",
      "enum": [
        "shown",
        "anonymous",
        "opt_out",
        "another_team",
        "deleted"
      ],
      "type": "string",
      "x-enum-descriptions": [
        "The viewer's identity is visible, and their user details are included.",
        "The viewer is anonymous, so their identity is not available.",
        "The viewer has opted out of design analytics, but some data was already collected for this viewer previosly.",
        "The viewer belongs to a different team, so their identity is not shared.",
        "The viewer's account has been deleted."
      ]
    },
    "TeamUser": {
      "description": "Metadata for the user, consisting of the User ID, Team ID, and display name.",
      "properties": {
        "user_id": {
          "description": "The ID of the user.",
          "type": "string"
        },
        "team_id": {
          "description": "The ID of the user's Canva Team.",
          "type": "string"
        },
        "display_name": {
          "description": "The name of the user as shown in the Canva UI.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Viewer": {
      "description": "A viewer and their engagement metrics for the design.",
      "properties": {
        "viewer_id": {
          "description": "An opaque identifier for the viewer. Use this value when filtering page view results by viewer.",
          "type": "string"
        },
        "user": {
          "allOf": [
            {
              "$ref": "#/$defs/TeamUser"
            }
          ],
          "description": "The user details of the viewer. This is omitted for viewers whose identity is not visible."
        },
        "last_viewed_at": {
          "description": "When the viewer most recently opened the design, as a Unix timestamp (in seconds since the Unix Epoch).",
          "format": "int64",
          "type": "integer"
        },
        "viewer_type": {
          "$ref": "#/$defs/DesignAnalyticsViewerType"
        },
        "visibility": {
          "$ref": "#/$defs/DesignAnalyticsViewerVisibility"
        },
        "total_view_duration_seconds": {
          "description": "The total time this viewer has spent viewing the design, in seconds.",
          "format": "int64",
          "type": "integer"
        },
        "first_viewed_at": {
          "description": "When the viewer first viewed the design, as a Unix timestamp (in seconds since the Unix Epoch).",
          "format": "int64",
          "type": "integer"
        },
        "pages_viewed": {
          "description": "The number of pages this viewer viewed for more than one second.",
          "format": "int64",
          "type": "integer"
        },
        "form_factor": {
          "$ref": "#/$defs/DesignAnalyticsViewerFormFactor"
        },
        "device_operating_system": {
          "description": "The simplified operating system name for the viewer's device.",
          "type": "string"
        },
        "city_country": {
          "description": "The viewer location as city and country. This is only returned for anonymous viewers.",
          "type": "string"
        },
        "total_view_count": {
          "description": "The number of times this viewer opened the design.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "last_viewed_at",
        "viewer_id",
        "viewer_type",
        "visibility"
      ],
      "type": "object"
    }
  }
}