Retire asset
curl --request POST \
--url https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/retire \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"replacedByAssetId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({requestId: '<string>', expectedRevision: 123, replacedByAssetId: '<string>'})
};
fetch('https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/retire', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/retire"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"replacedByAssetId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"assetId": "<string>",
"propertyId": "<string>",
"blockId": "<string>",
"installedOn": "<string>",
"ageMonths": 123,
"expectedLifeYears": 123,
"replacementCost": {
"amountMinor": 123,
"currency": "<string>"
},
"installCost": {
"amountMinor": 123,
"currency": "<string>"
},
"installerContactId": "<string>",
"retiredAt": "<string>",
"retiredReason": "replaced",
"replacedByAssetId": "<string>",
"revision": 123,
"state": "in_service",
"triggers": [
{
"kind": "open_repair",
"label": "<string>",
"now": "<string>",
"met": true,
"known": true,
"outcome": "<string>"
}
],
"openRepairs": [
{
"id": "<string>",
"reference": "<string>",
"description": "<string>",
"urgency": "<string>",
"status": "<string>"
}
],
"repairsLast12Months": 123,
"spendLast12Months": {
"amountMinor": 123,
"currency": "<string>"
},
"spendToDate": {
"amountMinor": 123,
"currency": "<string>"
},
"landlordContactId": "<string>",
"landlordEmail": "<string>",
"proposals": [
{
"id": "<string>",
"assetId": "<string>",
"status": "draft",
"reason": "repeat_faults",
"currency": "<string>",
"options": [
{
"kind": "repair",
"costMinor": 123,
"contractorContactId": "<string>",
"note": "<string>"
}
],
"recommendation": "repair",
"message": "<string>",
"landlordContactId": "<string>",
"sentAt": "<string>",
"sentTo": "<string>",
"decision": "repair",
"decidedVia": "email",
"decidedOn": "<string>",
"decisionNote": "<string>",
"workOrderRepairId": "<string>",
"revision": 123,
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"canEdit": true
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}maintenance-pro
Retire asset
Retire an asset, keeping its history
POST
/
maintenance-pro
/
assets
/
{assetId}
/
retire
Retire asset
curl --request POST \
--url https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/retire \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"replacedByAssetId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({requestId: '<string>', expectedRevision: 123, replacedByAssetId: '<string>'})
};
fetch('https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/retire', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/retire"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"replacedByAssetId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"assetId": "<string>",
"propertyId": "<string>",
"blockId": "<string>",
"installedOn": "<string>",
"ageMonths": 123,
"expectedLifeYears": 123,
"replacementCost": {
"amountMinor": 123,
"currency": "<string>"
},
"installCost": {
"amountMinor": 123,
"currency": "<string>"
},
"installerContactId": "<string>",
"retiredAt": "<string>",
"retiredReason": "replaced",
"replacedByAssetId": "<string>",
"revision": 123,
"state": "in_service",
"triggers": [
{
"kind": "open_repair",
"label": "<string>",
"now": "<string>",
"met": true,
"known": true,
"outcome": "<string>"
}
],
"openRepairs": [
{
"id": "<string>",
"reference": "<string>",
"description": "<string>",
"urgency": "<string>",
"status": "<string>"
}
],
"repairsLast12Months": 123,
"spendLast12Months": {
"amountMinor": 123,
"currency": "<string>"
},
"spendToDate": {
"amountMinor": 123,
"currency": "<string>"
},
"landlordContactId": "<string>",
"landlordEmail": "<string>",
"proposals": [
{
"id": "<string>",
"assetId": "<string>",
"status": "draft",
"reason": "repeat_faults",
"currency": "<string>",
"options": [
{
"kind": "repair",
"costMinor": 123,
"contractorContactId": "<string>",
"note": "<string>"
}
],
"recommendation": "repair",
"message": "<string>",
"landlordContactId": "<string>",
"sentAt": "<string>",
"sentTo": "<string>",
"decision": "repair",
"decidedVia": "email",
"decidedOn": "<string>",
"decisionNote": "<string>",
"workOrderRepairId": "<string>",
"revision": 123,
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"canEdit": true
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}Authorizations
A workspace API key (Settings → API keys), scoped to <group>:read / <group>:write.
Path Parameters
Body
application/json
Response
Success
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
replaced, removed, condemned, other Available options:
in_service, on_watch, replacement_suggested, retired Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes