Beta documentation. This is an early preview — content is still in active development. Feedback helps shape the final release. Share your thoughts or join the discussion.

Posts

```bash

On this page

List posts

curl "https://api.wapka.org/v1/posts?forumid=1&page=1&limit=20&sort=-created_at" \
  -H "Authorization: Bearer eyJ..."

Query parameters

Parameter Type Description
forumid int Filter by forum ID
userid int Filter by author user ID
status int Filter by status (0=draft, 1=published, 2=pending, 3=trash)
search string Search in title and content
sort string Sort field (prefix - for descending, default -created_at)
page int Page number
limit int Items per page

Response

{
  "data": [
    {
      "id": 101,
      "title": "Hello World",
      "content": "This is my first post!",
      "status": 1,
      "status_label": "Published",
      "format": "html",
      "format_label": "HTML",
      "thumb": "https://img.wapka.org/thumbs/101.jpg",
      "var": {},
      "forum": { "id": 1, "name": "General Discussion" },
      "owner": {
        "id": 36012,
        "username": "johndoe",
        "avatar": "https://img.wapka.org/u/36012.jpg"
      },
      "created_at": "2026-05-23T10:00:00Z",
      "updated_at": "2026-05-23T10:00:00Z"
    }
  ],
  "pagination": { "page": 1, "limit": 20, "totalItems": 42, "totalPages": 3, "hasNext": true, "hasPrev": false },
  "meta": { "requestId": "req_...", "timestamp": "..." }
}

Post fields

Field Type Description
id int Unique post ID
title string Post title
content string Post body (can be HTML, Markdown, BBCode, or plain text)
status int 0=draft (not published), 1=published (live), 2=pending (awaiting review), 3=trash (soft-deleted)
status_label string Human-readable status
format string html, text, md, or bbcode
format_label string Human-readable format
thumb string Thumbnail image URL
var object Custom metadata
forum object Forum reference ({ id, name })
owner object Author reference ({ id, username, avatar })
created_at string Creation timestamp (ISO 8601)
updated_at string Last update timestamp

Get a post

curl https://api.wapka.org/v1/posts/101 \
  -H "Authorization: Bearer eyJ..."

Returns the post with embedded owner and forum references.

Create a post

Requires a logged-in token.

curl -X POST https://api.wapka.org/v1/posts \
  -H "Authorization: Bearer eyJ..." \
  -H "Content-Type: application/json" \
  -d '{
    "forumid": 1,
    "title": "My First Post",
    "content": "<p>Hello World!</p>",
    "status": 1,
    "format": "html"
  }'
Field Required Type Description
forumid Yes int Target forum ID
title Yes string Post title
content Yes string Post body
status No int 1=published (default), 0=draft, 2=pending, 3=trash
format No string bbcode (default), html, text, or md
thumb No string Thumbnail image URL
var No object Custom metadata

Returns 201 Created with the new post object.

Update a post

Requires a logged-in token.

curl -X PATCH https://api.wapka.org/v1/posts/101 \
  -H "Authorization: Bearer eyJ..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Title",
    "content": "<p>Updated content.</p>",
    "status": "published"
  }'

All fields are optional — send only what you want to change.

Delete a post

Requires a logged-in token. Soft-deletes by default (sets status = "trash").

curl -X DELETE https://api.wapka.org/v1/posts/101 \
  -H "Authorization: Bearer eyJ..."

To permanently delete, add the query parameter:

curl -X DELETE "https://api.wapka.org/v1/posts/101?permanent=true" \
  -H "Authorization: Bearer eyJ..."

Restore a post

Soft-deleted posts can be restored:

curl -X POST https://api.wapka.org/v1/posts/101/restore \
  -H "Authorization: Bearer eyJ..."

Tip: Posts in the trash are visible with ?status=trash but excluded from default listings.

Lua API wrapper

-- List posts
local posts = api.posts:list({ forumid = 1, status = "published", page = 1, limit = 10 })

-- Get a post
local post = api.posts:get(101)

-- Create a post
api.posts:create({
    forumid = 1,
    title = "Hello",
    content = "<p>World</p>"
})

-- Update a post
api.posts:update(101, { title = "Updated", status = "published" })

-- Soft-delete
api.posts:delete(101)

-- Permanent delete
api.posts:delete(101, true)

-- Restore
api.posts:restore(101)

Next: Messages — direct messages and conversations.

Previous Forums Next Messages