Code Examples
Ready-to-use snippets for the most common Comsalo API operations. Replace sk_live_your_api_key with your actual key from Settings → API Keys.
List job listings
This endpoint is public — no API key required. Pass your company_id as a query parameter to filter results.
curl
curl "https://recruit.comsalo.com/api/v1/jobs?company_id=your-company-id"fetch (Node.js / browser)
const res = await fetch(
'https://recruit.comsalo.com/api/v1/jobs?company_id=your-company-id'
)
const jobs = await res.json()
console.log(jobs)Python (requests)
import requests
response = requests.get(
'https://recruit.comsalo.com/api/v1/jobs',
params={'company_id': 'your-company-id'}
)
jobs = response.json()
print(jobs)Create a job listing
curl
curl -X POST https://recruit.comsalo.com/api/v1/jobs \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Senior Frontend Engineer",
"department": "Engineering",
"location": "Remote",
"work_type": "hybrid",
"status": "active",
"description": "We are looking for..."
}'fetch (Node.js)
const res = await fetch('https://recruit.comsalo.com/api/v1/jobs', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
title: 'Senior Frontend Engineer',
department: 'Engineering',
location: 'Remote',
work_type: 'hybrid',
status: 'active',
description: 'We are looking for...',
}),
})
const job = await res.json()
console.log('Created job:', job.id)Python (requests)
import requests
response = requests.post(
'https://recruit.comsalo.com/api/v1/jobs',
headers={
'Authorization': 'Bearer sk_live_your_api_key',
'Content-Type': 'application/json',
},
json={
'title': 'Senior Frontend Engineer',
'department': 'Engineering',
'location': 'Remote',
'work_type': 'full_time',
'status': 'active',
'description': 'We are looking for...',
}
)
job = response.json()
print('Created job:', job['id'])Submit a candidate from your career page
Use this from your own backend when a candidate applies on your website.
Node.js (with CV file)
import FormData from 'form-data'
import fs from 'fs'
import fetch from 'node-fetch'
const form = new FormData()
form.append('first_name', 'Jane')
form.append('last_name', 'Doe')
form.append('email', '[email protected]')
form.append('phone', '+44 7700 900000')
form.append('job_id', 'your-job-id')
form.append('company_id', 'your-company-id')
form.append('cv', fs.createReadStream('./cv.pdf'))
const res = await fetch('https://recruit.comsalo.com/api/v1/candidates', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_your_api_key',
...form.getHeaders(),
},
body: form,
})
const candidate = await res.json()
console.log('Candidate created:', candidate.id)Python (with CV file)
import requests
with open('cv.pdf', 'rb') as cv_file:
response = requests.post(
'https://recruit.comsalo.com/api/v1/candidates',
headers={'Authorization': 'Bearer sk_live_your_api_key'},
data={
'first_name': 'Jane',
'last_name': 'Doe',
'email': '[email protected]',
'phone': '+44 7700 900000',
'job_id': 'your-job-id',
'company_id': 'your-company-id',
},
files={'cv': ('cv.pdf', cv_file, 'application/pdf')}
)
candidate = response.json()
print('Candidate created:', candidate['id'])