Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tech-dipesh/yeti-Jobs/llms.txt

Use this file to discover all available pages before exploring further.

The admin role in Yeti Jobs has elevated access to platform-wide operations that neither job seekers nor recruiters can perform. Admins can create and delete company profiles, promote users to recruiter status by assigning them to a company, and search across all users and companies. Every admin action is gated by the isAdmin middleware, which reads the role claim from the authenticated JWT and rejects requests from non-admin accounts with a 401 Unauthorized response.
The admin role cannot be set through any API endpoint. It must be assigned directly at the database level by running an UPDATE users SET role = 'admin' WHERE uid = '...' query on the PostgreSQL instance. There is intentionally no self-serve promotion path to prevent privilege escalation.

Admin Dashboard

Get a snapshot of platform-wide activity. The dashboard query runs six subqueries in a single SQL statement, returning counts for every major table.
GET /api/v1/admin/dashboard
curl https://yeti-jobs.onrender.com/api/v1/admin/dashboard \
  -H 'Cookie: token=<your_jwt_token>'
{
  "message": {
    "users_count": "1024",
    "jobs_count": "318",
    "companies_count": "47",
    "applications_count": "2891",
    "saved_jobs_count": "5430",
    "email_verified_count": "1001"
  }
}

users_count

Total registered users across all roles.

jobs_count

Total job listings ever posted on the platform.

companies_count

Total companies registered in the system.

applications_count

Total job applications submitted by all seekers.

saved_jobs_count

Total bookmark entries across all users.

email_verified_count

Total email verification records created.

Assigning a User to a Company

Assigning a user to a company upgrades them from a guest job seeker to a company employee (recruiter). Once assigned, the user’s company_id foreign key is populated and they can access all recruiter-only endpoints.
POST /api/v1/admin/assign-user
uid
string (UUID)
required
The UUID of the user to be assigned to the company.
company_id
string (UUID)
required
The UUID of the company to assign the user to.
curl -X POST https://yeti-jobs.onrender.com/api/v1/admin/assign-user \
  -H 'Content-Type: application/json' \
  -H 'Cookie: token=<your_jwt_token>' \
  -d '{
    "uid": "b7e1a2f3-0000-4cde-9876-000000000099",
    "company_id": "a3f2c1d4-89ab-4e56-b123-000000000001"
  }'
The controller first checks that the user is not already assigned to a company. If they are, a 422 error is returned. On success, the full updated user record is returned.
{
  "message": {
    "uid": "b7e1a2f3-0000-4cde-9876-000000000099",
    "fname": "Alex",
    "lname": "Mercer",
    "email": "alex@example.com",
    "role": "guest",
    "company_id": "a3f2c1d4-89ab-4e56-b123-000000000001"
  }
}

Searching Users

Find users by first or last name using a case-insensitive ILIKE query. Returns a lightweight record — no passwords or sensitive fields are exposed.
GET /api/v1/admin/search/users?q=
curl "https://yeti-jobs.onrender.com/api/v1/admin/search/users?q=alice" \
  -H 'Cookie: token=<your_jwt_token>'
{
  "message": [
    {
      "fname": "Alice",
      "lname": "Johnson",
      "company_id": null,
      "experience": 2,
      "uid": "c1d2e3f4-0000-0000-0000-000000000010"
    }
  ]
}

Searching Companies

Find companies by name using a partial match. Useful for looking up a company’s uid before assigning a user or performing a deletion.
GET /api/v1/admin/search/company?q=
curl "https://yeti-jobs.onrender.com/api/v1/admin/search/company?q=yeti" \
  -H 'Cookie: token=<your_jwt_token>'
{
  "message": [
    {
      "name": "Yeti Technologies",
      "uid": "a3f2c1d4-89ab-4e56-b123-000000000001"
    }
  ]
}

Creating a Company

Register a new company on the platform. The company logo is uploaded to Supabase Storage and the returned public URL is stored in the logo_url column. The request must be sent as multipart/form-data because it includes a file upload.
POST /api/v1/companies/new
name
string
required
The company’s official name. Must be unique (checked case-insensitively).
description
string
required
A short description of what the company does.
website
string
required
The company’s public website URL.
founded_year
integer
required
The year the company was founded (stored as int2).
location
string
required
Headquarters location, e.g. "Austin, TX".
The company logo image (uploaded as a multipart file field named company_logo).
curl -X POST https://yeti-jobs.onrender.com/api/v1/companies/new \
  -H 'Cookie: token=<your_jwt_token>' \
  -F 'name=Yeti Technologies' \
  -F 'description=Building scalable developer tools for the modern web.' \
  -F 'website=https://yeti.tech' \
  -F 'founded_year=2019' \
  -F 'location=Austin, TX' \
  -F 'company_logo=@/path/to/logo.png'
On success the API responds with 201 Created and "message": "New Company Added".

Deleting a Company

Permanently delete a company and all associated records. Due to the ON DELETE RESTRICT constraints on the users.company_id foreign key, you must reassign or remove all employees from the company before deletion is permitted.
DELETE /api/v1/companies/:id
curl -X DELETE https://yeti-jobs.onrender.com/api/v1/companies/{company_uid} \
  -H 'Cookie: token=<your_jwt_token>'

Updating a Company

Update an existing company’s core details. This does not re-upload the logo; only text fields are updated.
PUT /api/v1/companies/:id
curl -X PUT https://yeti-jobs.onrender.com/api/v1/companies/{company_uid} \
  -H 'Content-Type: application/json' \
  -H 'Cookie: token=<your_jwt_token>' \
  -d '{
    "name": "Yeti Technologies Inc.",
    "description": "Next-generation developer tooling.",
    "website": "https://yeti.tech",
    "location": "San Francisco, CA",
    "founded_year": 2019
  }'
The response returns the full updated company row from the companies table.

Build docs developers (and LLMs) love