API Reference
Jobs API
Convex functions for job listings
Jobs API
Functions for managing job listings.
Queries
listApprovedJobs
Get all approved job listings.
const jobs = useQuery(api.jobs.listApprovedJobs, {
searchTerm: "frontend",
roleLevel: "intern",
location: "Remote",
});Returns: Array of approved jobs, sorted by creation date (newest first).
Parameters:
searchTerm- Optional text search over title/company/locationroleLevel- Optional role level (intern,graduate,earlyCareer)location- Optional exact location filter
getApprovedJobFilterOptions
Get available location filter values from approved jobs.
const options = useQuery(api.jobs.getApprovedJobFilterOptions);Returns: { locations: string[] }
Mutations
postJob
Submit a new job for review.
const postJob = useMutation(api.jobs.postJob);
await postJob({
title: "Junior Developer",
company: "Acme Inc",
roleLevel: "earlyCareer",
location: "Remote",
url: "https://...",
tags: ["React", "TypeScript"],
});Authentication: Required
Parameters:
| Field | Type | Required |
|---|---|---|
| title | string | Yes |
| company | string | Yes |
| roleLevel | "intern" | "graduate" | "earlyCareer" | Yes |
| location | string | Yes |
| url | string | Yes |
| tags | string[] | No |
Returns: Object with success, jobId, and message.
Internal Functions
deleteOldJobs
Cron job that cleans up old listings:
- Pending/rejected jobs older than 2 weeks: deleted
- Approved jobs older than 2 weeks: marked as "outdated"
- Outdated jobs older than 30 days: deleted
backfillJobRoleLevelsFromTitle
Backfills missing roleLevel values from job title keywords.