Introduction

Welcome to the OurFundi Backend API. This API provides programmatic access to the OurFundi platform, allowing third-party developers to integrate with our services.

The base URL for all API requests is:

https://api.ourfundi.co.ke/api/v1

All requests and responses are in JSON format.

Authentication

To authenticate, include your API key in the headers of your request.

curl -X GET "https://api.ourfundi.co.ke/api/v1/users" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
Login
POST /api/v1/auth/login
Request Body
{
    "email": "user@example.com",
    "password": "your_password"
}
Success Response (200)
{
    "status": "success",
    "data": {
        "token": "eyJhbGciOiJIUzI1NiIs...",
        "user": {
            "id": 1,
            "name": "John Doe",
            "email": "user@example.com"
        }
    }
}
Get User Profile
GET /api/v1/users/{id}
Example Request
curl -X GET "https://api.ourfundi.co.ke/api/v1/users/1" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Success Response (200)
{
    "status": "success",
    "data": {
        "id": 1,
        "name": "John Doe",
        "email": "user@example.com",
        "role": "client",
        "created_at": "2026-09-03T12:00:00Z"
    }
}
List Available Jobs
GET /api/v1/jobs
Query Parameters
ParamTypeDescription
categoryStringFilter by job category
pageIntegerPagination page number
Success Response (200)
{
    "status": "success",
    "data": [
        {
            "id": 101,
            "title": "Plumbing Repair",
            "description": "Fix leaking sink in Nairobi",
            "budget": 5000,
            "status": "open"
        }
    ],
    "meta": {
        "total": 1,
        "page": 1
    }
}
Make a Payment
POST /api/v1/payments
Request Body
{
    "job_id": 101,
    "amount": 5000,
    "payment_method": "mpesa"
}
Success Response (201)
{
    "status": "success",
    "data": {
        "transaction_id": "MPE123456789",
        "job_id": 101,
        "amount": 5000,
        "status": "completed"
    }
}

Error Codes

HTTP Status Code Error Code Description
400VALIDATION_ERRORThe request parameters are invalid.
401UNAUTHORIZEDMissing or invalid API token.
404NOT_FOUNDThe requested resource does not exist.
500SERVER_ERRORAn unexpected error occurred on the server.

© 2026 OurFundi. All rights reserved.