Collection Endpoint

Fetches one collection by ID or slug and its papers.


Request

http
GET /dev/collection?id=<collection-id>
GET /dev/collection?slug=<collection-slug>
x-api-key: <your-api-key>

Base URL: https://whitepapper.antk.in/api

Pass exactly one of id or slug.


Response — 200 OK

typescript
interface CollectionEndpointResponse {
  collection: CollectionDoc
  papers: PaperDoc[]
}

interface CollectionDoc {
  collectionId: string
  projectId: string
  ownerId: string | null         // masked in Dev API
  name: string
  description: string
  slug: string
  isPublic: boolean
  pagesNumber: number
  createdAt: string               // ISO 8601
  updatedAt: string               // ISO 8601
}

interface PaperDoc {
  paperId: string
  collectionId: string | null
  projectId: string | null
  ownerId: string | null          // masked in Dev API
  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
}

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> | Record<string, any>[] | null
}

Papers are sorted with the latest first.


Errors

StatusDetail
400Provide exactly one of: id or slug.
401Missing x-api-key header.
403Collection does not belong to the API key project.
404Collection not found.
429Monthly Dev API limit reached.

Notes

  • ownerId is always null in Dev API responses.
  • Only public collections and published papers are returned.

Related

Whitepapper logo

Whitepapper

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