Entities

This page documents the core data types in Whitepapper using TypeScript syntax for clarity.


Project

A project is the top-level content container. It owns collections and papers, and has its own API key.

typescript
interface Project {
  projectId: string;
  ownerId: string;
  name: string;
  slug: string;
  description: string;
  contentGuidelines: string;
  logoUrl?: string | null;
  isPublic: boolean;
  pagesNumber: number;
  createdAt: string;    // ISO 8601
  updatedAt: string;    // ISO 8601
}

Fields

FieldTypeDescription
projectIdstringUnique project identifier
ownerIdstringUser ID of the owner
namestringDisplay name
slugstringURL-safe identifier, unique per user
descriptionstringProject description (Markdown)
contentGuidelinesstringInstructions for AI-assisted writing
logoUrlstring | nullProject logo URL
isPublicbooleanWhether the project is publicly accessible
pagesNumbernumberCount of papers in this project

Collection

A collection groups related papers inside a project.

typescript
interface Collection {
  collectionId: string;
  projectId: string;
  ownerId: string;
  name: string;
  slug: string;
  description: string;
  isPublic: boolean;
  createdAt: string;    // ISO 8601
  updatedAt: string;    // ISO 8601
  pagesNumber: number;
}

Fields

FieldTypeDescription
collectionIdstringUnique collection identifier
projectIdstringParent project ID
ownerIdstringUser ID of the owner
namestringDisplay name
slugstringURL-safe identifier, unique per project
descriptionstringCollection description
isPublicbooleanWhether the collection is publicly accessible
pagesNumbernumberCount of papers in this collection

Paper

A paper is a single Markdown document — the core unit of content.

typescript
interface Paper {
  paperId: string;
  collectionId?: string | null;
  projectId?: string | null;
  ownerId: string;
  thumbnailUrl?: string | null;
  title: string;
  slug: string;
  body: string;           // Markdown content
  status: "draft" | "published" | "archived";
  metadata?: PaperMetadata | null;
  createdAt: string;      // ISO 8601
  updatedAt: string;      // ISO 8601
}

Status Values

StatusMeaning
draftVisible in the editor only
publishedPublicly accessible if parent is public
archivedRemoved from public view

PaperMetadata

Full metadata attached to each paper, used for SEO and social sharing.

typescript
interface PaperMetadata {
  title: string;
  metaDescription: string;
  canonical: string;
  robots: string;
  ogTitle: string;
  ogDescription: string;
  ogImage: string;
  ogImageWidth: number;      // default: 1200
  ogImageHeight: number;     // default: 630
  ogImageAlt: string;
  ogLocale: string;           // default: "en_US"
  ogPublishedTime: string;    // ISO 8601
  ogModifiedTime: string;     // ISO 8601
  ogAuthorUrl: string;
  ogTags: string[];
  twitterTitle: string;
  twitterDescription: string;
  twitterImage: string;
  twitterImageAlt: string;
  twitterCreator?: string | null;
  headline: string;
  abstract: string;
  keywords: string;
  articleSection: string;
  wordCount: number;
  readingTimeMinutes: number;
  inLanguage: string;
  datePublished: string;      // ISO 8601
  dateModified: string;       // ISO 8601
  authorName: string;
  authorHandle: string;
  authorUrl: string;
  authorId: string;
  coverImageUrl: string;
  publisherName: string;
  publisherUrl: string;
  isAccessibleForFree: boolean;
  license: string;
  keyTakeaways?: string[] | null;
  faq?: Array<{
    question: string;
    answer: string;
  }> | null;
  authorBio?: string | null;
  jsonLd?: Record<string, any> | Array<Record<string, any>> | null;
}

User

The root entity that owns all content.

typescript
interface User {
  userId: string;
  displayName?: string | null;
  description: string;
  email?: string | null;
  avatarUrl?: string | null;
  username: string;         // Public handle
  plan: "free" | "pro";
  preferences?: {
    showKeyboardEffect?: boolean;
    typingSoundEnabled?: boolean;
    hashnodeIntegrated?: boolean;
    devtoIntegrated?: boolean;
  };
  createdAt: string;        // ISO 8601
  updatedAt: string;        // ISO 8601
}

Related

Whitepapper logo

Whitepapper

Whitepapper is a API first content platform for developers who want to publish once, distribute everywhere, and manage website content.