v2

Loreax API

Loreax creator monetization API.

OpenAPI 3.0 v1.0.0 https://api.loreax.bervant.co.ke

Access 1

POST /v1/access/purchases Purchase a post

Purchase a post with one-off payment.

Request Body
postId integer required Post ID to purchase
promoCode string? Optional promo code for discount
{
    "postId": 123,
    "promoCode": "SAVE10"
}
Responses
201 Purchase successful
message string
data object
id string Purchase ULID
postId integer
buyerUserId integer
creatorUserId integer
grossAmount integer Total price in minor units
platformFee integer Platform fee in minor units
creatorNet integer Creator earnings in minor units
discount integer Discount applied in minor units
currency string
status string
expiresAt string<date-time>?
purchasedAt string<date-time>
grantsAccess boolean
meta object
requestId string
traceId string
timestamp string<date-time>
{
    "message": "Purchase completed",
    "data": {
        "id": "01HQ123456789ABCDEFGHJKMNP",
        "postId": 123,
        "buyerUserId": 456,
        "creatorUserId": 789,
        "grossAmount": 10000,
        "platformFee": 1500,
        "creatorNet": 8500,
        "discount": 0,
        "currency": "KES",
        "status": "completed",
        "expiresAt": "2025-01-01T00:00:00Z",
        "purchasedAt": "2026-04-24T08:00:00Z",
        "grantsAccess": true
    },
    "meta": {
        "requestId": "01HQ123456789ABCDEFGHJKMNP",
        "traceId": "0af7651916cd43dd8448eb211c80319c",
        "timestamp": "2026-04-24T08:00:00Z"
    }
}
422 Validation error
message string required
errors object required
meta object required
{
    "message": "Invalid input",
    "errors": [],
    "meta": []
}
430 Business rule violation (already purchased, no purchase rule, insufficient funds)
errorCode enum
message string
meta object
requestId string
traceId string
timestamp string<date-time>
{
    "errorCode": "POST_ALREADY_PURCHASED",
    "message": "User 456 has already purchased post 123.",
    "meta": {
        "requestId": "string",
        "traceId": "string",
        "timestamp": "2025-01-01T00:00:00Z"
    }
}

Content 14

POST /v1/collections Create a creator collection
Responses
201 Collection created
409 A supplied post does not belong to this creator
422 Validation error
DELETE /v1/content/comments/{comment} Delete own comment
Responses
200 Comment deleted
PATCH /v1/content/comments/{comment} Update own comment
Responses
200 Comment updated
422 Validation error
POST /v1/content/comments/{comment}/pin Pin a comment as the post creator
Responses
200 Comment pinned
POST /v1/posts/{post}/poll/vote Vote on a poll post
Responses
200 Poll vote saved
422 Validation error
GET /v1/posts/{post}/comments List comments for a post
Responses
200 Comments returned
POST /v1/posts/{post}/comments Create a comment
Responses
201 Comment created
422 Validation error
POST /v1/posts Create a draft post
Responses
201 Draft post created
422 Validation error
GET /v1/posts/{post} Show a post when visible to the current viewer
Responses
200 Post returned
404 Post not found
DELETE /v1/posts/{post} Delete an owned post
Responses
200 Post deleted
404 Post not found
PATCH /v1/posts/{post} Edit an owned post
Responses
200 Post updated
404 Post not found
409 Post cannot be edited
422 Validation error
POST /v1/posts/{post}/publish Publish an owned post
Responses
200 Post published
404 Post not found
409 Post cannot be published
POST /v1/posts/{post}/unpublish Unpublish an owned post
Responses
200 Post unpublished
404 Post not found
409 Post cannot be unpublished
POST /v1/posts/{post}/media Attach media to a draft post
Responses
201 Post media attached
404 Post not found
409 Post cannot be edited
422 Validation error

Core 1

GET / Get API root information

Returns API version, documentation links, and service status

Responses
200 API information
message string
data object
version string
docs object
wiki string
openapi object
schema string
json string
postman string
bruno string
interactive string
services object
meta object
requestId string
traceId string
timestamp string<date-time>
{
    "message": "Loreax v1 APIs",
    "data": {
        "version": "v1",
        "docs": {
            "wiki": "https://dev.loreax.bervant.co.ke",
            "openapi": {
                "schema": "https://dev.loreax.bervant.co.ke/api-reference",
                "json": "https://dev.loreax.bervant.co.ke/api-reference/download/openapi",
                "postman": "https://dev.loreax.bervant.co.ke/api-reference/download/postman",
                "bruno": "https://dev.loreax.bervant.co.ke/api-reference/download/bruno"
            },
            "interactive": "https://dev.loreax.bervant.co.ke/api-playground"
        },
        "services": {
            "postgres": {
                "status": "ok",
                "latency_ms": 12
            },
            "redis": {
                "status": "ok",
                "latency_ms": 2
            },
            "mongodb": {
                "status": "ok",
                "latency_ms": 1
            },
            "s3": {
                "status": "error",
                "message": "Unable to check existence"
            },
            "mpesa": {
                "status": "ok",
                "latency_ms": 494,
                "cached": false
            }
        }
    },
    "meta": {
        "requestId": "01HQ123456789ABCDEFGHJKMNP",
        "traceId": "0af7651916cd43dd8448eb211c80319c",
        "timestamp": "2026-04-27T10:00:00Z"
    }
}

