Vylra API

The API behind Vylra

One backend for the web and mobile apps: posts, people, messages, wallet and payments, campaigns and notifications.

https://api.dznhub.com/v1

Quick start

Three calls: sign in, use the token, keep the session alive.

1

Sign in

curl -X POST https://api.dznhub.com/v1/auth/login \
  -H 'content-type: application/json' \
  -d '{"email": "you@example.com", "password": "your password"}'
2

Call the API with the access token

curl https://api.dznhub.com/v1/auth/me \
  -H 'authorization: Bearer ACCESS_TOKEN'
3

Refresh before it expires (15 minutes)

curl -X POST https://api.dznhub.com/v1/auth/refresh \
  -H 'content-type: application/json' \
  -d '{"refresh_token": "REFRESH_TOKEN"}'

How it works

The same rules everywhere in the API.

Sessions

Access tokens last 15 minutes. Refresh tokens rotate on every use and work once; reusing an old one ends the session. Web apps send X-Vylra-Client: web and get the refresh token as an HttpOnly cookie instead. Public keys: /v1/auth/jwks.json.

Errors

Every error is application/problem+json with a stable code to branch on and a request_id to quote to support. See common codes.

Pagination

Lists return items and next_cursor. Pass the cursor back as cursor for the next page; it is null at the end.

Rate limits

Responses carry RateLimit and RateLimit-Policy headers. A 429 comes with Retry-After: wait that long, then retry.

Safe retries

Payment and money calls take an Idempotency-Key header: send the same key when you retry and the action happens only once.

Realtime

Messages, typing and notifications arrive over a WebSocket at /v1/realtime. Send the access token in the first message, {"type": "auth", "token": ...}, never in the URL.

Common error codes

The full list per endpoint is in the reference.

codestatusmeaning
validation_failed422A field is missing or invalid; errors lists each field.
auth.invalid_credentials401Email or password is incorrect.
auth.token_expired401The access token expired: refresh it and retry.
auth.session_expired401The session ended (signed out, password changed): sign in again.
auth.password_reset_required403The account must set a new password; a link was emailed.
auth.suspended403The account is suspended.
rate_limited429Too many requests: wait Retry-After seconds.
idempotency.key_required400This POST needs an Idempotency-Key header.