Ingest a source PDF into the knowledge graph
curl --request POST \
--url https://core.locusmedical.fr/v1/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"doc_id": "<string>",
"source_id": "<string>",
"source_name": "<string>",
"reco_id": "<string>",
"title": "<string>",
"year": 123,
"version": "",
"url": "<string>",
"status": "current",
"pdf_base64": "<string>",
"embed": true
}
'import requests
url = "https://core.locusmedical.fr/v1/ingest"
payload = {
"doc_id": "<string>",
"source_id": "<string>",
"source_name": "<string>",
"reco_id": "<string>",
"title": "<string>",
"year": 123,
"version": "",
"url": "<string>",
"status": "current",
"pdf_base64": "<string>",
"embed": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
doc_id: '<string>',
source_id: '<string>',
source_name: '<string>',
reco_id: '<string>',
title: '<string>',
year: 123,
version: '',
url: '<string>',
status: 'current',
pdf_base64: '<string>',
embed: true
})
};
fetch('https://core.locusmedical.fr/v1/ingest', 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://core.locusmedical.fr/v1/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'doc_id' => '<string>',
'source_id' => '<string>',
'source_name' => '<string>',
'reco_id' => '<string>',
'title' => '<string>',
'year' => 123,
'version' => '',
'url' => '<string>',
'status' => 'current',
'pdf_base64' => '<string>',
'embed' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.locusmedical.fr/v1/ingest"
payload := strings.NewReader("{\n \"doc_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_name\": \"<string>\",\n \"reco_id\": \"<string>\",\n \"title\": \"<string>\",\n \"year\": 123,\n \"version\": \"\",\n \"url\": \"<string>\",\n \"status\": \"current\",\n \"pdf_base64\": \"<string>\",\n \"embed\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://core.locusmedical.fr/v1/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"doc_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_name\": \"<string>\",\n \"reco_id\": \"<string>\",\n \"title\": \"<string>\",\n \"year\": 123,\n \"version\": \"\",\n \"url\": \"<string>\",\n \"status\": \"current\",\n \"pdf_base64\": \"<string>\",\n \"embed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.locusmedical.fr/v1/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"doc_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_name\": \"<string>\",\n \"reco_id\": \"<string>\",\n \"title\": \"<string>\",\n \"year\": 123,\n \"version\": \"\",\n \"url\": \"<string>\",\n \"status\": \"current\",\n \"pdf_base64\": \"<string>\",\n \"embed\": true\n}"
response = http.request(request)
puts response.read_body{
"doc_id": "<string>",
"source_id": "<string>",
"sections": 123,
"chunks": 123,
"embedded": true,
"section_method": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}ingest
Ingest a source PDF into the knowledge graph
Parse a source PDF (sections → chunks → embeddings) and write the vector-store sub-graph (Source←Doc→Section→Chunk). Idempotent by content-derived ids. PDF resolved from the server’s PDF dir by doc_id, or provided as base64.
POST
/
v1
/
ingest
Ingest a source PDF into the knowledge graph
curl --request POST \
--url https://core.locusmedical.fr/v1/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"doc_id": "<string>",
"source_id": "<string>",
"source_name": "<string>",
"reco_id": "<string>",
"title": "<string>",
"year": 123,
"version": "",
"url": "<string>",
"status": "current",
"pdf_base64": "<string>",
"embed": true
}
'import requests
url = "https://core.locusmedical.fr/v1/ingest"
payload = {
"doc_id": "<string>",
"source_id": "<string>",
"source_name": "<string>",
"reco_id": "<string>",
"title": "<string>",
"year": 123,
"version": "",
"url": "<string>",
"status": "current",
"pdf_base64": "<string>",
"embed": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
doc_id: '<string>',
source_id: '<string>',
source_name: '<string>',
reco_id: '<string>',
title: '<string>',
year: 123,
version: '',
url: '<string>',
status: 'current',
pdf_base64: '<string>',
embed: true
})
};
fetch('https://core.locusmedical.fr/v1/ingest', 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://core.locusmedical.fr/v1/ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'doc_id' => '<string>',
'source_id' => '<string>',
'source_name' => '<string>',
'reco_id' => '<string>',
'title' => '<string>',
'year' => 123,
'version' => '',
'url' => '<string>',
'status' => 'current',
'pdf_base64' => '<string>',
'embed' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.locusmedical.fr/v1/ingest"
payload := strings.NewReader("{\n \"doc_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_name\": \"<string>\",\n \"reco_id\": \"<string>\",\n \"title\": \"<string>\",\n \"year\": 123,\n \"version\": \"\",\n \"url\": \"<string>\",\n \"status\": \"current\",\n \"pdf_base64\": \"<string>\",\n \"embed\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://core.locusmedical.fr/v1/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"doc_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_name\": \"<string>\",\n \"reco_id\": \"<string>\",\n \"title\": \"<string>\",\n \"year\": 123,\n \"version\": \"\",\n \"url\": \"<string>\",\n \"status\": \"current\",\n \"pdf_base64\": \"<string>\",\n \"embed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.locusmedical.fr/v1/ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"doc_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_name\": \"<string>\",\n \"reco_id\": \"<string>\",\n \"title\": \"<string>\",\n \"year\": 123,\n \"version\": \"\",\n \"url\": \"<string>\",\n \"status\": \"current\",\n \"pdf_base64\": \"<string>\",\n \"embed\": true\n}"
response = http.request(request)
puts response.read_body{
"doc_id": "<string>",
"source_id": "<string>",
"sections": 123,
"chunks": 123,
"embedded": true,
"section_method": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Locus API key — paste the raw lsk_… value (no 'Bearer ' prefix).
Body
application/json
Identifiant du document (clé Supabase). PDF attendu : {dir}/{doc_id}.pdf
Identifiant de la source/éditeur (ex. HAS, ebmfrance)
Nom lisible de la source
Version du document (fige les ancres de chunk)
Available options:
current, superseded PDF encodé base64 ; sinon lu depuis {ingest_pdf_dir}/{doc_id}.pdf
Calculer les embeddings des chunks à l'ingestion
⌘I