Skip to content
leanwrldd edited this page Aug 19, 2026 · 1 revision

← Back to Home

News

Overview

Announcement feed — posts belong to a news channel (freeform editorial feeds like Announcements/Releases/Leaks — a completely different system from the Comp Channels on the Files & Stream page; ?channel= here is a news slug, not a file-tree slug), can be featured, and can carry image and audio/file attachments. Posting requires is_news or admin; editing/deleting a post is restricted to its author unless the caller is an admin.

Feed

Method Path Access Description
GET /news/ No auth Paginated feed. Filter: ?channel=, sort: ?ordering=-published_at|published_at, ?page=, ?page_size=
GET /news/{id}/ No auth Single post
POST /news/ is_news or admin Create a post
PATCH /news/{id}/ is_news or admin Edit a post — own post only, unless admin
DELETE /news/{id}/ is_news or admin Delete a post — own post only, unless admin
GET /news/?channel=announcements&ordering=-published_at

{
  "results": [ /* NewsItem[] — see shape below */ ],
  "count": 42,
  "next": "https://juicewrldapi.com/juicewrld/news/?channel=announcements&page=2"
}

Omit channel (or pass the client's pseudo-value "all", which is never sent to the server) for the unfiltered feed across every channel.

Create payload (title + channel required, rest optional):

POST /news/
Authorization: Token <token>

{
  "title": "required",
  "channel": "announcements",   // a news-channel slug — required
  "summary": "optional — short plain-text teaser shown in the feed",
  "body": "optional — full article, Markdown",
  "category": "optional — freeform label, e.g. \"Release\"",
  "featured": false,
  "image_url": "optional — https URL, or a base64 data: image ≤2MB",
  "attachments": [ /* { name, url } from POST /news/uploads/ — the full desired set */ ]
}

Post object shape:

{
  "id": 12,
  "title": "New leak dropped",
  "summary": "Short teaser text",
  "body": "Full **markdown** article body",
  "image_url": "https://juicewrldapi.com/media/news/cover.jpg",
  "channel": "leaks",
  "category": "Leak",
  "featured": true,
  "author": "someuser",
  "author_id": 12,
  "attachments": [
    { "id": 5, "name": "snippet.mp3", "url": "...", "mime": "audio/mpeg", "size": 1048576 }
  ],
  "published_at": "2026-08-19T16:00:00Z"
}

author_id is what the client compares against the logged-in user's own id to decide whether Edit/Delete show up — this field being absent or wrong on the server response breaks that gating, so make sure it's always populated.

Body is rendered client-side as Markdown with raw HTML stripped — links/images are restricted to http/https/mailto. There is no server-side sanitization requirement beyond that (the client never executes raw HTML from body).

Channels

Method Path Access Description
GET /news/channels/ No auth List news channels
POST /news/channels/ Admin Create a channel — slug generated from label
PATCH /news/channels/{slug}/ Admin Rename/re-describe a channel
DELETE /news/channels/{slug}/ Admin Delete a channel — only if it has no posts
{ "results": [
  { "id": "announcements", "label": "Announcements", "description": "optional one-liner" }
] }

id on the returned object is the slug — used both in the URL for PATCH/DELETE and as the ?channel= value on the Feed endpoints above.

Attachments

Cover images ride inline as an https URL or a base64 data: image (≤2MB) in the post payload. Everything else — including audio clips — uploads separately through a dedicated endpoint first, and the post payload then references the returned hosted { name, url }.

Method Path Access Description
POST /news/uploads/ is_news or admin Upload one file — multipart, ≤25MB. Returns a hosted attachment record
GET /news/attachments/{id}/stream/ No auth Stream/download a hosted attachment. An optional /{name} suffix and ?download=1 (forces a download instead of inline playback) are both supported
POST /news/uploads/
Authorization: Token <token>
Content-Type: multipart/form-data; boundary=... (set automatically)

FormData:
  file  <binary>

Attachment object shape:

{
  "id": 5,
  "name": "snippet.mp3",
  "url": "https://juicewrldapi.com/media/news/attachments/snippet.mp3",
  "mime": "audio/mpeg",
  "size": 1048576
}

The client classifies an attachment as image/audio/generic-file first by mime, falling back to a guess from name's extension when mime is missing or generic (e.g. application/octet-stream) — send an accurate mime where possible so that guess is never needed.

The client builds attachment stream/download URLs from id via /news/attachments/{id}/stream/{name} when id is present, and falls back to the raw url field only for older/id-less rows — a new upload should always come back with an id.

Clone this wiki locally