{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elicit/json-schema/elicit-get-library-source-response-schema.json",
  "title": "GetLibrarySourceResponse",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elicit-openapi.json#/components/schemas/GetLibrarySourceResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Stable id of the source."
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "authors": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "year": {
      "type": [
        "integer",
        "null"
      ]
    },
    "venue": {
      "type": [
        "string",
        "null"
      ]
    },
    "abstract": {
      "type": [
        "string",
        "null"
      ],
      "description": "Abstract as markdown."
    },
    "doi": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": [
        "string",
        "null"
      ]
    },
    "elicitId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Elicit corpus id, present once the paper has been matched to the corpus."
    },
    "pdfUrls": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "collectionIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Collections this source belongs to that are visible to you."
    },
    "role": {
      "type": "string",
      "enum": [
        "writer",
        "reader"
      ],
      "description": "Your role on this source: `writer` for your own sources and for a shared collection's papers when you own or can edit that collection; `reader` for a shared collection's papers you can only view. Any role can read the source and use it in reviews. Writers edit metadata, attach a PDF, delete, and add to collections."
    },
    "fullTextStatus": {
      "type": "string",
      "enum": [
        "pending",
        "available",
        "unavailable"
      ],
      "description": "Whether parsed full text is attached: pending — a PDF is still parsing, or none has been looked for yet; available — parsed and attached; unavailable — looked for, none found."
    },
    "createdAt": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string"
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string",
          "description": "API URL of this source."
        },
        "fullText": {
          "type": "string",
          "description": "API URL of the parsed full text; 404s until fullTextStatus is available."
        }
      },
      "required": [
        "self",
        "fullText"
      ]
    },
    "download": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "downloadUrl": {
          "type": "string",
          "format": "uri",
          "description": "Presigned URL for the original PDF. Fetch without an Authorization header."
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "filename": {
          "type": "string"
        },
        "contentType": {
          "type": "string",
          "const": "application/pdf"
        }
      },
      "required": [
        "downloadUrl",
        "expiresAt",
        "filename",
        "contentType"
      ],
      "description": "Download details for the original PDF; null when no stored PDF exists or a download URL is temporarily unavailable. URLs expire after 30 minutes; retrieve the source again for a fresh URL."
    }
  },
  "required": [
    "id",
    "title",
    "authors",
    "year",
    "venue",
    "abstract",
    "doi",
    "url",
    "elicitId",
    "pdfUrls",
    "collectionIds",
    "role",
    "fullTextStatus",
    "createdAt",
    "updatedAt",
    "links",
    "download"
  ]
}