Approve planned job
curl --request POST \
--url https://api.sortx.co.uk/planned-maintenance/approvals/approve \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"id": "<string>",
"expectedRevision": 123
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({requestId: '<string>', id: '<string>', expectedRevision: 123})
};
fetch('https://api.sortx.co.uk/planned-maintenance/approvals/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/planned-maintenance/approvals/approve"
payload = {
"requestId": "<string>",
"id": "<string>",
"expectedRevision": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"key": "<string>",
"source": "cycle",
"id": "<string>",
"title": "<string>",
"propertyId": "<string>",
"blockId": "<string>",
"addressLine": "<string>",
"area": "<string>",
"sourceLabel": "<string>",
"cycleId": "<string>",
"programmeId": "<string>",
"contractorContactId": "<string>",
"contractorName": "<string>",
"dueOn": "<string>",
"overdue": true,
"estCostMinor": 123,
"status": "assign",
"approvalState": "required",
"tenantNotifiedAt": "<string>",
"accessRefusedAt": "<string>",
"accessRefusedReason": "<string>",
"skippable": true,
"booking": {
"date": "<string>",
"startMinute": 123,
"endMinute": 123
},
"budgetLineId": "<string>",
"revision": 123
}{
"_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>"
}planned-maintenance
Approve planned job
Approve a job’s cost on the landlord’s behalf (the agency’s authority); it then counts as committed
POST
/
planned-maintenance
/
approvals
/
approve
Approve planned job
curl --request POST \
--url https://api.sortx.co.uk/planned-maintenance/approvals/approve \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"id": "<string>",
"expectedRevision": 123
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({requestId: '<string>', id: '<string>', expectedRevision: 123})
};
fetch('https://api.sortx.co.uk/planned-maintenance/approvals/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/planned-maintenance/approvals/approve"
payload = {
"requestId": "<string>",
"id": "<string>",
"expectedRevision": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"key": "<string>",
"source": "cycle",
"id": "<string>",
"title": "<string>",
"propertyId": "<string>",
"blockId": "<string>",
"addressLine": "<string>",
"area": "<string>",
"sourceLabel": "<string>",
"cycleId": "<string>",
"programmeId": "<string>",
"contractorContactId": "<string>",
"contractorName": "<string>",
"dueOn": "<string>",
"overdue": true,
"estCostMinor": 123,
"status": "assign",
"approvalState": "required",
"tenantNotifiedAt": "<string>",
"accessRefusedAt": "<string>",
"accessRefusedReason": "<string>",
"skippable": true,
"booking": {
"date": "<string>",
"startMinute": 123,
"endMinute": 123
},
"budgetLineId": "<string>",
"revision": 123
}{
"_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
Body
application/json
Response
Success