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
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
pageSize | number | 20 | Items per page (max 100) |
sortBy | string | createdAt | Field to sort by |
sortOrder | asc | desc | desc | Sort 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