KHS Developer API
Current contract: API v1 · Provider Discovery · Base URL: https://backend.christech.co.ke
The currently implemented public developer resource is provider discovery. It lets an approved integration search provider profiles by supported filters. Additional resources should only be added here after the backend endpoint, authentication, permissions, rate limits and operational handling exist.
The existing /api/v1/providers contract. Do not change response meanings or remove fields for existing consumers without a versioned migration plan.
New capabilities should be versioned and documented separately. A future v2 must not be advertised as active until it is deployed and tested.
Developer: for a developer or software team building an integration. You use your own server, create API credentials and request only the scopes you need.
Partner: for a business integrating KHS into a commercial product, marketplace, property-management platform, directory, booking flow or higher-volume service. Partner access is reviewed before custom scopes, higher limits, data licensing, white-label use or other commercial features are enabled.
Existing customer/provider account: being a normal KHS user does not automatically grant developer or partner API access. API access is a separate permission layer.
There is currently no published API subscription price or per-request charge in this implementation. We will not silently charge an API key. If KHS introduces paid API access, the applicable plan, limits, billing period, transaction/request charges and overage rules must be presented before the account is moved to that paid service.
Subscription
Only applies when a published plan is active.
Usage charges
Any request/transaction charge must be disclosed.
Partner pricing
Custom commercial terms agreed before activation.
Create a key from Developer API. Keys currently use the providers:read scope. Store the secret only on your server. Send it as an Authorization Bearer token.
Authorization: Bearer khs_live_your_key
Returns provider discovery data. Query parameters are county, town, verified=true|false, and limit. The server clamps limit to 1–50 and defaults to 20.
curl "https://backend.christech.co.ke/api/v1/providers?county=Kiambu&town=Ruiru&verified=true&limit=20" -H "Authorization: Bearer $KHS_API_KEY"
{
"data": [
{
"id": "provider-id",
"name": "Provider Name",
"county": "Kiambu",
"town": "Ruiru",
"verified": true,
"avatar_url": "https://...",
"bio": "Provider description",
"experience_years": 5,
"phone": "0712345678",
"whatsapp": "0712345678",
"availability": "...",
"price_range": "...",
"verification_badge_version": "verified",
"verified_at": "2026-10-08T10:00:00Z",
"latitude": -1.1,
"longitude": 36.9,
"services": [{"id":"service-id","name":"Cleaning","category":"Cleaning"}]
}
],
"pagination": {"limit": 20, "returned": 1}
}Provider phone/WhatsApp and location fields are sensitive integration data. Access and use must follow KHS terms, privacy requirements and the scope granted to your account.
const response = await fetch("https://backend.christech.co.ke/api/v1/providers?county=Kiambu&limit=20", {
headers: { Authorization: `Bearer ${process.env.KHS_API_KEY}` }
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || "KHS API request failed");import os, requests
response = requests.get(
"https://backend.christech.co.ke/api/v1/providers",
params={"county": "Kiambu", "limit": 20},
headers={"Authorization": "Bearer " + os.environ["KHS_API_KEY"]},
timeout=10,
)
response.raise_for_status()
providers = response.json()["data"]$ch = curl_init("https://backend.christech.co.ke/api/v1/providers?county=Kiambu&limit=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("KHS_API_KEY")],
CURLOPT_TIMEOUT => 10,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status < 200 || $status >= 300) throw new RuntimeException("KHS API request failed");
$data = json_decode($response, true);curl "https://backend.christech.co.ke/api/v1/providers?county=Kiambu&limit=20" -H "Authorization: Bearer $KHS_API_KEY"
401 — missing, invalid, revoked or expired key.
403 — key does not have providers:read.
503 — API disabled or not configured.
500 — temporary provider loading failure.
Deprecation: KHS should announce any legacy endpoint retirement before removing it. Clients should not assume an undocumented endpoint will remain available.