Skip to main content

Shared Types

Common data types used across all SureStage API services.

Standard Response Envelope

interface ApiResponse<T> {
success: boolean;
data: T;
meta: {
timestamp: string; // ISO 8601
requestId: string; // Unique request identifier
pagination?: Pagination; // Present for list endpoints
};
}

interface ApiError {
success: false;
error: {
code: string;
message: string;
details?: Record<string, unknown>;
};
meta: {
timestamp: string;
requestId: string;
};
}

Pagination

List endpoints support cursor-based pagination:

interface Pagination {
total: number;
page: number;
pageSize: number;
totalPages: number;
hasNext: boolean;
hasPrevious: boolean;
}

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
pageSizenumber20Items per page (max 100)
sortBystringcreatedAtField to sort by
sortOrderasc | descdescSort direction

Common Fields

Most resources include:

interface BaseEntity {
id: string; // UUID v4
createdAt: string; // ISO 8601
updatedAt: string; // ISO 8601
createdBy?: string; // User UUID
}

Timestamps

All timestamps are ISO 8601 format in UTC:

2026-02-15T12:00:00.000Z