Sourcing
Create sourcing
Create an empty sourcing campaign linked to your workspace.
POST
/
v1
/
sourcings
Create sourcing
curl --request POST \
--url https://app.kalent.ai/api/v1/sourcings \
--header 'x-api-key: <api-key>'import requests
url = "https://app.kalent.ai/api/v1/sourcings"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.kalent.ai/api/v1/sourcings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.kalent.ai/api/v1/sourcings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.kalent.ai/api/v1/sourcings"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.kalent.ai/api/v1/sourcings")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kalent.ai/api/v1/sourcings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyFirst time? Set up Authentication
Learn how to authenticate your API requests with your API key.
Request body
Send an empty JSON object{}. Unknown keys return validation_error.
Response
Whensuccess is true, data contains:
sourcingId— identifier for the new sourcing (same as internal job offer id)name— generated display name
Errors
Commonerror.code values:
| Code | HTTP |
|---|---|
validation_error | 400 |
plan_upgrade_required | 402 |
not_found | 404 |
internal_error | 500 |
{
"success": false,
"error": {
"code": "plan_upgrade_required",
"message": "A Kalent subscription or plan upgrade is required to create sourcings. Please subscribe or upgrade your plan in Kalent billing: https://app.kalent.ai/settings/billing",
"debugTrackingCode": "...",
"details": {
"code": "subscription_or_plan_upgrade_required",
"action": "subscribe_or_upgrade",
"capability": "create_sourcings",
"billingUrl": "https://app.kalent.ai/settings/billing"
}
}
}
curl -X POST https://app.kalent.ai/api/v1/sourcings \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{}'
⌘I
Create sourcing
curl --request POST \
--url https://app.kalent.ai/api/v1/sourcings \
--header 'x-api-key: <api-key>'import requests
url = "https://app.kalent.ai/api/v1/sourcings"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.kalent.ai/api/v1/sourcings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.kalent.ai/api/v1/sourcings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.kalent.ai/api/v1/sourcings"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.kalent.ai/api/v1/sourcings")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kalent.ai/api/v1/sourcings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body
