Trucks
Update a truck
PATCH
/
truck
/
{id}
Update a truck
curl --request PATCH \
--url https://{instance}/api/v2/truck/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"isArchived": true,
"name": "<string>",
"identifier": "<string>",
"code": "<string>",
"maxPayloadLb": 123,
"emptyWeightLb": 123,
"deckLengthFt": 123,
"deckWidthFt": 123,
"maxHeightFt": 123,
"notes": "<string>",
"metadata": {}
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
isArchived: true,
name: '<string>',
identifier: '<string>',
code: '<string>',
maxPayloadLb: 123,
emptyWeightLb: 123,
deckLengthFt: 123,
deckWidthFt: 123,
maxHeightFt: 123,
notes: '<string>',
metadata: {}
})
};
fetch('https://{instance}/api/v2/truck/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/truck/{id}"
payload = {
"isArchived": True,
"name": "<string>",
"identifier": "<string>",
"code": "<string>",
"maxPayloadLb": 123,
"emptyWeightLb": 123,
"deckLengthFt": 123,
"deckWidthFt": 123,
"maxHeightFt": 123,
"notes": "<string>",
"metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"identifier": "<string>",
"code": "<string>",
"type": "tractor",
"status": "active",
"maxPayloadLb": 123,
"emptyWeightLb": 123,
"deckLengthFt": 123,
"deckWidthFt": 123,
"maxHeightFt": 123,
"notes": "<string>",
"metadata": {}
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}Authorizations
Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.
Path Parameters
Record id.
Body
application/json
Available options:
tractor, box_truck, flatbed_truck, stake_truck, pickup, van, other Available options:
active, inactive Response
Successful response.
Show child attributes
Show child attributes
⌘I
Update a truck
curl --request PATCH \
--url https://{instance}/api/v2/truck/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"isArchived": true,
"name": "<string>",
"identifier": "<string>",
"code": "<string>",
"maxPayloadLb": 123,
"emptyWeightLb": 123,
"deckLengthFt": 123,
"deckWidthFt": 123,
"maxHeightFt": 123,
"notes": "<string>",
"metadata": {}
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
isArchived: true,
name: '<string>',
identifier: '<string>',
code: '<string>',
maxPayloadLb: 123,
emptyWeightLb: 123,
deckLengthFt: 123,
deckWidthFt: 123,
maxHeightFt: 123,
notes: '<string>',
metadata: {}
})
};
fetch('https://{instance}/api/v2/truck/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/truck/{id}"
payload = {
"isArchived": True,
"name": "<string>",
"identifier": "<string>",
"code": "<string>",
"maxPayloadLb": 123,
"emptyWeightLb": 123,
"deckLengthFt": 123,
"deckWidthFt": 123,
"maxHeightFt": 123,
"notes": "<string>",
"metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"identifier": "<string>",
"code": "<string>",
"type": "tractor",
"status": "active",
"maxPayloadLb": 123,
"emptyWeightLb": 123,
"deckLengthFt": 123,
"deckWidthFt": 123,
"maxHeightFt": 123,
"notes": "<string>",
"metadata": {}
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}