Jobhuntr Agent API — Documentation
This folder contains the documentation for the Jobhuntr Agent API: how external agents (automations, scripts, third-party systems) and users interact with the service gateway for agent tokens and agent-only endpoints.
Full API list
| Method | Path | Auth | Definition |
|---|---|---|---|
| Token management (user JWT only) | |||
| GET | /api/agent-tokens/me | User JWT | Check if the current user has an active agent token; returns token prefix only. |
| POST | /api/agent-tokens/me | User JWT | Generate or rotate the agent API token; returns full token once (store it). |
| POST | /api/agent-tokens/me/get-or-create | User JWT | Return existing token prefix or create a new token; idempotent. |
| DELETE | /api/agent-tokens/me | User JWT | Revoke the current user's agent token. |
| Agent job descriptions (agent token only) | |||
| GET | /api/agent/job-descriptions/ | Agent token | List job metadata from the last 24 hours (no full description text); supports filters and pagination. |
| POST | /api/agent/job-descriptions/ | Agent token | Submit or update a job posting by URL (upsert); returns metadata only. |
| POST | /api/agent/job-descriptions/{job_description_id}/misalignment-report | Agent token | Report that stored content does not match the job URL (data quality). |
Detailed docs (request/response fields, examples, errors): api/
Guidelines for agents: search, read, and submit jobs
Authentication
- Use an agent token (
sk_agt_...) for all job-description endpoints. Send it as:Authorization: Bearer sk_agt_<your_token>. - Do not use a user JWT on
/api/agent/paths — the server returns403.
How to search / read jobs
- Call GET
/api/agent/job-descriptions/with your agent token. - Optionally add query parameters:
page,page_size(max 100),company_name,job_title,location,job_type,remote_type(onsite|remote|hybrid),senior_level(junior|mid|senior). - Response is paginated:
data,total_count,page,page_size. Each item indatais metadata only;pos_context(full job text) is never returned.
How to submit new jobs
- Call POST
/api/agent/job-descriptions/with your agent token and JSON body. - Required body fields:
url,job_title,company_name,location,pos_context. - Optional:
linkedin_job_id,post_time,hiring_team,num_applicants,salary_range,job_type,remote_type,senior_level,eoy,provide_visa_sponsorship. - Same URL upserts; response is metadata only (
pos_contextnever returned).
How to report bad or mismatched data
- Call POST
/api/agent/job-descriptions/{job_description_id}/misalignment-reportwith optional body{"reason": "..."}when stored content does not match the URL.
Typical agent workflow
-
Obtain token (once, via app or user-authenticated client):
POST /api/agent-tokens/me/get-or-createwith user JWT → storetokenwhenis_newis true. -
Submit jobs:
POST /api/agent/job-descriptions/with agent token and required fields. Store returnedidif needed. -
List recent jobs:
GET /api/agent/job-descriptions/with agent token and optional filters to poll or sync. -
Report bad data:
POST /api/agent/job-descriptions/{id}/misalignment-reportwith optionalreasonwhen content does not match the URL.
Documentation index
| Document | Description |
|---|---|
| api/README.md | Index of all API detail pages. |
| api/authentication-and-scope.md | Authentication (user JWT vs agent token), scope, rate limits, error format. |
| api/token-management.md | Token management endpoints: request/response fields, examples, errors. |
| api/job-descriptions.md | Job descriptions endpoints: list, submit, misalignment report; full field reference. |
| api/developers.md | Adding new agent endpoints (for developers). |