Skip to the article
Aniq-UI

Dashboard 2API reference

API reference

Every route the NestJS API serves, who may call it, and how sign-in, permissions, errors, lists and limits work.

For the Full Stack package

Base URL and response format

Every route is served under the /api prefix. Locally the base URL is http://localhost:8000/api; on a server it is your API's address followed by /api, the same value the dashboard reads from NEXT_PUBLIC_API_BASE_URL. Request bodies are JSON, except the upload. Every answer comes in the same envelope:

Envelope
{
  "success": true,
  "data": { },
  "message": ""
}

data holds the result. message is a short sentence some writes fill in, in the request's language, and empty otherwise. The health check needs no token:

Terminal
curl http://localhost:8000/api/health
Response
{"success":true,"data":{"status":"ok","database":"up"},"message":""}

Until the database answers and holds its tables, it answers 503 with "status":"unavailable" and "database":"down". The Docker image's health check reads it.

Errors

A failure keeps the envelope, with success: false and the HTTP status:

Error
{
  "success": false,
  "data": null,
  "message": "That email and password combination didn't work. Please try again.",
  "errors": { "email": ["Enter a valid email address (example@domain.com)."] }
}
  • message is a sentence in the request's language.
  • errors is filled on a validation failure, with the problems per field. A body field the route does not know is refused.
  • A guarded route with no token, or an expired one, answers 401; a token without the permission answers 403.

Lists and paging

List routes take page and page_count (or limit). page_count is capped at 100; a missing or invalid value falls back to the route's default, 15 for users and 10 for the others.

data of a list
{ "data": [ ], "page": 1, "limit": 15, "total": 15, "totalPages": 1 }

Users come newest first by default (order=asc reverses it); projects newest-updated first; admins newest first; settings by category; roles by name.

Language

Send Accept-Language: ar for Arabic messages; anything else answers in English. Countries, permissions, settings and project names carry both languages as { "en": "…", "ar": "…" } whatever the header says, and the client picks one.

Signing in

  1. Get a token

    Post an admin's email and password. A seeded API accepts the Super Admin from the installation guide.

    Terminal
    curl -X POST http://localhost:8000/api/auth/login -H "Content-Type: application/json" -d '{"email":"admin@example.com","password":"Admin@123"}'
    Response
    {
      "success": true,
      "data": {
        "access_token": "eyJ…",
        "token_type": "Bearer",
        "expires_in": "7d",
        "admin": { "id": 1, "email": "admin@example.com", "username": "…", "roles": [ ], "permissions": [ ] }
      },
      "message": "Signed in successfully."
    }
  2. Send it on every call

    Terminal
    curl http://localhost:8000/api/auth/me -H "Authorization: Bearer eyJ…"

    Expected result: /api/auth/me returns the signed-in admin with their roles and permissions.

  • A token lasts JWT_EXPIRATION, 7d by default. There is no refresh route: sign in again.
  • A wrong email and a wrong password get the same 401 message.
  • After RATE_LIMIT_LOGIN failed sign-ins (10 by default) from one address within 15 minutes, POST /api/auth/login answers 429 until the oldest failure is 15 minutes old. The count is kept in memory, so a restart clears it.
MethodPathWho can call itWhat it does
POST/api/auth/loginAnyoneSign in with email and password
GET/api/auth/meAny signed-in adminThe signed-in admin, with roles and permissions
GET/api/healthAnyoneReadiness: 200 or 503

Permissions

Every route below needs Authorization: Bearer with a token, except the ones marked Anyone. Most also need a permission, named module.action; an admin holds the permissions of all their roles. The 25 permissions are listed in Screens, roles and permissions.

Users

The people your product serves, addressed by username. Deleting is a soft delete.

MethodPathWho can call itWhat it does
GET/api/usersAdmins with users.viewList, with search, email, phone, country_id, username, first_name, last_name, from_date, to_date and order
GET/api/users/statisticAdmins with users.viewTotals: total, deleted, verified and unverified
GET/api/users/deletedAdmins with users.viewDeleted users, with the same filters
GET/api/users/deleted/:usernameAdmins with users.viewOne deleted user
GET/api/users/:usernameAdmins with users.viewOne user
POST/api/usersAdmins with users.createCreate: first_name, last_name, email, password, and optionally username, phone, profile_picture, country_id
PATCH/api/users/:usernameAdmins with users.updateEdit any of those fields
PATCH/api/users/:username/change-passwordAdmins with users.updateSet a new password
POST/api/users/:username/make-verifiedAdmins with users.verifyMark the email verified
POST/api/users/:username/make-unverifiedAdmins with users.verifyMark it unverified
POST/api/users/:username/resend-verification-emailAdmins with users.updateAnswers success; sends no mail, ready for your own mail service
DELETE/api/users/:usernameAdmins with users.deleteSoft delete
POST/api/users/deleted/:username/restoreAdmins with users.restoreRestore

Projects

