Save replacement proposal
curl --request POST \
--url https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/replacement-proposals \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"proposalId": "<string>",
"expectedRevision": 123,
"currency": "<string>",
"options": [
{
"costMinor": 123,
"contractorContactId": "<string>",
"note": "<string>"
}
],
"message": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
proposalId: '<string>',
expectedRevision: 123,
currency: '<string>',
options: [{costMinor: 123, contractorContactId: '<string>', note: '<string>'}],
message: '<string>'
})
};
fetch('https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/replacement-proposals', 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}/replacement-proposals"
payload = {
"requestId": "<string>",
"proposalId": "<string>",
"expectedRevision": 123,
"currency": "<string>",
"options": [
{
"costMinor": 123,
"contractorContactId": "<string>",
"note": "<string>"
}
],
"message": "<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
Save replacement proposal
Start or change the draft proposal to the owner: repair or replace?
POST
/
maintenance-pro
/
assets
/
{assetId}
/
replacement-proposals
Save replacement proposal
curl --request POST \
--url https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/replacement-proposals \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"proposalId": "<string>",
"expectedRevision": 123,
"currency": "<string>",
"options": [
{
"costMinor": 123,
"contractorContactId": "<string>",
"note": "<string>"
}
],
"message": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
proposalId: '<string>',
expectedRevision: 123,
currency: '<string>',
options: [{costMinor: 123, contractorContactId: '<string>', note: '<string>'}],
message: '<string>'
})
};
fetch('https://api.sortx.co.uk/maintenance-pro/assets/{assetId}/replacement-proposals', 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}/replacement-proposals"
payload = {
"requestId": "<string>",
"proposalId": "<string>",
"expectedRevision": 123,
"currency": "<string>",
"options": [
{
"costMinor": 123,
"contractorContactId": "<string>",
"note": "<string>"
}
],
"message": "<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
Available options:
repeat_faults, not_worth_repairing, unsafe, end_of_life, upgrade, other Show child attributes
Show child attributes
Available options:
repair, replace, upgrade 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