Skip to main content
POST
/
v1
/
create-source
curl --location --request POST 'https://api.hirempire.com/v1/create-source' \
--header 'Authorization: Bearer sk-••••••••••••' \
--header 'Content-Type: application/json' \
--data '{
  "job_id": "8fc4ea3c-ecc4-4a92-96fd-a14436a79a1b",
  "source_name": "LinkedIn"
}'
{
  "success": true,
  "source": {
    "id": "1a2b3c4d-5e6f-7890-abcd-ef1234567890",
    "job_id": "8fc4ea3c-ecc4-4a92-96fd-a14436a79a1b",
    "source_name": "LinkedIn",
    "source_url": "https://jobs.hirempire.com/acme/1a2b3c4d-5e6f-7890-abcd-ef1234567890",
    "code": "a3f9",
    "visits": 0,
    "created_at": "2026-06-27T10:00:00.000Z"
  }
}
Create a new source link for a job. Each source produces a unique URL that can be shared on a specific platform (LinkedIn post, internal referral page, Indeed listing, etc.) — visits to that URL are tracked separately, so you can attribute applicants back to the source they came from. The endpoint is idempotent on (job_id, source_name): posting twice with the same job and source name returns the existing source link instead of erroring or creating a duplicate.

Authentication

Authorization
string
required
Bearer authentication header of the form Bearer <token>.

Request Body

job_id
string
required
The job UUID to attach the source to. The job must belong to your workspace.
source_name
string
required
Human-readable label for the source. Free-form — common values: LinkedIn, Indeed, Referral, Careers Page, Twitter. Trimmed to remove leading/trailing whitespace.
curl --location --request POST 'https://api.hirempire.com/v1/create-source' \
--header 'Authorization: Bearer sk-••••••••••••' \
--header 'Content-Type: application/json' \
--data '{
  "job_id": "8fc4ea3c-ecc4-4a92-96fd-a14436a79a1b",
  "source_name": "LinkedIn"
}'

Response

success
boolean
source
object
The created (or existing, if idempotent hit) source link.
{
  "success": true,
  "source": {
    "id": "1a2b3c4d-5e6f-7890-abcd-ef1234567890",
    "job_id": "8fc4ea3c-ecc4-4a92-96fd-a14436a79a1b",
    "source_name": "LinkedIn",
    "source_url": "https://jobs.hirempire.com/acme/1a2b3c4d-5e6f-7890-abcd-ef1234567890",
    "code": "a3f9",
    "visits": 0,
    "created_at": "2026-06-27T10:00:00.000Z"
  }
}

Error Responses

400 Bad Request

{ "success": false, "error": "job_id is required and must be a UUID" }
{ "success": false, "error": "source_name is required and must be a non-empty string" }

401 Unauthorized

{ "success": false, "error": "Invalid token" }

404 Not Found

{ "success": false, "error": "Job not found" }