DeHubOpen DeHub

DeHub › Docs

DeHub API Reference — REST and Mastodon APIs

DeHub has two HTTP APIs. The Mastodon-compatible API is the stable one for third-party apps. The DeHub REST API powers dehub.io and the phone app and covers every feature.

Base URLs

APIBase URLBest for
Mastodon-compatiblehttps://riftn.com/api/v1Apps that sign people in, read timelines and post. Works with every Mastodon library.
DeHub RESThttps://api.dehub.io/apiEverything DeHub does: feeds, videos, live, tips, search, leaderboards.
MCPhttps://riftn.com/mcpAI agents and assistants. See Connect.

The full REST reference, with every endpoint and a Try it button, is at api.dehub.io/api/docxx. The machine-readable OpenAPI file is at api.dehub.io/api/docxx-json, ready for code generators and API clients.

Public endpoints to start with

These need no sign-in:

# A profile, by handle or wallet
curl https://api.dehub.io/api/account_info/dehub

# The public feed
curl 'https://api.dehub.io/api/feed?limit=10'

# Search people and posts
curl 'https://api.dehub.io/api/search?q=music'

# The DHB leaderboard
curl https://api.dehub.io/api/leaderboard

# Public timeline, Mastodon format
curl 'https://riftn.com/api/v1/timelines/public?limit=20'

Authentication

For the Mastodon-compatible API, get a user token with OAuth and send it as Authorization: Bearer TOKEN. The REST API uses the short-lived session tokens that dehub.io and the phone app get when someone signs in; third-party apps should act for users through the Mastodon-compatible API.

Rate limits

Every REST answer carries your current limits:

x-ratelimit-limit-short: 20      # per 10 seconds
x-ratelimit-remaining-short: 19
x-ratelimit-limit-medium: 100    # per minute
x-ratelimit-limit-long: 500      # per 15 minutes
x-ratelimit-reset-long: 900

Limits count per IP address and per endpoint. Over a limit you get 429 Too Many Requests; wait for the matching reset seconds. Some endpoints have their own, tighter limits, and batch endpoints exist for bulk actions such as following many people.

Errors

Check the HTTP status first. Errors come back as JSON in one of these shapes:

{ "error": "Not Found: Account not found", "result": false }
{ "statusCode": 400, "message": "limit must be a number", "error": "Bad Request" }

The Mastodon-compatible API always answers errors as { "error": "…" }, as Mastodon clients expect.

Ids

People are identified by their wallet address in lowercase (0x…), and also by their handle. Posts have a numeric id, shown in their link: dehub.io/app/post/7180.

DeHub Blog · dehub.io home