Projects carry name, description, environment, status (in-progress, ready or blocked), version, optional image and icon_name, and translations with an en and an ar name and description.

MethodPathWho can call itWhat it does
GET/api/projectsAdmins with projects.viewList, with name, status and environment
GET/api/projects/statisticAdmins with projects.viewTotals by status
GET/api/projects/recentAdmins with projects.viewThe latest projects, limit 5 by default
GET/api/projects/deletedAdmins with projects.viewDeleted projects, with name
GET/api/projects/:idAdmins with projects.viewOne project
POST/api/projectsAdmins with projects.createCreate
PATCH/api/projects/:idAdmins with projects.editEdit
DELETE/api/projects/:idAdmins with projects.deleteSoft delete
POST/api/projects/deleted/:id/restoreAdmins with projects.restoreRestore

Quick tasks

The overview's to-do list. Every admin has their own and needs no permission: each route reads and writes only the caller's tasks. A task is text and completed.

MethodPathWho can call itWhat it does
GET/api/tasksAny signed-in adminYour tasks, newest first, with status. The paging fields sit beside data in the envelope, not inside it.
GET/api/tasks/historyAny signed-in adminAll your tasks, split into active and completed
GET/api/tasks/statsAny signed-in adminYour totals
GET/api/tasks/:idAny signed-in adminOne task
POST/api/tasksAny signed-in adminCreate
PATCH/api/tasks/:idAny signed-in adminEdit
PATCH/api/tasks/:id/toggleAny signed-in adminMark done or not done
DELETE/api/tasks/:idAny signed-in adminDelete

Admins and your profile

The accounts that sign in to the dashboard. :id accepts an id or a username.

MethodPathWho can call itWhat it does
GET/api/adminsAdmins with admins.viewList, with email, name and phone
GET/api/admins/statisticsAdmins with admins.viewTotals
GET/api/admins/:idAdmins with admins.viewOne admin, with roles
POST/api/adminsAdmins with admins.createCreate: first_name, last_name, email, password, password_confirmation, and optionally phone, profile_picture, country_id
PATCH/api/admins/:idAdmins with admins.editEdit
PATCH/api/admins/:id/rolesAdmins with admins.assign_rolesReplace the roles: role_ids
DELETE/api/admins/:idAdmins with admins.deleteDelete
PATCH/api/admins/profileAdmins with admins.editEdit your own profile
PATCH/api/admins/profile/passwordAny signed-in adminChange your own password: current_password, password, password_confirmation

Roles

MethodPathWho can call itWhat it does
GET/api/rolesAdmins with roles.viewList, with name, guard_name, created_from and created_to; paged only when both page and page_count are sent
GET/api/roles/statisticsAdmins with roles.viewTotals
GET/api/roles/selectAdmins with roles.viewEvery role, for a select box
GET/api/roles/permissionsAdmins with roles.viewEvery permission, by module
GET/api/roles/:idAdmins with roles.viewOne role, with its permissions
POST/api/rolesAdmins with roles.createCreate: name
PUT/api/roles/:idAdmins with roles.editRename: name
POST/api/roles/:id/permissionsAdmins with roles.assign_permissionsReplace what the role grants: permissions, a list of permission names. Signed-in holders are told at once.
DELETE/api/roles/:idAdmins with roles.deleteDelete

App settings

Key and value pairs with a display name, a description, a type and a category, such as site_name, support_email and maintenance_mode.

MethodPathWho can call itWhat it does
GET/api/settingsAdmins with settings.viewList, with search and category
GET/api/settings/:keyAdmins with settings.viewOne setting
PATCH/api/settings/:keyAdmins with settings.editChange its value
DELETE/api/settings/:keyAdmins with settings.editDelete it

Countries and uploads

MethodPathWho can call itWhat it does
GET/api/helpers/countriesAnyoneThe 50 countries as { value, label, code, phone_code }, labelled in the request's language
POST/api/helpers/uploadAny signed-in adminUpload one image as multipart file, with optional path (the folder, uploads by default) and for (profile, cover, logo or default)

The upload takes one image of at most 10 MB, stores it in your R2 bucket as a JPEG of at most 1920 pixels wide, with a resized copy for its for value, and returns their addresses: original and, for example, 250x250. Without the R2 variables it answers 503 with "Image uploads are not set up on this server yet."

AI assistant and its conversations

Included with your purchase. Sign in to read, or open it in your download.

The assistant's streaming route, its model list and openers, and the saved conversations.

MCP server

Included with your purchase. Sign in to read, or open it in your download.

The MCP endpoint for coding agents and how it is authorised.

Live permission updates

Included with your purchase. Sign in to read, or open it in your download.

The Socket.IO namespace the dashboard listens on, its event and how a connection is authorised.

Demo mode routes

Included with your purchase. Sign in to read, or open it in your download.

The routes a public demo build adds.

Stuck on a step?

Find a fix before you start over.

Troubleshooting

Cookie Preferences

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies for analytics and personalized advertising.