{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tokencanopy-com/json-schema/tokencanopy-com-viewer-session-create-out-schema.json",
  "title": "ViewerSessionCreateOut",
  "description": "The mint response — the ONLY response carrying the plaintext viewer\ncredential. The credential authorizes the isolated viewer host's\n`/view/doc` and `/view/content` for this one pinned version, via an\nAuthorization header only — it must never be placed in a URL, cookie,\nor persistent storage.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tokencanopy-com-openapi.json#/components/schemas/ViewerSessionCreateOut",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^vwr_[a-f0-9]{16}$",
      "title": "Id"
    },
    "drive_id": {
      "type": "string",
      "pattern": "^drv_[a-f0-9]{16}$",
      "title": "Drive Id"
    },
    "artifact_id": {
      "type": "string",
      "pattern": "^art_[a-f0-9]{16}$",
      "title": "Artifact Id"
    },
    "version_id": {
      "type": "string",
      "pattern": "^ver_[a-f0-9]{16}$",
      "title": "Version Id"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "title": "Expires At"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "expires_in": {
      "type": "integer",
      "title": "Expires In",
      "description": "Seconds until the session expires, from mint time."
    },
    "credential": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Credential",
      "description": "Plaintext viewer credential. Present only on first execution of a mint; null on idempotent replay — mint a new session with a fresh Idempotency-Key to obtain a credential."
    }
  },
  "type": "object",
  "required": [
    "id",
    "drive_id",
    "artifact_id",
    "version_id",
    "expires_at",
    "created_at",
    "expires_in"
  ]
}