Documentation ›
Account & AI › Upload training data
POST
Upload training data
POSThttps://app.sendapp.ai/api/upload_training
Upload training data for your AI model: a file (PDF or TXT via URL), a web page to scrape, or a sitemap.
Parameters
apikey
required
Your API Key.
token
required
Account token.
media_url
optional
URL of the file to process (PDF or TXT).
url
optional
URL of the web page to scrape.
sitemap
optional
URL of the sitemap to process.
Request
curl -X POST 'https://app.sendapp.ai/api/upload_training' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"url": "https://example.com/faq"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/upload_training');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'apikey' => 'YOUR_API_KEY',
'token' => 'YOUR_ACCOUNT_TOKEN',
'url' => 'https://example.com/faq',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/upload_training', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
url: 'https://example.com/faq'
})
});
console.log(await res.json());Response (200 OK)
{
"status": "pending",
"message": "Your request has been accepted and will be processed in the background.",
"token": "trn_a1b2c3d4e5f6"
}Error
{
"status": "error",
"message": "Training is already pending or in progress."
}