Upload files to existing collection
curl --request POST \
--url https://prod.truv.com/v1/documents/collections/{collection_id}/upload/ \
--header 'Content-Type: application/json' \
--header 'X-Access-Client-Id: <api-key>' \
--header 'X-Access-Secret: <api-key>' \
--data '
{
"documents": [
{
"filename": "paystub.pdf",
"mime_type": "application/pdf",
"content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...",
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
]
}
'import requests
url = "https://prod.truv.com/v1/documents/collections/{collection_id}/upload/"
payload = { "documents": [
{
"filename": "paystub.pdf",
"mime_type": "application/pdf",
"content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...",
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
] }
headers = {
"X-Access-Client-Id": "<api-key>",
"X-Access-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Client-Id': '<api-key>',
'X-Access-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
documents: [
{
filename: 'paystub.pdf',
mime_type: 'application/pdf',
content: 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...',
user_id: 'a1b2c3d4e5f6478899aabbccddeeff00',
external_user_id: 'ext_user_789'
}
]
})
};
fetch('https://prod.truv.com/v1/documents/collections/{collection_id}/upload/', 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://prod.truv.com/v1/documents/collections/{collection_id}/upload/",
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([
'documents' => [
[
'filename' => 'paystub.pdf',
'mime_type' => 'application/pdf',
'content' => 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...',
'user_id' => 'a1b2c3d4e5f6478899aabbccddeeff00',
'external_user_id' => 'ext_user_789'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Client-Id: <api-key>",
"X-Access-Secret: <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://prod.truv.com/v1/documents/collections/{collection_id}/upload/"
payload := strings.NewReader("{\n \"documents\": [\n {\n \"filename\": \"paystub.pdf\",\n \"mime_type\": \"application/pdf\",\n \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...\",\n \"user_id\": \"a1b2c3d4e5f6478899aabbccddeeff00\",\n \"external_user_id\": \"ext_user_789\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Client-Id", "<api-key>")
req.Header.Add("X-Access-Secret", "<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://prod.truv.com/v1/documents/collections/{collection_id}/upload/")
.header("X-Access-Client-Id", "<api-key>")
.header("X-Access-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"documents\": [\n {\n \"filename\": \"paystub.pdf\",\n \"mime_type\": \"application/pdf\",\n \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...\",\n \"user_id\": \"a1b2c3d4e5f6478899aabbccddeeff00\",\n \"external_user_id\": \"ext_user_789\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.truv.com/v1/documents/collections/{collection_id}/upload/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Client-Id"] = '<api-key>'
request["X-Access-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"documents\": [\n {\n \"filename\": \"paystub.pdf\",\n \"mime_type\": \"application/pdf\",\n \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...\",\n \"user_id\": \"a1b2c3d4e5f6478899aabbccddeeff00\",\n \"external_user_id\": \"ext_user_789\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"collection_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"uploaded_files": [
{
"file_id": "f1234567890abcdef1234567890abcde",
"filename": "paystub.pdf",
"mime_type": "application/pdf",
"status": "validated",
"validations": {
"is_viable_size": true,
"is_supported_type": true,
"is_accessible": true,
"is_valid": true,
"is_readable": true,
"is_unique": true
},
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
],
"documents": [
{
"document_id": "d0c1234567890abcdef1234567890abc",
"file_id": "f1234567890abcdef1234567890abcde",
"document_type": "PAYSTUB",
"status": "successful",
"start_page": 1,
"end_page": 2,
"document_subtype": null,
"first_name": "John",
"last_name": "Doe",
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
],
"users": [
{
"id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789",
"first_name": "John",
"last_name": "Doe"
}
]
}{
"error": {
"code": "incorrect_parameters",
"message": "Incorrect request parameters",
"extra": {
"invalid-params": [
{
"field": "access_token",
"message": "This field is required."
}
]
}
}
}{
"error": {
"code": "authentication_failed",
"message": "No such token"
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication credentials were not provided."
}
}{
"detail": "Not Found."
}Document Collections
Upload files to existing collection
The endpoint uploads additional files to an existing collection. Documents are provided as base64-encoded content in JSON format. Each uploaded file is automatically validated and queued for AI-powered categorization.
POST
/
v1
/
documents
/
collections
/
{collection_id}
/
upload
/
Upload files to existing collection
curl --request POST \
--url https://prod.truv.com/v1/documents/collections/{collection_id}/upload/ \
--header 'Content-Type: application/json' \
--header 'X-Access-Client-Id: <api-key>' \
--header 'X-Access-Secret: <api-key>' \
--data '
{
"documents": [
{
"filename": "paystub.pdf",
"mime_type": "application/pdf",
"content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...",
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
]
}
'import requests
url = "https://prod.truv.com/v1/documents/collections/{collection_id}/upload/"
payload = { "documents": [
{
"filename": "paystub.pdf",
"mime_type": "application/pdf",
"content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...",
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
] }
headers = {
"X-Access-Client-Id": "<api-key>",
"X-Access-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Client-Id': '<api-key>',
'X-Access-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
documents: [
{
filename: 'paystub.pdf',
mime_type: 'application/pdf',
content: 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...',
user_id: 'a1b2c3d4e5f6478899aabbccddeeff00',
external_user_id: 'ext_user_789'
}
]
})
};
fetch('https://prod.truv.com/v1/documents/collections/{collection_id}/upload/', 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://prod.truv.com/v1/documents/collections/{collection_id}/upload/",
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([
'documents' => [
[
'filename' => 'paystub.pdf',
'mime_type' => 'application/pdf',
'content' => 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...',
'user_id' => 'a1b2c3d4e5f6478899aabbccddeeff00',
'external_user_id' => 'ext_user_789'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Client-Id: <api-key>",
"X-Access-Secret: <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://prod.truv.com/v1/documents/collections/{collection_id}/upload/"
payload := strings.NewReader("{\n \"documents\": [\n {\n \"filename\": \"paystub.pdf\",\n \"mime_type\": \"application/pdf\",\n \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...\",\n \"user_id\": \"a1b2c3d4e5f6478899aabbccddeeff00\",\n \"external_user_id\": \"ext_user_789\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Client-Id", "<api-key>")
req.Header.Add("X-Access-Secret", "<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://prod.truv.com/v1/documents/collections/{collection_id}/upload/")
.header("X-Access-Client-Id", "<api-key>")
.header("X-Access-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"documents\": [\n {\n \"filename\": \"paystub.pdf\",\n \"mime_type\": \"application/pdf\",\n \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...\",\n \"user_id\": \"a1b2c3d4e5f6478899aabbccddeeff00\",\n \"external_user_id\": \"ext_user_789\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.truv.com/v1/documents/collections/{collection_id}/upload/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Client-Id"] = '<api-key>'
request["X-Access-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"documents\": [\n {\n \"filename\": \"paystub.pdf\",\n \"mime_type\": \"application/pdf\",\n \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...\",\n \"user_id\": \"a1b2c3d4e5f6478899aabbccddeeff00\",\n \"external_user_id\": \"ext_user_789\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"collection_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"uploaded_files": [
{
"file_id": "f1234567890abcdef1234567890abcde",
"filename": "paystub.pdf",
"mime_type": "application/pdf",
"status": "validated",
"validations": {
"is_viable_size": true,
"is_supported_type": true,
"is_accessible": true,
"is_valid": true,
"is_readable": true,
"is_unique": true
},
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
],
"documents": [
{
"document_id": "d0c1234567890abcdef1234567890abc",
"file_id": "f1234567890abcdef1234567890abcde",
"document_type": "PAYSTUB",
"status": "successful",
"start_page": 1,
"end_page": 2,
"document_subtype": null,
"first_name": "John",
"last_name": "Doe",
"user_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789"
}
],
"users": [
{
"id": "a1b2c3d4e5f6478899aabbccddeeff00",
"external_user_id": "ext_user_789",
"first_name": "John",
"last_name": "Doe"
}
]
}{
"error": {
"code": "incorrect_parameters",
"message": "Incorrect request parameters",
"extra": {
"invalid-params": [
{
"field": "access_token",
"message": "This field is required."
}
]
}
}
}{
"error": {
"code": "authentication_failed",
"message": "No such token"
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication credentials were not provided."
}
}{
"detail": "Not Found."
}Authorizations
Client ID
Client Access Key
Path Parameters
Collection ID
Body
application/json
Required array length:
1 - 10 elementsShow child attributes
Show child attributes
Was this page helpful?
⌘I