Loads
Change load document type
Change the document type of a file already attached to a load, for example after classifying an upload that arrived without the right type.
PATCH
/
api
/
p
/
v
{version}
/
loads
/
{loadNumber}
/
documents
/
{documentId}
Change load document type
curl --request PATCH \
--url https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"DocumentType": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({DocumentType: '<string>'})
};
fetch('https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}"
payload = { "DocumentType": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'DocumentType' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}"
payload := strings.NewReader("{\n \"DocumentType\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"DocumentType\": \"<string>\"\n}")
.asString();{
"id": "<string>",
"AttachmentPath": "<string>",
"AttachmentType": "<string>",
"ParentId": "<string>",
"ParentType": "<string>",
"AttachmentSize": 123,
"UploadedAt": "2023-11-07T05:31:56Z",
"UploadedBy": "<string>",
"DownloadUrl": "<string>",
"ExpiresAt": "2023-11-07T05:31:56Z"
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}Change the type Alvys files a load document under. Use it when a document was uploaded with the wrong type, or when a workflow classifies a file after it was attached and needs to write that classification back.
The document keeps its id, its file and its download link. Only the type changes, and the change is recorded in the load’s document history.
Sending a trip document here returns
Which documents belong here
Only the load’s own documents. List load documents also returns the documents of the load’s trips, so checkParentType on the row first:
ParentType | Where to change it |
|---|---|
Load | This endpoint, using the load number. |
Trip | Change trip document type, using that row’s ParentId. |
404.
Request Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| version | path | String | Yes | API version to use. |
| loadNumber | path | String | Yes | Unique load number. |
| documentId | path | String | Yes | id of the document, as returned by List load documents. |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| DocumentType | string | Yes | The type to set. Must be one of the allowed types below. Matched without case sensitivity and stored in Alvys’ own casing. |
Allowed document types
- Customer Rate and Load Confirmation
- Customer Load Confirmation
- Customer Rate Confirmation
- Signed Customer Rate Confirmation
- Proof of Delivery
- Proof of Pickup
- Bill of Lading
- Shipping Labels
400. The list is the same one Upload load document accepts, so you cannot reach a type by changing a document that you could not have uploaded in the first place.
Documents that cannot be changed
Invoice documents are refused with422. Alvys billing, factoring and settlement look these up by their type, so changing one would quietly detach it from the invoice it belongs to, and the type cannot be set back through this API.
This covers Invoice, Customer Invoice, Supplemental Invoice, Summary Invoice, Summary Excel, Merged, Merged Invoice and Carrier Invoice.
Example cURL Request
curl --location --request PATCH 'https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"DocumentType": "Proof of Delivery"
}'
Example Response (200 OK)
The updated document.{
"id": "c2e418d5-3125-4b14-b6b0-dcf77b0c2a93",
"AttachmentPath": "scan-1759237626.pdf",
"AttachmentType": "Proof of Delivery",
"AttachmentSize": 342115,
"UploadedAt": "2025-09-30T14:02:07+00:00",
"ParentId": "3022258",
"ParentType": "Load",
"UploadedBy": "7190175eecc1101e11d1111f1e1e0e11"
}
Errors
| Status | Meaning |
|---|---|
400 | DocumentType is missing, unrecognised, or not allowed on a load. |
404 | The load or the document does not exist, is deleted, or the document belongs to a trip or another load. |
422 | The document is an invoice type and cannot be changed. |
Repeat calls
Calling this endpoint again is not free. Each call re-runs the change, and setting a document to Proof of Delivery sends it to the customer’s visibility integration every time. Call it once per classification, and only when the type is actually changing.Rate Limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information, see the Rate Limits section.Try It Out
This page is interactive, allowing you to try a request by specifying the API version, loadNumber and documentId in the URL path. ⚠️ Don’t forget: make sure to authorize yourself before trying a request.Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Path Parameters
API version (e.g., 2.0)
Example:
"1.0"
Body
application/jsontext/jsonapplication/*+jsonapplication/json-patch+json
The document type to set. Must be one the endpoint's parent accepts, spelled exactly as listed in the endpoint description. Matched without case sensitivity and stored in Alvys' own casing.
Minimum string length:
1⌘I
Change load document type
curl --request PATCH \
--url https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"DocumentType": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({DocumentType: '<string>'})
};
fetch('https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}"
payload = { "DocumentType": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'DocumentType' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}"
payload := strings.NewReader("{\n \"DocumentType\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/documents/{documentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"DocumentType\": \"<string>\"\n}")
.asString();{
"id": "<string>",
"AttachmentPath": "<string>",
"AttachmentType": "<string>",
"ParentId": "<string>",
"ParentType": "<string>",
"AttachmentSize": 123,
"UploadedAt": "2023-11-07T05:31:56Z",
"UploadedBy": "<string>",
"DownloadUrl": "<string>",
"ExpiresAt": "2023-11-07T05:31:56Z"
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}