Skip to main content
POST
/
api
/
user
/
url
Upload content from URL
curl --request POST \
  --url https://pria.praxislxp.com/api/user/url \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "url": "https://example.com/document.pdf",
  "confidential": false,
  "skipIndexing": false,
  "scrape": false,
  "institution": "6631915765bb0a94cfd6ca99",
  "selectedCourse": {
    "course_id": 123,
    "course_name": "<string>",
    "assistant": {
      "_id": "<string>"
    }
  },
  "selectedAssistant": "6856fa89cbafcff8d98680f5",
  "collection": "6631915765bb0a94cfd6ca99",
  "account_shared": false
}
'
import requests

url = "https://pria.praxislxp.com/api/user/url"

payload = {
"url": "https://example.com/document.pdf",
"confidential": False,
"skipIndexing": False,
"scrape": False,
"institution": "6631915765bb0a94cfd6ca99",
"selectedCourse": {
"course_id": 123,
"course_name": "<string>",
"assistant": { "_id": "<string>" }
},
"selectedAssistant": "6856fa89cbafcff8d98680f5",
"collection": "6631915765bb0a94cfd6ca99",
"account_shared": False
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/document.pdf',
confidential: false,
skipIndexing: false,
scrape: false,
institution: '6631915765bb0a94cfd6ca99',
selectedCourse: {course_id: 123, course_name: '<string>', assistant: {_id: '<string>'}},
selectedAssistant: '6856fa89cbafcff8d98680f5',
collection: '6631915765bb0a94cfd6ca99',
account_shared: false
})
};

fetch('https://pria.praxislxp.com/api/user/url', 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://pria.praxislxp.com/api/user/url",
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([
'url' => 'https://example.com/document.pdf',
'confidential' => false,
'skipIndexing' => false,
'scrape' => false,
'institution' => '6631915765bb0a94cfd6ca99',
'selectedCourse' => [
'course_id' => 123,
'course_name' => '<string>',
'assistant' => [
'_id' => '<string>'
]
],
'selectedAssistant' => '6856fa89cbafcff8d98680f5',
'collection' => '6631915765bb0a94cfd6ca99',
'account_shared' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <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://pria.praxislxp.com/api/user/url"

payload := strings.NewReader("{\n \"url\": \"https://example.com/document.pdf\",\n \"confidential\": false,\n \"skipIndexing\": false,\n \"scrape\": false,\n \"institution\": \"6631915765bb0a94cfd6ca99\",\n \"selectedCourse\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\"\n }\n },\n \"selectedAssistant\": \"6856fa89cbafcff8d98680f5\",\n \"collection\": \"6631915765bb0a94cfd6ca99\",\n \"account_shared\": false\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-access-token", "<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://pria.praxislxp.com/api/user/url")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/document.pdf\",\n \"confidential\": false,\n \"skipIndexing\": false,\n \"scrape\": false,\n \"institution\": \"6631915765bb0a94cfd6ca99\",\n \"selectedCourse\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\"\n }\n },\n \"selectedAssistant\": \"6856fa89cbafcff8d98680f5\",\n \"collection\": \"6631915765bb0a94cfd6ca99\",\n \"account_shared\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://pria.praxislxp.com/api/user/url")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/document.pdf\",\n \"confidential\": false,\n \"skipIndexing\": false,\n \"scrape\": false,\n \"institution\": \"6631915765bb0a94cfd6ca99\",\n \"selectedCourse\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\"\n }\n },\n \"selectedAssistant\": \"6856fa89cbafcff8d98680f5\",\n \"collection\": \"6631915765bb0a94cfd6ca99\",\n \"account_shared\": false\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "URL ingested successfully",
  "code": 1
}
{
"success": false,
"message": "Invalid url",
"error": "<unknown>"
}
{
"success": false,
"message": "<string>",
"error": "<string>"
}
{
"success": false,
"message": "Google authorization is required to read this document.",
"consentUrl": "https://pria.praxislxp.com/api/auth/google/services/authorize?scopes=drive,document&token=..."
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Body

application/json
url
string<uri>
required

URL to download and ingest content from

Example:

"https://example.com/document.pdf"

confidential
boolean
default:false

Whether the content is confidential. Only applied when institution is provided; ignored for personal uploads.

skipIndexing
boolean
default:false

When true, the file is stored in the vault but RAG embedding generation is skipped. The file is set to status 'active' (visible in vault) with no embeddings. Default: false.

scrape
boolean
default:false

When true, scrapes webpage content. When false, downloads the file directly.

institution
string

Institution ID to associate the upload with. Must match the user's institution for regular users.

Example:

"6631915765bb0a94cfd6ca99"

selectedCourse
object

Course context for the upload history record

selectedAssistant
string

Assistant ID for the upload history record (used as fallback if selectedCourse.assistant._id is not set)

Example:

"6856fa89cbafcff8d98680f5"

collection
string

Collection ID to associate the uploaded file with. When provided, the Upload record is linked to this collection.

Example:

"6631915765bb0a94cfd6ca99"

account_shared
boolean
default:false

When true and institution is set, marks the file as shared across the institution's account

Response

URL content ingested successfully

success
boolean
Example:

true

message
string
Example:

"URL ingested successfully"

code
integer

Status code (1 indicates success)

Example:

1