Introduction & Base URL
Welcome to the Kopano Labs clinical documentation. Our API is architected for high-concurrency environments requiring extreme precision in availability and settlement orchestration.
Development Base URL
https://api.kopanolabs.com/v2Unified Auth Flow
Kopano Labs leverages NextAuth.js for session management. All API requests must include a JWT or Bearer Token in the authorization header.
Session Validation
Tokens are validated against our internal identity provider in real-time.
/auth/session/refreshExtends the current user session and returns a fresh JWT.
{
"status": "success",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5...",
"expires_at": "2026-08-24T12:08:002",
"user": {
"id": "user_98234",
"scope": "read:availability write:payments"
}
}
}Real-Time Availability Engine
/api/availabilityQuery high-frequency availability slots across distributed global providers with sub-50ms latency.
Query Parameters
provider_idUUID (Required)The unique identifier of the service provider.
timestampISO 8601The start window for slot searching.
bufferIntegerSafety padding in minutes.
Low Latency Guarantee
Our engine uses localized caching nodes to ensure that the /availability endpoint maintains consistent response times during peak demand.
43ms
Data Flow Protocol
An architectural deep-dive into the Kopano Labs ecosystem. Mapping the journey of a request from the edge to the database and external integration points.
Request Initiation
TanStack Start leverages Server Components for high-performance data fetching at the edge. Initial payloads are rendered server-side to minimize client-side hydrations.
App Router (v15)
- • Dynamic Rendering
- • Streaming Suspense
NextAuth.js Integration
Auth Middleware
Every incoming request is intercepted by the edge middleware. User sessions are verified against the persistence layer before reaching any sensitive API routes.
Server Actions
The orchestration engine. Directly mutates data without creating secondary API endpoints, ensuring type-safety from DB to UI.
Zod Validation
Runtime type checking of payloads.
Revalidation
Triggers revalidatePath() for UI sync.
MongoDB Atlas
Region Cluster
Cape Town (af-south-1)
Automated sharding and global replication ensuring <50ms latency for African nodes. Multi-cloud backup protocol enabled.
Payment Webhooks
Modular Payment Wrapper
One integration, multiple gateways. Kopano Labs abstracts the complexities of Paystack, Yoco, and Ozow into a single, predictable interface.
Webhook Logic
Webhooks are dispatched with an X-Kopano-Signature. Always verify this signature before processing financial state changes.
{
"event": "payment.captured",
"gateway": "yoco",
"amount": 550.00,
"currency": "ZAR",
"meta": {
"reference": "KP-0832",
"customer": "jane_doe@test.com"
}
}Error Codes
400_INVALID_PARAMSThe request body contains schema errors.
401_UNAUTHORIZEDBearer token is missing or expired.
429_RATE_LIMITRequest quota exceeded.
503_GATEWAY_TIMEOUTDownstream payment provider failure.
Rate Limiting
To preserve system integrity, Kopano Labs enforces sliding-window rate limits based on your tier.
Standard Tier
Default for new keys
Enterprise Tier
High-volume settlement