Response Shapes
TypeScript type definitions for all current API responses
This page provides TypeScript reference types for the currently shipped Vine public API.
Shared Types
Pagination
Collection endpoints include pagination metadata in this format:
type Pagination = {
limit: number;
nextCursor: string | null;
hasMore: boolean;
};ErrorResponse
All error responses follow this format:
type ErrorResponse = {
ok: false;
error: string;
};Posts
PostSummary
Used in post lists and includes basic post information.
type PostSummary = {
id: string;
title: string;
slug: string;
excerpt: string;
thumbnailUrl: string | null;
readingTimeMinutes: number;
publishedAt: string | null;
updatedAt: string;
author: { id: string; name: string } | null;
category: { slug: string; name: string } | null;
tags: Array<{ slug: string; name: string }>;
};PostDetail
Used when fetching a single post. Includes all fields from PostSummary plus the full HTML content.
type PostDetail = PostSummary & { contentHtml: string };PostListResponse
Response shape for post list endpoints.
type PostListResponse = {
ok: true;
posts: PostSummary[];
pagination: Pagination;
};PostDetailResponse
Response shape for post detail (single post) endpoints.
type PostDetailResponse = {
ok: true;
post: PostDetail;
};Tags And Categories
Category
type Category = {
id: string;
name: string;
slug: string;
};Tag
type Tag = {
id: string;
name: string;
slug: string;
};CategoryListResponse
type CategoryListResponse = {
ok: true;
categories: Category[];
pagination: Pagination;
};TagListResponse
type TagListResponse = {
ok: true;
tags: Tag[];
pagination: Pagination;
};Authors
Author
type Author = {
id: string;
name: string;
email: string;
about: string;
socialLinks: Record<string, string>;
};AuthorListResponse
Response shape for authors endpoint.
type AuthorListResponse = {
ok: true;
authors: Author[];
pagination: Pagination;
};Workspace Stats
Stats
type Stats = {
totalPosts: number;
totalAuthors: number;
totalCategories: number;
totalTags: number;
};StatsResponse
type StatsResponse = {
ok: true;
stats: Stats;
};Operational Checks
HealthResponse
type HealthResponse = {
ok: true;
service: 'web';
runtime: 'nextjs+elysia';
};StatusResponse
type StatusResponse = {
ok: true;
message: string;
};Notes
readingTimeMinutesis estimated from text, images, and code blocksthumbnailUrlis a resolved image URL when a post has a thumbnail- route-level failures use
error, notmessage - list endpoints support
limitandcursorquery parameters nextCursoris opaque and should be passed back unchanged