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
/api/v1/auth/login
Exchange email + password for a bearer token.
/api/v1/auth/refresh
Refresh an expiring bearer token.
/api/v1/auth/logout
Invalidate the current bearer token.
Users
/api/v1/users
List users (paginated).
/api/v1/users/:id
Fetch a single user.
/api/v1/users
Create a user (admin only).
/api/v1/users/:id
Update a user.
Blog
/api/v1/blog/posts
List published posts.
/api/v1/blog/posts/:slug
Get a single post by slug.
/api/v1/blog/categories
List active categories.
Payments
/api/checkout-init
Initialize a Paystack transaction.
/api/payment-callback
Paystack redirect target after checkout.
/api/paystack-webhook
Paystack server-to-server event receiver.
Public forms
/api/contact-submit
Submit the contact form.
/api/newsletter-subscribe
Subscribe to the newsletter.
/api/feedback
Submit feedback.
Live chat
/api/chat?action=start
Start a new visitor chat session.
/api/chat?action=send
Visitor sends a message.
/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"
}
| Status | Meaning |
|---|---|
| 200 | OK |
| 201 | Resource created |
| 400 | Bad request (malformed JSON, etc) |
| 401 | Missing or invalid auth token |
| 403 | Authenticated but not authorised |
| 404 | Resource not found |
| 422 | Validation failed (check `errors` field) |
| 429 | Rate limit exceeded |
| 500 | Server error — try again or contact support |