Skip to main content
Admin endpoints are organized under the /api/admin prefix with sub-routes for users (/users), categories (/categories), skills (/skills), and escrow (/escrow).
All endpoints on this page require a valid JWT with the admin role. Requests from client or freelancer roles receive a 403 Forbidden response. The only exception is PUT /api/admin/escrow/refund-client, which also accepts the client role.

User management

GET /api/admin/users/get-clients

Retrieve a list of all registered client accounts. Auth required: Yes — admin role

Response

Array of client user objects including name, email, status, role, and profile details.
cURL
curl "https://your-backend-domain.com/api/admin/users/get-clients" \
  -H "Authorization: Bearer <adminAccessToken>"

GET /api/admin/users/get-freelancers

Retrieve a list of all registered freelancer accounts. Auth required: Yes — admin role

Response

Array of freelancer user objects including name, email, status, role, and profile details.
cURL
curl "https://your-backend-domain.com/api/admin/users/get-freelancers" \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/users/block-freelancer/:freelancerId

Block a freelancer account. The user’s status is set to blocked, preventing login. Auth required: Yes — admin role

Path parameters

freelancerId
string
required
MongoDB ObjectId of the freelancer to block.

Response

message
string
Confirmation that the account was blocked.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/users/block-freelancer/64f1a2b3c4d5e6f7a8b9c0d6 \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/users/unblock-freelancer/:freelancerId

Restore access to a blocked freelancer account. Auth required: Yes — admin role

Path parameters

freelancerId
string
required
MongoDB ObjectId of the freelancer to unblock.

Response

message
string
Confirmation that the account was unblocked.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/users/unblock-freelancer/64f1a2b3c4d5e6f7a8b9c0d6 \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/users/block-client/:clientId

Block a client account, preventing login and job posting. Auth required: Yes — admin role

Path parameters

clientId
string
required
MongoDB ObjectId of the client to block.

Response

message
string
Confirmation that the account was blocked.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/users/block-client/64f1a2b3c4d5e6f7a8b9c0d5 \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/users/unblock-client/:clientId

Restore access to a blocked client account. Auth required: Yes — admin role

Path parameters

clientId
string
required
MongoDB ObjectId of the client to unblock.

Response

message
string
Confirmation that the account was unblocked.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/users/unblock-client/64f1a2b3c4d5e6f7a8b9c0d5 \
  -H "Authorization: Bearer <adminAccessToken>"

Category management

POST /api/admin/categories/add-category

Create a new job category. Auth required: Yes — admin role

Request body

name
string
required
Display name for the category (e.g., "Web Development").

Response

message
string
Confirmation that the category was added.
category
object
The created category document.
cURL
curl -X POST https://your-backend-domain.com/api/admin/categories/add-category \
  -H "Authorization: Bearer <adminAccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Mobile Development"}'

PUT /api/admin/categories/edit-category/:id

Update an existing category’s name. Auth required: Yes — admin role

Path parameters

id
string
required
MongoDB ObjectId of the category to update.

Request body

name
string
required
New category name.

Response

The updated category document.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/categories/edit-category/64f1a2b3c4d5e6f7a8b9c0d1 \
  -H "Authorization: Bearer <adminAccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name": "iOS & Android Development"}'

GET /api/admin/categories/get-categories

Retrieve all job categories. This endpoint is publicly accessible and is used to populate category dropdowns on job creation forms. Auth required: No

Response

Array of category objects with _id, name, and isListed.
cURL
curl "https://your-backend-domain.com/api/admin/categories/get-categories"

PUT /api/admin/categories/list-category/:id

Set a category’s isListed to true, making it visible in the job creation form. Auth required: Yes — admin role

Path parameters

id
string
required
MongoDB ObjectId of the category.

Response

message
string
Confirmation that the category was listed.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/categories/list-category/64f1a2b3c4d5e6f7a8b9c0d1 \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/categories/unlist-category/:id

Set a category’s isListed to false, hiding it from the job creation form without deleting it. Auth required: Yes — admin role

Path parameters

id
string
required
MongoDB ObjectId of the category.

Response

message
string
Confirmation that the category was unlisted.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/categories/unlist-category/64f1a2b3c4d5e6f7a8b9c0d1 \
  -H "Authorization: Bearer <adminAccessToken>"

Skills management

POST /api/admin/skills/add-skills

Add a new skill to the platform’s skill library. Auth required: Yes — admin role

Request body

name
string
required
Display name for the skill (e.g., "React").

Response

message
string
Confirmation that the skill was added.
skill
object
The created skill document.
cURL
curl -X POST https://your-backend-domain.com/api/admin/skills/add-skills \
  -H "Authorization: Bearer <adminAccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name": "TypeScript"}'

