Beneficiaries
Upload a document
Start uploading a document a beneficiary in review waits for (listed in its
requiredActions). Returns a presigned upload: POST the file to upload.url
as multipart/form-data, with every field of upload.fields first and the
file as a file part last. The upload must use the declared contentType,
stay under 20 MB, and happen before expiresAt. Then call
POST /v1/beneficiaries/{beneficiaryId}/documents/{documentId}/complete.
Up to 5 documents.
POST
/
v1
/
beneficiaries
/
{beneficiaryId}
/
documents
cURL
curl --request POST \
--url https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "<string>",
"size": 10485760
}
'import requests
url = "https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents"
payload = {
"fileName": "<string>",
"size": 10485760
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: '<string>', size: 10485760})
};
fetch('https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents', 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.nxos.io/v1/beneficiaries/{beneficiaryId}/documents",
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([
'fileName' => '<string>',
'size' => 10485760
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents"
payload := strings.NewReader("{\n \"fileName\": \"<string>\",\n \"size\": 10485760\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.nxos.io/v1/beneficiaries/{beneficiaryId}/documents")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"<string>\",\n \"size\": 10485760\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"<string>\",\n \"size\": 10485760\n}"
response = http.request(request)
puts response.read_body{
"object": "document_upload",
"documentId": "doc_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"type": "invoice",
"upload": {
"url": "https://nxos-hold-documents.s3.amazonaws.com/",
"fields": {
"key": "holds/hold_a1b2…/doc_a1b2…",
"Content-Type": "application/pdf",
"Policy": "eyJ…",
"X-Amz-Signature": "…"
}
},
"expiresAt": "2026-10-21T10:10:00.000Z"
}Headers
Body
application/json
A document to upload for a beneficiary in review.
Response
The request has succeeded and a new resource has been created as a result.
A presigned upload: POST the file straight to storage, then complete it.
⌘I
cURL
curl --request POST \
--url https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "<string>",
"size": 10485760
}
'import requests
url = "https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents"
payload = {
"fileName": "<string>",
"size": 10485760
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: '<string>', size: 10485760})
};
fetch('https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents', 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.nxos.io/v1/beneficiaries/{beneficiaryId}/documents",
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([
'fileName' => '<string>',
'size' => 10485760
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents"
payload := strings.NewReader("{\n \"fileName\": \"<string>\",\n \"size\": 10485760\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.nxos.io/v1/beneficiaries/{beneficiaryId}/documents")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"<string>\",\n \"size\": 10485760\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/beneficiaries/{beneficiaryId}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileName\": \"<string>\",\n \"size\": 10485760\n}"
response = http.request(request)
puts response.read_body{
"object": "document_upload",
"documentId": "doc_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"type": "invoice",
"upload": {
"url": "https://nxos-hold-documents.s3.amazonaws.com/",
"fields": {
"key": "holds/hold_a1b2…/doc_a1b2…",
"Content-Type": "application/pdf",
"Policy": "eyJ…",
"X-Amz-Signature": "…"
}
},
"expiresAt": "2026-10-21T10:10:00.000Z"
}