API Reference

Base URL: https://tridax.org

Authentication

Every authenticated endpoint expects a bearer token:

Authorization: Bearer YOUR_TOKEN

Generate tokens at /dashboard/profile. Tokens expire after 30 days unless refreshed.

Authentication

POST
/api/v1/auth/login

Exchange email + password for a bearer token.

POST
/api/v1/auth/refresh

Refresh an expiring bearer token.

POST
/api/v1/auth/logout

Invalidate the current bearer token.

Users

GET
/api/v1/users

List users (paginated).

GET
/api/v1/users/:id

Fetch a single user.

POST
/api/v1/users

Create a user (admin only).

PUT
/api/v1/users/:id

Update a user.

Blog

GET
/api/v1/blog/posts

List published posts.

GET
/api/v1/blog/posts/:slug

Get a single post by slug.

GET
/api/v1/blog/categories

List active categories.

Payments

POST
/api/checkout-init

Initialize a Paystack transaction.

GET
/api/payment-callback

Paystack redirect target after checkout.

POST
/api/paystack-webhook

Paystack server-to-server event receiver.

Public forms

POST
/api/contact-submit

Submit the contact form.

POST
/api/newsletter-subscribe

Subscribe to the newsletter.

POST
/api/feedback

Submit feedback.

Live chat

POST
/api/chat?action=start

Start a new visitor chat session.

POST
/api/chat?action=send

Visitor sends a message.

GET
/api/chat?action=poll

Visitor polls for new messages.

Rate limits

Default: 1,000 requests/hour per API key. Exceeded requests return HTTP 429 with a Retry-After header.

Errors

All errors return JSON in this shape:

{
  "ok":    false,
  "error": "Human-readable message",
  "code":  "validation_error"
}
StatusMeaning
200OK
201Resource created
400Bad request (malformed JSON, etc)
401Missing or invalid auth token
403Authenticated but not authorised
404Resource not found
422Validation failed (check `errors` field)
429Rate limit exceeded
500Server error — try again or contact support