Discovery 3

GET /v1/discovery/creators Browse public creators
Query Parameters
Name Type Required Description
niche string
category string
verified boolean
cursor string
limit integer
Responses
200 Cursor-paginated creator browse results
422 Validation error
POST /v1/discovery/interactions Log discovery interaction batch
Authentication

Bearer Token   Requires Authorization: Bearer <token> header.

Request Body
interactions array<object> required
targetType enum required
targetId string required
type enum required
surface enum
position integer
occurredAt string<date-time>
context object
{
    "interactions": [
        {
            "targetType": "post",
            "targetId": "string",
            "type": "impression",
            "surface": "home",
            "position": 1,
            "occurredAt": "2025-01-01T00:00:00Z",
            "context": []
        }
    ]
}
Responses
202 Interactions accepted
401 Unauthenticated
422 Validation error
GET /v1/discovery/search Search posts, creators, collections, and tags
Query Parameters
Name Type Required Description
q string
type string
niche string
category string
tag string
cursor string
limit integer
Responses
200 Ranked search results
422 Validation error

Identity 3

POST /v1/auth/login Authenticate and receive access token
Request Body
username string required Username or email address
password string required
deviceName string?
{
    "username": "string",
    "password": "string",
    "deviceName": "string"
}
Responses
200 Authenticated
401 Invalid credentials
422 Validation error
429 Rate limited
POST /v1/auth/logout Revoke the current access token
Authentication

Bearer Token   Requires Authorization: Bearer <token> header.

Responses
204 Logged out
POST /v1/auth/register Register a new user account
Request Body
email string<email> required
username string required
password string required
firstName string required
lastName string required
countryCode string?
referralCode string?
{
    "email": "string",
    "username": "string",
    "password": "string",
    "firstName": "string",
    "lastName": "string",
    "countryCode": "string",
    "referralCode": "string"
}
Responses
201 User registered
422 Validation error
430 EMAIL_ALREADY_REGISTERED or USERNAME_UNAVAILABLE

Monetization 13

GET /v1/monetization/premium Show current premium subscription
Responses
200 Premium status
POST /v1/monetization/premium Start premium subscription
Responses
201 Premium started
430 Business rule violation
POST /v1/monetization/premium/cancel Cancel premium at period end
Responses
200 Premium cancellation scheduled
GET /v1/creators/{creator}/tiers List a creator active tiers
Responses
200 Creator tiers listed
POST /v1/monetization/tiers Create a creator tier
Responses
201 Tier created
422 Validation error
PATCH /v1/monetization/tiers/{tier} Update an owned creator tier
Responses
200 Tier updated
404 Tier not found
POST /v1/monetization/tiers/{tier}/archive Archive an owned creator tier
Responses
200 Tier archived
GET /v1/monetization/tier-subscriptions List own tier subscriptions
Responses
200 Subscriptions listed
POST /v1/monetization/tier-subscriptions Subscribe to a tier
Responses
201 Subscription created
430 Business rule violation
POST /v1/monetization/tier-subscriptions/{subscription}/cancel Cancel a tier subscription at period end
Responses
200 Subscription cancellation scheduled
POST /v1/monetization/tier-subscriptions/{subscription}/resume Resume a tier subscription
Responses
200 Subscription resumed
GET /v1/monetization/verification-requests List own verification requests
Responses
200 Verification requests listed
POST /v1/monetization/verification-requests Submit a notable verification request
Responses
201 Verification request submitted

Payments 5

GET /v1/payments/withdrawals List own withdrawals
Responses
200 Withdrawals listed
POST /v1/payments/withdrawals Request a withdrawal
Responses
201 Withdrawal request created
422 Validation error
430 Business rule violation
GET /v1/payments/withdrawals/{withdrawal} Show a withdrawal
Responses
200 Withdrawal details
404 Not found
GET /v1/payments/withdrawal-methods List own withdrawal methods
Responses
200 Withdrawal methods listed
POST /v1/payments/withdrawal-methods Add a withdrawal method
Responses
201 Withdrawal method created
422 Validation error

Social 31

