curl --request POST \
--url https://api.eu.linqalpha.com/v1/sources \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"source_batch_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Q4_Revenue_Report.pdf",
"file_key": "uploaded_sources/2024/q4/revenue_report.pdf"
}
'import requests
url = "https://api.eu.linqalpha.com/v1/sources"
payload = {
"source_batch_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Q4_Revenue_Report.pdf",
"file_key": "uploaded_sources/2024/q4/revenue_report.pdf"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_batch_id: '123e4567-e89b-12d3-a456-426614174000',
name: 'Q4_Revenue_Report.pdf',
file_key: 'uploaded_sources/2024/q4/revenue_report.pdf'
})
};
fetch('https://api.eu.linqalpha.com/v1/sources', 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://api.eu.linqalpha.com/v1/sources",
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([
'source_batch_id' => '123e4567-e89b-12d3-a456-426614174000',
'name' => 'Q4_Revenue_Report.pdf',
'file_key' => 'uploaded_sources/2024/q4/revenue_report.pdf'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.linqalpha.com/v1/sources"
payload := strings.NewReader("{\n \"source_batch_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Q4_Revenue_Report.pdf\",\n \"file_key\": \"uploaded_sources/2024/q4/revenue_report.pdf\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.eu.linqalpha.com/v1/sources")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_batch_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Q4_Revenue_Report.pdf\",\n \"file_key\": \"uploaded_sources/2024/q4/revenue_report.pdf\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.linqalpha.com/v1/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_batch_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Q4_Revenue_Report.pdf\",\n \"file_key\": \"uploaded_sources/2024/q4/revenue_report.pdf\"\n}"
response = http.request(request)
puts response.read_body{
"source_id": "456e7890-e89b-12d3-a456-426614174001",
"size": 2048576,
"status": "processing"
}Create Source
Legacy in the EU region. This endpoint is kept for backward compatibility and is not recommended for new EU integrations. Use Vault — Confirm Upload (POST /v2/vault/confirm) instead.
Registers a previously-uploaded file as a document source under a source batch and queues it for asynchronous parsing. Once status: "success", the source is searchable in chat/search conversations that reference its source_batch_id.
Important Notes:
- Prerequisite: A source batch must be created first using
POST /v1/source_batches - The file must already be in S3 before calling this endpoint. Two ways to get it there:
- Recommended: call
POST /v1/sources/upload_urlto obtain a presigned PUT URL, upload the file directly via that URL, then pass the returnedfile_keyhere. No client-side AWS setup required. - Alternative: if you already have your own S3 staging bucket integrated with us, upload there and pass the resulting
file_key.
- Recommended: call
- Processing: Sources are queued for asynchronous processing. Use
GET /v1/sources/{source_id}to poll the processing status before using in conversations. - File Requirements:
- Supported formats: PDF, DOCX, XLSX, DOC, TXT, PPTX
- Maximum size: 20MB per file
- Maximum files per batch: 10 files
- Usage in Conversations:
- Reference sources via
source_batch_idin chat/search API requests - All sources in a batch are accessible when the batch is referenced
- Sources remain available for reuse within conversations that reference their batch
- Reference sources via
Workflow (presigned-URL path):
POST /v1/source_batches→source_batch_idPOST /v1/sources/upload_url→upload_url,file_key,content_type- PUT the file body to
upload_urlwith headerContent-Type: <content_type> POST /v1/sources(this endpoint) withfile_keyfrom step 2- Poll
GET /v1/sources/{source_id}untilstatus: "success" - Reference
source_batch_idin chat/search requests
curl --request POST \
--url https://api.eu.linqalpha.com/v1/sources \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"source_batch_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Q4_Revenue_Report.pdf",
"file_key": "uploaded_sources/2024/q4/revenue_report.pdf"
}
'import requests
url = "https://api.eu.linqalpha.com/v1/sources"
payload = {
"source_batch_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Q4_Revenue_Report.pdf",
"file_key": "uploaded_sources/2024/q4/revenue_report.pdf"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_batch_id: '123e4567-e89b-12d3-a456-426614174000',
name: 'Q4_Revenue_Report.pdf',
file_key: 'uploaded_sources/2024/q4/revenue_report.pdf'
})
};
fetch('https://api.eu.linqalpha.com/v1/sources', 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://api.eu.linqalpha.com/v1/sources",
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([
'source_batch_id' => '123e4567-e89b-12d3-a456-426614174000',
'name' => 'Q4_Revenue_Report.pdf',
'file_key' => 'uploaded_sources/2024/q4/revenue_report.pdf'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.linqalpha.com/v1/sources"
payload := strings.NewReader("{\n \"source_batch_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Q4_Revenue_Report.pdf\",\n \"file_key\": \"uploaded_sources/2024/q4/revenue_report.pdf\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.eu.linqalpha.com/v1/sources")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_batch_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Q4_Revenue_Report.pdf\",\n \"file_key\": \"uploaded_sources/2024/q4/revenue_report.pdf\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.linqalpha.com/v1/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_batch_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Q4_Revenue_Report.pdf\",\n \"file_key\": \"uploaded_sources/2024/q4/revenue_report.pdf\"\n}"
response = http.request(request)
puts response.read_body{
"source_id": "456e7890-e89b-12d3-a456-426614174001",
"size": 2048576,
"status": "processing"
}Authorizations
Body
ID of the source batch to add this source to. The batch must be created first via POST /v1/source_batches.
"123e4567-e89b-12d3-a456-426614174000"
Display name for the source, typically the original filename. Must not include a file extension.
"Q4_Revenue_Report"
S3 object key path where the file is stored. The file must be accessible to the API service and meet format/size requirements (PDF, DOCX, XLSX, DOC, TXT, PPTX; max 20MB).
"uploaded_sources/2024/q4/revenue_report.pdf"
User ID
"123e4567-e89b-12d3-a456-426614174000"
Organization ID
"123e4567-e89b-12d3-a456-426614174000"
User email
"john.doe@example.com"
User name
"John Doe"
Response
Source created and queued for processing
Unique identifier for the created source. Use this ID to poll processing status via GET /v1/sources/{source_id}.
"456e7890-e89b-12d3-a456-426614174001"
File size in bytes
x >= 02048576
Initial processing status (typically 'processing' when first created)
processing, success, failed "processing"