Skip to content

Schemas & Errors

Data Schemas

ContentRow

typescript
interface ContentRow {
  id: string
  type: string              // Free-form string matching /^[a-z0-9-]+$/ (max 100 chars)
  slug: string
  data: Record<string, unknown>  // Any JSON object
  status: 'draft' | 'published' | 'archived'
  version: number
  sortOrder: number
  createdAt: string
  updatedAt: string
  deletedAt: string | null
}

See Content Model Reference for details on the data column and custom content types.

ChatResponse

typescript
interface ChatResponse {
  sessionId: string
  message: {
    id: string
    role: 'assistant'
    content: string
    createdAt: string
  }
  tokensUsed: number
  toolCalls?: Array<{
    id: string
    name: string
    arguments: Record<string, unknown>
    result: string
  }>
}

Error

typescript
interface ErrorResponse {
  error: {
    code: string
    message: string
    requestId?: string
    fields?: Record<string, string[]>   // For validation errors
    retryAfter?: number                 // For rate limit errors
    stack?: string                      // Development only
  }
}

Error Codes

CodeHTTP StatusDescription
VALIDATION_ERROR400Invalid request body or parameters
BAD_REQUEST400Malformed JSON or invalid request syntax
UNAUTHORIZED401Missing or invalid admin key
NOT_FOUND404Resource not found
CONFLICT409Duplicate slug or version conflict
PAYLOAD_TOO_LARGE413Request body exceeds 100kb limit
RATE_LIMIT_EXCEEDED429Rate limit exceeded
INTERNAL_SERVER_ERROR500Unexpected server error
LLM_ERROR502LLM provider unavailable

See Also

Released under the MIT License.