GET /v1/fanclubs List fan clubs the authenticated user belongs to
Responses
200 Fan clubs returned
POST /v1/fanclubs Create the authenticated creator fan club
Responses
201 Fan club created
422 Validation error
403 Creator required
GET /v1/fanclubs/{id} Show fan club details
Responses
200 Fan club returned
PATCH /v1/fanclubs/{id} Update fan club metadata
Responses
200 Fan club updated
422 Validation error
403 Creator required
POST /v1/fanclubs/{id}/join Join a fan club when qualified
Responses
201 Membership created
403 Membership requirements not met
GET /v1/fanclubs/{id}/channels List fan club channels
Responses
200 Channels returned
POST /v1/fanclubs/{id}/channels Create a fan club channel
Responses
201 Channel created
422 Validation error
403 Creator required
GET /v1/fanclubs/{id}/members List fan club members
Responses
200 Members returned
POST /v1/fanclubs/{id}/timeout-user Timeout a fan club member
Responses
201 Timeout created
422 Validation error
403 Moderator required
GET /v1/fanclubs/{id}/channels/{slug}/messages List historical fan club messages
Responses
200 Messages returned
POST /v1/fanclubs/{id}/channels/{slug}/messages Post a fan club message
Responses
201 Message posted
422 Validation error
403 Membership or channel access required
GET /v1/fanclubs/{id}/channels/{slug}/stream Open fan club message stream
Responses
200 SSE stream opened
POST /v1/fanclubs/{id}/messages/{msgId}/pin Pin a fan club message
Responses
200 Message pinned
403 Moderator required
POST /v1/fanclubs/{id}/messages/{msgId}/delete Delete a fan club message
Responses
200 Message deleted
422 Validation error
403 Moderator required
POST /v1/social/follow/{userId} Follow a user
Responses
201 Follow edge created or already present
430 Business rule violation
DELETE /v1/social/follow/{userId} Unfollow a user
Responses
200 Follow edge removed or already absent
GET /v1/users/{id}/followers List user followers
Responses
200 Followers returned
GET /v1/users/{id}/following List users followed by a user
Responses
200 Following returned
GET /v1/social/lists List own creator lists
Responses
200 Lists returned
POST /v1/social/lists Create a creator list
Responses
201 List created
422 Validation error
GET /v1/social/lists/{id} View a public or owned creator list
Responses
200 List returned
404 List not found
DELETE /v1/social/lists/{id} Delete an owned creator list
Responses
200 List deleted
403 Ownership required
PATCH /v1/social/lists/{id} Update an owned creator list
Responses
200 List updated
403 Ownership required
422 Validation error
POST /v1/social/lists/{id}/members/{userId} Add a member to an owned creator list
Responses
200 Member added
403 Ownership required
DELETE /v1/social/lists/{id}/members/{userId} Remove a member from an owned creator list
Responses
200 Member removed
403 Ownership required
POST /v1/social/posts/{id}/like Like a post
Responses
201 Post liked
DELETE /v1/social/posts/{id}/like Unlike a post
Responses
200 Post unliked
POST /v1/social/posts/{id}/share Track a post share
Responses
201 Share tracked
422 Validation error
POST /v1/social/posts/{id}/save Save a post
Responses
201 Post saved
422 Validation error
DELETE /v1/social/posts/{id}/save Unsave a post
Responses
200 Post unsaved
GET /v1/social/saves List own saved posts
Responses
200 Saved posts returned

Taxonomy 3

GET /v1/taxonomy/niches List active niches

Returns a list of all active niches (interests/genres) available on the platform.

Responses
200 List of active niches
message string
data array<object>
id string Public ULID
name string
slug string
description string?
isActive boolean
sortOrder integer
{
    "message": "Success",
    "data": [
        {
            "id": "01HQ123456789ABCDEFGHJKMNP",
            "name": "Technology",
            "slug": "technology",
            "description": "Tech, gadgets, software, and innovation",
            "isActive": true,
            "sortOrder": 1
        }
    ]
}
GET /v1/taxonomy/categories List active categories

Returns a list of all active categories, optionally filtered by niche.

Query Parameters
Name Type Required Description
nicheId string Filter categories by niche ID
Responses
200 List of active categories
message string
data array<object>
id string Public ULID
nicheId string?
name string
slug string
description string?
isActive boolean
sortOrder integer
{
    "message": "Success",
    "data": [
        {
            "id": "01HQ234567890BCDEFGHJKMNPQ",
            "nicheId": "01HQ123456789ABCDEFGHJKMNP",
            "name": "Web Development",
            "slug": "web-development",
            "description": "Frontend, backend, and full-stack development",
            "isActive": true,
            "sortOrder": 1
        }
    ]
}
GET /v1/taxonomy/tags Search active tags

Search for active tags by prefix. Returns tags matching the search term.

Query Parameters
Name Type Required Description
prefix string Search prefix for tag names
Responses
200 List of matching tags
message string
data array<object>
id string Public ULID
name string
slug string
useCount integer Number of posts using this tag
isActive boolean
{
    "message": "Success",
    "data": [
        {
            "id": "01HQ345678901CDEFGHJKMNPQR",
            "name": "javascript",
            "slug": "javascript",
            "useCount": 42,
            "isActive": true
        }
    ]
}

Timeline 3

GET /v1/timeline/home Get personalized home timeline
Authentication

Bearer Token   Requires Authorization: Bearer <token> header.

Query Parameters
Name Type Required Description
cursor string
limit integer
Responses
200 Ranked home timeline
401 Unauthenticated
422 Validation error
GET /v1/timeline/explore Get explore timeline
Query Parameters
Name Type Required Description
niche string
category string
tag string
creator string
cursor string
limit integer
Responses
200 Ranked explore timeline
422 Validation error
GET /v1/timeline/trending Get trending timeline
Query Parameters
Name Type Required Description
niche string
category string
tag string
cursor string
limit integer
Responses
200 Ranked trending timeline
422 Validation error