The Companies API covers everything an employer needs to manage their presence on LWS Job Portal. Private endpoints (protected byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/iDevRanjan/lws-ra-b4-assignment-five/llms.txt
Use this file to discover all available pages before exploring further.
COMPANY role auth) let a company read and update its own profile, upload a logo, paginate through posted jobs with status and search filters, browse all applicants across every listing, and retrieve real-time dashboard statistics. Two fully public endpoints serve the candidate-facing experience: a slug-based company profile lookup that includes active job listings, and a separate endpoint that streams only open positions for a given company slug.
A company’s
slug is auto-generated from its name at registration and is used as the canonical URL identifier on public-facing routes. If the generated slug is already taken, a numeric suffix is appended (e.g. acme-corp-2).Company Object
Unique company identifier.
Company display name.
URL-safe unique slug (e.g.
acme-corp).Primary account email.
Always
COMPANY.Industry sector (e.g.
"Engineering", "Finance").Company overview or about section.
General location string (for backwards compatibility).
City.
State or province.
Country.
Contact phone number.
Company website URL.
HR-specific contact email.
General information email.
Server-relative path to the company logo (e.g.
/uploads/logos/acme.png).Headcount range (e.g.
"50-200").Year the company was founded.
JSON object with social media URLs (e.g.
{ "linkedin": "...", "twitter": "...", "facebook": "..." }).Account creation timestamp.
Last-updated timestamp.
Endpoints
GET /api/companies/profile
Fetch the full profile of the currently authenticated company. Thepassword field is excluded.
Auth: Required — Bearer token (COMPANY role)
Request
No parameters. Company identity is resolved from the JWT.Response
true on success.Full Company object (password excluded).
Example
PUT /api/companies/profile
Update the authenticated company’s profile. Only fields included in the request body are changed; omitted fields retain their current values. Auth: Required — Bearer token (COMPANY role)
Request
Updated company name.
Industry sector.
Company overview.
General location string.
City.
State or province.
Country.
Contact phone number.
Company website URL.
Headcount range (e.g.
"50-200").Year founded.
HR contact email.
General information email.
JSON object with social URLs, e.g.
{ "linkedin": "...", "twitter": "..." }.Manually set logo URL (prefer the
/logo upload endpoint instead).Response
true on successful update.Updated Company object (password excluded).
Example
POST /api/companies/logo
Upload a company logo image. Usesmultipart/form-data with the file under the field name logo. The image is stored under /uploads/logos/. If the company already has a logo, the old file is deleted from disk before the new one is saved.
Auth: Required — Bearer token (COMPANY role)
Request
The logo image file (JPEG, PNG, etc.). Use
Content-Type: multipart/form-data.Response
true on successful upload."Logo uploaded successfully"Updated Company object (password excluded), including the new
logoUrl.Example
GET /api/companies/jobs
Retrieve a paginated list of jobs posted by the authenticated company. Supports filtering by status, title search, and sort order. Auth: Required — Bearer token (COMPANY role)
Request
Page number.
Results per page.
Case-insensitive title search. Example:
search=react.Filter by job lifecycle status. Must be exactly
Active, Closed, or Archived. Omit to return all statuses. Sending an invalid value returns 400.Sort order —
newest (default, createdAt DESC) or oldest (createdAt ASC).Response
true on success.Total matching jobs (for pagination).
Total pages.
Current page number.
Array of job objects, each with an
applicants count.Example
GET /api/companies/applicants
Retrieve a paginated list of all applicants across every job posted by the authenticated company. Supports filtering by application status, applicant experience level, applicant name search, and applied date range. Auth: Required — Bearer token (COMPANY role)
Request
Page number.
Results per page.
Comma-separated application statuses (case-insensitive). Mapped to:
New, Shortlisted, Interviewed, Rejected, Hired. Example: status=shortlisted,interviewed.Comma-separated experience levels (case-insensitive). Mapped to:
Entry, Mid, Senior, Expert, Lead.Filter by applicant name (partial match).
Applied-date window. Accepted values:
last 7 dayslast 30 days3 months
newest (default) or oldest — sorts by application createdAt.Response
true on success.Total matching applications.
Total pages.
Current page.
Array of Application objects, each with a nested
user object (id, name, email, experienceLevel, profilePictureUrl) and a nested job object (id, title, slug).Example
GET /api/companies/dashboard/stats
Return aggregate statistics for the authenticated company’s recruiting activity. Counts are computed in real time from the database. Auth: Required — Bearer token (COMPANY role)
Request
No parameters.Response
true on success.Example
GET /api/companies/:slug
Fetch a public company profile by slug. Returns the full Company object (password excluded) together with an embedded array of active job listings — each with anapplicants count.
Auth: None
Request
The company’s URL slug (e.g.
acme-corp).Response
true when the company is found.Company object (password excluded) with a nested
jobs array containing only Active listings. Each job includes a nested company object and an applicants count.Example
GET /api/companies/:slug/jobs
Return only the active open positions for a company, identified by slug. Unlike the embeddedjobs array on /api/companies/:slug, this endpoint streams a standalone list and is optimised for paginated job boards.
Auth: None
Request
The company’s URL slug.
Response
true on success.Number of active positions returned.
Array of active job objects, each with a nested
company object (name, logoUrl, location, slug) and an applicants count. Sorted by createdAt DESC.Example
Error Reference
| Status | Message | Cause |
|---|---|---|
400 | Please upload a file | Logo upload request sent without a file |
400 | Invalid status. Allowed: Active, … | status query param does not match the enum |
400 | Invalid sort parameter. Allowed: … | sort value not newest or oldest |
401 | Not authorized, no token | Missing Authorization header on protected route |
403 | User role USER is not authorized… | USER token used on a COMPANY-only route |
404 | Company not found | No company matches the given slug or UUID |