PUT /api/admin/skills/edit-skills/:id

Update an existing skill’s name. Auth required: Yes — admin role

Path parameters

id
string
required
MongoDB ObjectId of the skill to update.

Request body

name
string
required
New skill name.

Response

The updated skill document.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/skills/edit-skills/64f1a2b3c4d5e6f7a8b9c0d2 \
  -H "Authorization: Bearer <adminAccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name": "TypeScript 5"}'

GET /api/admin/skills/get-skills

Retrieve all skills. Publicly accessible; used to populate skill-selection dropdowns. Auth required: No

Response

Array of skill objects with _id, name, and isListed.
cURL
curl "https://your-backend-domain.com/api/admin/skills/get-skills"

PUT /api/admin/skills/list-skills/:id

Set a skill’s isListed to true. Auth required: Yes — admin role

Path parameters

id
string
required
MongoDB ObjectId of the skill.

Response

message
string
Confirmation that the skill was listed.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/skills/list-skills/64f1a2b3c4d5e6f7a8b9c0d2 \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/skills/unlist-skills/:id

Set a skill’s isListed to false, hiding it from skill-selection dropdowns without deleting it. Auth required: Yes — admin role

Path parameters

id
string
required
MongoDB ObjectId of the skill.

Response

message
string
Confirmation that the skill was unlisted.
cURL
curl -X PUT https://your-backend-domain.com/api/admin/skills/unlist-skills/64f1a2b3c4d5e6f7a8b9c0d2 \
  -H "Authorization: Bearer <adminAccessToken>"

Escrow management

GET /api/admin/escrow/total-revenue

Retrieve the total platform revenue earned from all completed transactions. Platform revenue is the sum of all platformFee values on escrow records. Auth required: Yes — admin role

Response

data
number
Total platform revenue in INR.
cURL
curl "https://your-backend-domain.com/api/admin/escrow/total-revenue" \
  -H "Authorization: Bearer <adminAccessToken>"

GET /api/admin/escrow/balance

Retrieve the total amount currently held in escrow across all active contracts. Auth required: Yes — admin role

Response

data
number
Total escrow balance in INR — sum of amount on all funded escrow records.
cURL
curl "https://your-backend-domain.com/api/admin/escrow/balance" \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/escrow/release-fund/:contractId

Approve a pending fund-release request and transfer earnings to the freelancer’s wallet. See Payments endpoints for full context. Auth required: Yes — admin role

Path parameters

contractId
string
required
MongoDB ObjectId of the contract.

Response

message
string
Confirmation that the funds were released.
data
object
Updated escrow record with status: "released".
cURL
curl -X PUT https://your-backend-domain.com/api/admin/escrow/release-fund/64f1a2b3c4d5e6f7a8b9c0ef \
  -H "Authorization: Bearer <adminAccessToken>"

PUT /api/admin/escrow/refund-client/:contractId/:clientId

Refund the escrowed amount to the client’s wallet for a canceled or disputed contract. See Payments endpoints for full context. Auth required: Yes — admin or client role

Path parameters

contractId
string
required
MongoDB ObjectId of the contract.
clientId
string
required
MongoDB ObjectId of the client to refund.

Request body

cancelReason
string
Short reason code for the refund.
cancelReasonDescription
string
Detailed explanation of the reason.

Response

message
string
Confirmation that the refund was processed.
data
object
Updated escrow record with status: "refunded".
cURL
curl -X PUT "https://your-backend-domain.com/api/admin/escrow/refund-client/64f1a2b3c4d5e6f7a8b9c0ef/64f1a2b3c4d5e6f7a8b9c0d5" \
  -H "Authorization: Bearer <adminAccessToken>" \
  -H "Content-Type: application/json" \
  -d '{
    "cancelReason": "dispute",
    "cancelReasonDescription": "Client reported incomplete deliverables."
  }'

GET /api/admin/escrow/transactions

Retrieve a full list of all escrow transactions across the platform. Auth required: Yes — admin role

Response

count
number
Total number of escrow transaction records.
data
object[]
Array of escrow transaction documents.
cURL
curl "https://your-backend-domain.com/api/admin/escrow/transactions" \
  -H "Authorization: Bearer <adminAccessToken>"

GET /api/admin/escrow/sales-report

Retrieve aggregated sales data for admin reporting and dashboard charts. Returns the same escrow transaction dataset as /transactions — apply your own aggregation or use the frontend charting layer. Auth required: Yes — admin role

Response

Same response shape as GET /api/admin/escrow/transactions.
cURL
curl "https://your-backend-domain.com/api/admin/escrow/sales-report" \
  -H "Authorization: Bearer <adminAccessToken>"

Build docs developers (and LLMs) love