API Reference

Laetium REST API

Get a Bearer token from /api/v1/auth/login.

Base URL

https://laetium.doombringerz.com

Pass Authorization: Bearer <token> on every authenticated request. Rate limit per IP: 20 requests a second, 300 a minute, 5,000 an hour. Workspace-scoped routes read the workspace from an X-Workspace-Id header.

Authentication

/api/v1/auth

POST/api/v1/auth/register

Create a user account.

POST/api/v1/auth/login

Authenticate. Returns an access token and sets the refresh token as an HttpOnly cookie.

POST/api/v1/auth/refresh

Exchange a refresh token for a new access token.

POST/api/v1/auth/logout

Revoke every session of the signed-in user.

POST/api/v1/auth/me/2fa/setup

Generate a TOTP secret and QR code URI.

POST/api/v1/auth/me/2fa/enable

Verify a TOTP code and enable 2FA.

POST/api/v1/auth/2fa/verify

Second login step with 2FA on: exchange the temporary token and a TOTP code for a session.

POST/api/v1/auth/eclipsecp/sso

Exchange an EclipseCP SSO token for a Laetium session.

Workspaces

/api/v1/workspaces

GET/api/v1/workspaces/

Workspaces the authenticated user belongs to.

POST/api/v1/workspaces/

Create a workspace.

GET/api/v1/workspaces/:id

Workspace details and member list.

PATCH/api/v1/workspaces/:id

Update workspace name, slug or branding.

POST/api/v1/workspaces/:id/members

Invite a user by email with a given role.

DELETE/api/v1/workspaces/:id/members/:userId

Remove a member from the workspace.

Social accounts

/api/v1/platforms

GET/api/v1/platforms/accounts

Connected social accounts in the current workspace.

DELETE/api/v1/platforms/accounts/:id

Disconnect a social account.

POST/api/v1/platforms/accounts/:id/sync

Re-read an account's profile, refreshing its token first if it has expired.

Scheduler

/api/v1/posts

GET/api/v1/posts/calendar

Posts scheduled between two dates.

POST/api/v1/posts/

Create a scheduled post.

POST/api/v1/posts/batch

Create up to 50 posts for one account, spread over time.

POST/api/v1/posts/import-csv

Create posts from an uploaded CSV file.

PATCH/api/v1/posts/:id

Update a draft or scheduled post.

PATCH/api/v1/posts/:id/reschedule

Move a post to a new time.

POST/api/v1/posts/:id/retry

Retry a failed post.

DELETE/api/v1/posts/:id

Delete a post.

GET/api/v1/posts/best-times

Hours of the day ranked by the engagement of one account's posts.

Analytics

/api/v1/analytics

GET/api/v1/analytics/overview

Aggregate KPIs (followers, impressions, reach, engagement) for one account over the last N days.

GET/api/v1/analytics/top-posts

Top posts ranked by engagement rate, reach, impressions or likes.

GET/api/v1/analytics/heatmap

Engagement heatmap (hour × day of week).

GET/api/v1/analytics/demographics

Audience demographics (age, gender, location), where the platform returns them.

Competitors

/api/v1/competitors

GET/api/v1/competitors/

Tracked competitor accounts.

POST/api/v1/competitors/

Add a public account to track.

DELETE/api/v1/competitors/:id

Remove a competitor from tracking.

GET/api/v1/competitors/:id/snapshots

Recorded stats for a competitor. Stat collection is not live yet, so this returns whatever has been recorded, which today is nothing.

Reports

/api/v1/reports

GET/api/v1/reports/

List reports.

POST/api/v1/reports/

Create a report. Branding and schedule fields are refused while report branding is gated off.

POST/api/v1/reports/:id/generate

Render a report to PDF. PDF rendering is not live yet.

DELETE/api/v1/reports/:id

Delete a report.

Need help with the API?

Request body schemas, response shapes, and error codes on request.

contactlaetium@doombringerz.com →