--- title: "DevPlace devRant-Compatible REST API" description: "The devRant compatibility layer: base URL and response shape, integer id mapping, the token-triple authentication model, and the rants, comments, users and notifications endpoints, with ready-made client scripts." language: null framework: null category: api_design tags: - devplace - api - http-api - devrant - compatibility - rest - api-design - integer-ids - client-library - migration keywords: - devrant api compatible endpoints devplace - devrant auth token token_id token_key user_id - devrant /api/devrant/rants list - devrant field mapping uid integer id - devrant client script python javascript last_updated: 2026-08-12 difficulty: intermediate version: "DevPlace (devplace.net), documented 2026-08" related: - authentication.md - README.md - conventions_and_errors.md search_priority: normal status: published --- # DevPlace devRant-Compatible REST API ## Overview DevPlace exposes a second REST protocol under `https://devplace.net/api` that reproduces the public [devRant](https://devrant.com) API shape on DevPlace data, so legacy devRant clients can run against this server unchanged. Rants are DevPlace posts, comments and votes are the native engagement layer, and every devRant action is funnelled through the same audited helpers as the website (so XP, notifications, and soft-delete all apply). This reference is split across focused pages: - [Authentication & accounts](#authentication-and-accounts) - login, registration, the token triple. - [Rants](#rants) - feed, single rant, create, edit, delete, vote, favorite, search. - [Comments](#comments) - read, post, edit, delete, vote. - [Users & avatars](#users-and-avatars) - profiles, username lookup, profile edit, avatars. - [Notifications](#notifications) - the notification feed. - [Client scripts](#client-scripts) - ready-to-run Python and JavaScript clients. ### Base URL and shape Every endpoint lives under `https://devplace.net/api` and returns JSON with a `success` boolean. On success the payload sits beside it; on a logical failure the response is `{ "success": false, "error": "..." }`. HTTP status is `200` for logical failures, except a bad login which returns `400` (matching devRant). Requests accept parameters as query string (`GET`/`DELETE`) or as a form body or JSON body (`POST`). ### Integer IDs devRant identifies everything by integer. DevPlace maps those directly onto the auto-increment `id` that every table already carries, so `rant_id` is a post's `id`, `comment_id` is a comment's `id`, and `user_id` is a user's `id`. There is no separate id space to track. ### Authentication model Write operations need the devRant token triple. `POST /api/users/auth-token` with a username (or email) and password returns an `auth_token` object; you then send `user_id`, `token_id`, and `token_key` with every request. Read endpoints (feed, single rant, search, profiles) work without authentication. See [Authentication & accounts](#authentication-and-accounts). ### Field mapping at a glance | devRant concept | DevPlace mapping | |-----------------|------------------| | `rant` | post (topic forced to `rant`; `text` is `title` + body when a title exists) | | `tags` | stored verbatim on the post and returned as-is (falls back to `[topic]`) | | `comment` | comment with `target_type = post` | | `vote` (`1`/`-1`/`0`) | upvote / downvote / clear on the native vote layer | | `favorite` / `unfavorite` | bookmark add / remove | | `user_avatar` | a real PNG rendered from the username (see [Users & avatars](#users-and-avatars)) | | `profile.skills` | derived from the user bio (DevPlace has no separate skills field) | ### Availability The protocol is toggled by the `devrant_api_enabled` site setting (default on); when off, every `/api` path returns `404`. Legacy clients hard-coded to `devrant.com` reach this server only through host routing (DNS / reverse-proxy), which is an infrastructure concern. ## Authentication and accounts Write operations authenticate with the devRant token triple. Log in once below and every authenticated widget across these pages becomes runnable (the token is kept in your browser only). Read operations ([rants](#rants), [profiles](#users-and-avatars)) need no authentication. `POST /api/users/auth-token` returns an `auth_token` whose `id` is the `token_id`, `key` is the `token_key`, and `user_id` is the integer user id; those three are sent automatically by these widgets (query params for `GET`/`DELETE`, form body for `POST`). A bad login returns HTTP `400`. See the [overview](#overview) for the response envelope. A DevRant auth token (the `key` field) also works on the **main DevPlace API**: use it as a Bearer token or `X-API-KEY` header on any DevPlace endpoint. See [Authentication](authentication.md) for details. DevPlace also has its own native token endpoint at `POST /auth/token` - see the [Authentication](authentication.md) page.
/api/users/auth-token
Minimal role: Public
Authenticate with username (or email) and password. Running this here logs you in for every widget on these pages.
/api/users
Minimal role: Public
Create a new account. Returns an auth token (you are logged in immediately).
/api/users/me
Minimal role: Member
Deactivate the logged-in account and revoke its tokens.
/api/devrant/rants
Minimal role: Public
List rants. Sort by recent, top, or algo.
/api/devrant/rants/{rant_id}
Minimal role: Public
Fetch one rant and its comments.
/api/devrant/rants
Minimal role: Member
Create a new rant. Tags are comma-separated and stored verbatim.
/api/devrant/rants/{rant_id}
Minimal role: Member
Replace a rant's text and tags (owner only).
/api/devrant/rants/{rant_id}
Minimal role: Member
Soft-delete a rant (owner or admin).
/api/devrant/rants/{rant_id}/vote
Minimal role: Member
Upvote (1), downvote (-1), or clear (0). Returns the updated rant.
/api/devrant/rants/{rant_id}/favorite
Minimal role: Member
Bookmark a rant.
/api/devrant/rants/{rant_id}/unfavorite
Minimal role: Member
Remove a rant bookmark.
/api/devrant/rants/{rant_id}/comments
Minimal role: Member
Post a comment on a rant.
/api/devrant/search
Minimal role: Public
Search rants by text in the title and body.
/api/comments/{comment_id}
Minimal role: Public
Fetch a single comment by id.
/api/comments/{comment_id}
Minimal role: Member
Replace a comment's text (owner only).
/api/comments/{comment_id}
Minimal role: Member
Soft-delete a comment (owner or admin).
/api/comments/{comment_id}/vote
Minimal role: Member
Upvote (1), downvote (-1), or clear (0).
/api/get-user-id
Minimal role: Public
Look up a user's integer id from their username.
/api/users/{user_id}
Minimal role: Public
Fetch a user's devRant profile with their rants and comments.
/api/users/me/edit-profile
Minimal role: Member
Update bio, location, git link, and website. profile_skills is accepted but ignored (skills are derived from the bio).
/api/avatars/u/{username}.png
Minimal role: Public
Every user_avatar.i points at this path. It renders a real PNG from the username seed; pass ?size= (16-512, default 128).
/api/users/me/notif-feed
Minimal role: Member
Fetch the logged-in user's notification feed with unread counts.
/api/users/me/notif-feed
Minimal role: Member
Mark every notification read.