Trips
Change trip document type
Change the document type of a file already attached to a trip, for example filing a driver upload that arrived as Unclassified.
PATCH
/
api
/
p
/
v
{version}
/
trips
/
{tripId}
/
documents
/
{documentId}
Change trip document type
curl --request PATCH \
--url https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}Change the type Alvys files a trip document under. This is the endpoint to use when a driver uploads paperwork that arrives without a real type (it lands as
Unclassified) and something downstream — a person or a workflow that classifies the file — needs to write the right type back.
The document keeps its id, its file and its download link. Only the type changes, and the change is recorded in the trip’s document history.
Request Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| version | path | String | Yes | API version to use. |
| tripId | path | String | Yes | Unique identifier of the trip. |
| documentId | path | String | Yes | id of the document, as returned by List trip 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
- Proof of Delivery
- Bill of Lading
- Carrier Rate Confirmation
- Load Manifest
- Trip Report
- Temp. Log
- Proof of Pickup
- Scale Ticket
- Notice of Assignment
- NOA
- Shipping Labels
- Receipt
400. The list is the same one Upload trip document accepts, so you cannot reach a type by changing a document that you could not have uploaded in the first place.
Driver photo types such as Seal, Trailer Photo, Load Securement and Temperature Settings are not on the list, so a document cannot be filed under those through the API.
Documents that cannot be changed
A Carrier Invoice is refused with422. The carrier invoice number and payment terms are held on the document itself, and changing its type would discard them.
Trips that share a load
A load can have several trips, and List trip documents can return a document that belongs to one of the sibling trips. Changing one of those returns409, naming the trip that owns it — re-send the request against that trip.
A document on another load returns 404.
Example cURL Request
curl --location --request PATCH 'https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/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": "8c1fbd2f-f37c-4701-bb20-3582d853e536",
"AttachmentPath": "scan-1759237626.pdf",
"AttachmentType": "Proof of Delivery",
"AttachmentSize": 342115,
"UploadedAt": "2025-09-30T14:02:07+00:00",
"ParentId": "3022258",
"ParentType": "Trip",
"UploadedBy": "7190175eecc1101e11d1111f1e1e0e11"
}
Errors
| Status | Meaning |
|---|---|
400 | DocumentType is missing, unrecognised, or not allowed on a trip. |
404 | The trip or the document does not exist, is deleted, or the document belongs to another load. |
409 | The document belongs to a sibling trip on the same load. The response names that trip. |
422 | The document is a Carrier Invoice 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, tripId 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., 1.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 trip document type
curl --request PATCH \
--url https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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}/trips/{tripId}/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>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}