Maintenance
Upload maintenance document
Attach one file, such as a repair invoice, to a maintenance record in Alvys. The file lists on the record’s Documents tab with files added in the app.
POST
/
api
/
p
/
v
{version}
/
maintenance
/
{id}
/
document
Upload maintenance document
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/maintenance/{id}/document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form File=@example-file \
--form 'FileName=<string>'const form = new FormData();
form.append('File', '<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}/maintenance/{id}/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}/maintenance/{id}/document"
files = { "File": ("example-file", open("example-file", "rb")) }
payload = { "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}/maintenance/{id}/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=\"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}/maintenance/{id}/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=\"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}/maintenance/{id}/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=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();{
"id": "<string>",
"FileName": "<string>",
"AttachmentSize": 123,
"UploadedAt": "2023-11-07T05:31:56Z",
"ParentId": "<string>"
}{
"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>"
}The Upload Maintenance Document endpoint attaches one file to a maintenance record, for example the repair invoice. The file is stored with the files users attach in Alvys and lists on the record’s Documents tab. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
Replace
This endpoint requires the
maintenance:update scope. See Authentication.- Content type:
multipart/form-data. Each request must contain exactly one file. - Max file size: 25 MB
- Allowed MIME types:
application/pdf,image/jpeg,image/png,image/gif
DocumentType field.
Request parameters
The following parameters are required in the URL path:| Parameter | Type | Required | Description |
|---|---|---|---|
| version | String | Yes | The version of the API. |
| id | String | Yes | The unique identifier of the maintenance record. |
Request body
multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
File | binary | Yes | The file to upload (PDF, JPEG, PNG, or GIF). Max size 25 MB. |
FileName | string | No | The name to store the file under. If you omit it, the name of the uploaded file is used. If the name does not end in an extension of the file’s MIME type, that extension is added. |
Example cURL request
curl -X POST 'https://integrations.alvys.com/api/p/v1/maintenance/{id}/document' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-F 'File=@repair-invoice.pdf;type=application/pdf' \
-F 'FileName=repair-invoice.pdf'
{id} with the maintenance record ID and YOUR_ACCESS_TOKEN with your actual Bearer token.
Response fields
| Field | Type | Description |
|---|---|---|
id | String | The id of the file on the maintenance record. |
FileName | String | The file name with its extension, as the record’s Documents tab shows it. |
AttachmentSize | Integer | The file size in bytes. |
UploadedAt | String (Date-Time) | The date and time the file was uploaded. |
ParentId | String | The id of the maintenance record the file is attached to. |
Example response
200 OK{
"id": "f91c0b66-0000-0000-0000-000000000417",
"FileName": "repair-invoice.pdf",
"AttachmentSize": 1048576,
"UploadedAt": "2026-11-13T15:04:05.000Z",
"ParentId": "4b0e6a52-0000-0000-0000-000000000417"
}
Status codes
| Status | Meaning |
|---|---|
| 200 | The file was attached to the maintenance record. |
| 400 | The form failed validation: the file is missing, it has no file name, or its MIME type is not allowed. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks the maintenance:update scope. |
| 404 | No maintenance record with the given id exists, or the record’s truck or trailer is outside the subsidiaries your credential can access. |
| 413 | The file is larger than 25 MB. |
| 415 | The request is not multipart/form-data. |
| 429 | The rate limit was exceeded. |
Rate limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information, see the Rate Limits section. This page is interactive, allowing you to try a request by specifying the API version and the maintenance record id in the URL path. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated.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>.
Response
OK
⌘I
Upload maintenance document
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/maintenance/{id}/document \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form File=@example-file \
--form 'FileName=<string>'const form = new FormData();
form.append('File', '<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}/maintenance/{id}/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}/maintenance/{id}/document"
files = { "File": ("example-file", open("example-file", "rb")) }
payload = { "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}/maintenance/{id}/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=\"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}/maintenance/{id}/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=\"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}/maintenance/{id}/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=\"FileName\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();{
"id": "<string>",
"FileName": "<string>",
"AttachmentSize": 123,
"UploadedAt": "2023-11-07T05:31:56Z",
"ParentId": "<string>"
}{
"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>"
}