Trailers
Upload trailer document
Upload multipart/form-data. One file per request. Max file size 10 MB. Allowed document types: Motor Vehicle Record, Vehicle Image, Inspection Certificate, Certificate of Insurance (COI), Insurance Certificate, Other Documents. Allowed MIME types: application/pdf, image/jpeg, image/png.
POST
/
api
/
p
/
v
{version}
/
trailers
/
{trailerId}
/
document
Upload trailer document
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form File=@example-file \
--form 'DocumentType=<string>' \
--form 'FileName=<string>'const form = new FormData();
form.append('File', '<string>');
form.append('DocumentType', '<string>');
form.append('FileName', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document', 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}/trailers/{trailerId}/document"
files = { "File": ("example-file", open("example-file", "rb")) }
payload = {
"DocumentType": "<string>",
"FileName": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"DocumentType\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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}/trailers/{trailerId}/document"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"DocumentType\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"DocumentType\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.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>"
}Upload multipart/form-data. One file per request. Max file size 10 MB.
Allowed document types: Motor Vehicle Record, Vehicle Image, Inspection Certificate, Certificate of Insurance (COI), Insurance Certificate, Other Documents.
Allowed MIME types: application/pdf, image/jpeg, image/png.
Upload a document to a specific trailer. Supports
On the right side, you can see examples of different error codes by clicking Example and selecting the response code.
multipart/form-data. Each request must contain exactly one file.
- Max file size: 25 MB
- Allowed MIME types:
application/pdf,image/jpeg,image/png - Allowed Document Types: Motor Vehicle Record, Vehicle Image, Inspection Certificate, Certificate of Insurance (COI), Insurance Certificate, Other Documents
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
trailerId | path | string | Yes | Unique identifier of trailer |
version | path | string | Yes | API version (e.g., 1.0) |
Documents cannot be uploaded to an external trailer. An external trailer is a carrier’s equipment recorded against a trip, not an asset you manage, so this endpoint answers
404 Not Found for one — the same as the truck and driver document endpoints do. Read CompanyOwnedAsset from Get trailer first if you need to check.A small number of older external records carry no ownership value and are still accepted by this endpoint. Do not rely on the refusal as a completeness guarantee.Request Body
multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
File | binary | Yes | The file to upload (PDF, JPEG, PNG). Max size 25 MB. |
FileName | string | No | Optional custom filename (if omitted, filename is taken from multipart part) |
DocumentType | string | Yes | The type of document. Must match one of the allowed document types. |
Example Request (cURL)
curl -X POST "{{host}}/api/p/v1/trailers/{trailerId}/document" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: multipart/form-data" \
-F "File=@COI.pdf" \
-F "DocumentType=Certificate of Insurance (COI)"
Response Body
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier of the uploaded document |
AttachmentPath | string | File name/path assigned on upload + timestamp suffix (e.g., 1757343192) |
AttachmentType | string | Type of document (matches DocumentType) |
AttachmentSize | integer | Size of the file in bytes |
UploadedAt | string | UTC timestamp when the file was uploaded (ISO 8601) |
ParentId | string | Identifier of the parent entity (the {trailerId}) |
ParentType | string | Entity type the document is attached to (Trailer) |
Example Response
200 OK{
"id": "c3f0a7d2-005e-4903-a4ee-45ca5e86411a",
"AttachmentPath": "COI-1757343192.pdf",
"AttachmentType": "Certificate of Insurance (COI)",
"AttachmentSize": 1048576,
"UploadedAt": "2025-09-09T08:26:03.194Z",
"ParentId": "trl-12345",
"ParentType": "Trailer"
}
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 and trailerId in the URL path. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated. Alternatively, you can directly edit the cURL command. ⚠️ 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
multipart/form-data
⌘I
Upload trailer document
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form File=@example-file \
--form 'DocumentType=<string>' \
--form 'FileName=<string>'const form = new FormData();
form.append('File', '<string>');
form.append('DocumentType', '<string>');
form.append('FileName', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document', 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}/trailers/{trailerId}/document"
files = { "File": ("example-file", open("example-file", "rb")) }
payload = {
"DocumentType": "<string>",
"FileName": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"DocumentType\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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}/trailers/{trailerId}/document"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"DocumentType\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://integrations.alvys.com/api/p/v{version}/trailers/{trailerId}/document")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"DocumentType\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.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>"
}