Record visit outcome
curl --request POST \
--url https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visit-outcome \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"calendarEventId": "<string>",
"reasons": [],
"note": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"ordered": true,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": true,
"currentFinishes": true
},
"access": {
"timeOnSiteMinutes": 123,
"doorPhotoDocumentId": "<string>",
"calledTenant": true,
"cardLeft": true,
"refusedBy": "<string>",
"keySetId": "<string>",
"contractorConfirmed": true,
"contractorExplanation": "<string>"
},
"callOut": {
"amountMinor": 123,
"borneBy": "<string>",
"currency": "<string>",
"note": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
calendarEventId: '<string>',
reasons: [],
note: '<string>',
nextStep: {
parts: {
part: '<string>',
ordered: true,
expectedOn: '<string>',
returnDurationMinutes: 123,
supplier: '<string>',
costMinor: 123
},
quote: {
lines: [{description: '<string>', amountMinor: 123}],
totalMinor: 123,
vatMinor: 123,
earliestStartOn: '<string>'
},
hazard: {description: '<string>', madeSafe: true, anyoneAtRisk: true},
returnVisit: {needed: '<string>', timeNeededMinutes: 123, returnBy: '<string>'},
photoDocumentIds: ['<string>']
},
otherTrade: {
trade: '<string>',
purpose: '<string>',
safeMeanwhile: true,
currentFinishes: true
},
access: {
timeOnSiteMinutes: 123,
doorPhotoDocumentId: '<string>',
calledTenant: true,
cardLeft: true,
refusedBy: '<string>',
keySetId: '<string>',
contractorConfirmed: true,
contractorExplanation: '<string>'
},
callOut: {amountMinor: 123, borneBy: '<string>', currency: '<string>', note: '<string>'}
})
};
fetch('https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visit-outcome', 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/repairs/{id}/visit-outcome"
payload = {
"requestId": "<string>",
"calendarEventId": "<string>",
"reasons": [],
"note": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"ordered": True,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": True,
"anyoneAtRisk": True
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": ["<string>"]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": True,
"currentFinishes": True
},
"access": {
"timeOnSiteMinutes": 123,
"doorPhotoDocumentId": "<string>",
"calledTenant": True,
"cardLeft": True,
"refusedBy": "<string>",
"keySetId": "<string>",
"contractorConfirmed": True,
"contractorExplanation": "<string>"
},
"callOut": {
"amountMinor": 123,
"borneBy": "<string>",
"currency": "<string>",
"note": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"repairId": "<string>",
"visits": [
{
"number": 123,
"calendarEventId": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"state": "booked",
"current": true,
"contractor": "<string>",
"outcome": {
"id": "<string>",
"result": "fixed",
"reasons": [
"tenant_not_home"
],
"note": "<string>",
"source": "staff",
"recordedBy": "<string>",
"recordedAt": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"supplier": "<string>",
"ordered": true,
"expectedOn": "<string>",
"costMinor": 123,
"currency": "<string>",
"returnDurationMinutes": 123
},
"quote": {
"quoteId": "<string>",
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>",
"currency": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
}
},
"arrivals": [
{
"stage": "<string>",
"at": "<string>",
"note": "<string>"
}
]
}
],
"contacts": [
{
"id": "<string>",
"party": "tenant",
"partyName": "<string>",
"channel": "call",
"direction": "outbound",
"result": "spoke",
"note": "<string>",
"occurredAt": "<string>",
"recordedBy": "<string>"
}
],
"summary": {
"visits": 123,
"unfinished": 123,
"contactAttempts": 123,
"unanswered": 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>"
}maintenance-pro
Record visit outcome
Record what happened at the repair’s current visit; anything but fixed sends it back for the next visit
POST
/
maintenance-pro
/
repairs
/
{id}
/
visit-outcome
Record visit outcome
curl --request POST \
--url https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visit-outcome \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"calendarEventId": "<string>",
"reasons": [],
"note": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"ordered": true,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": true,
"currentFinishes": true
},
"access": {
"timeOnSiteMinutes": 123,
"doorPhotoDocumentId": "<string>",
"calledTenant": true,
"cardLeft": true,
"refusedBy": "<string>",
"keySetId": "<string>",
"contractorConfirmed": true,
"contractorExplanation": "<string>"
},
"callOut": {
"amountMinor": 123,
"borneBy": "<string>",
"currency": "<string>",
"note": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
calendarEventId: '<string>',
reasons: [],
note: '<string>',
nextStep: {
parts: {
part: '<string>',
ordered: true,
expectedOn: '<string>',
returnDurationMinutes: 123,
supplier: '<string>',
costMinor: 123
},
quote: {
lines: [{description: '<string>', amountMinor: 123}],
totalMinor: 123,
vatMinor: 123,
earliestStartOn: '<string>'
},
hazard: {description: '<string>', madeSafe: true, anyoneAtRisk: true},
returnVisit: {needed: '<string>', timeNeededMinutes: 123, returnBy: '<string>'},
photoDocumentIds: ['<string>']
},
otherTrade: {
trade: '<string>',
purpose: '<string>',
safeMeanwhile: true,
currentFinishes: true
},
access: {
timeOnSiteMinutes: 123,
doorPhotoDocumentId: '<string>',
calledTenant: true,
cardLeft: true,
refusedBy: '<string>',
keySetId: '<string>',
contractorConfirmed: true,
contractorExplanation: '<string>'
},
callOut: {amountMinor: 123, borneBy: '<string>', currency: '<string>', note: '<string>'}
})
};
fetch('https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visit-outcome', 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/repairs/{id}/visit-outcome"
payload = {
"requestId": "<string>",
"calendarEventId": "<string>",
"reasons": [],
"note": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"ordered": True,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": True,
"anyoneAtRisk": True
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": ["<string>"]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": True,
"currentFinishes": True
},
"access": {
"timeOnSiteMinutes": 123,
"doorPhotoDocumentId": "<string>",
"calledTenant": True,
"cardLeft": True,
"refusedBy": "<string>",
"keySetId": "<string>",
"contractorConfirmed": True,
"contractorExplanation": "<string>"
},
"callOut": {
"amountMinor": 123,
"borneBy": "<string>",
"currency": "<string>",
"note": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"repairId": "<string>",
"visits": [
{
"number": 123,
"calendarEventId": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"state": "booked",
"current": true,
"contractor": "<string>",
"outcome": {
"id": "<string>",
"result": "fixed",
"reasons": [
"tenant_not_home"
],
"note": "<string>",
"source": "staff",
"recordedBy": "<string>",
"recordedAt": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"supplier": "<string>",
"ordered": true,
"expectedOn": "<string>",
"costMinor": 123,
"currency": "<string>",
"returnDurationMinutes": 123
},
"quote": {
"quoteId": "<string>",
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>",
"currency": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
}
},
"arrivals": [
{
"stage": "<string>",
"at": "<string>",
"note": "<string>"
}
]
}
],
"contacts": [
{
"id": "<string>",
"party": "tenant",
"partyName": "<string>",
"channel": "call",
"direction": "outbound",
"result": "spoke",
"note": "<string>",
"occurredAt": "<string>",
"recordedBy": "<string>"
}
],
"summary": {
"visits": 123,
"unfinished": 123,
"contactAttempts": 123,
"unanswered": 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
A workspace API key (Settings → API keys), scoped to <group>:read / <group>:write.
Path Parameters
Body
application/json
Available options:
fixed, made_safe, part_fixed, not_fixed, no_access, contractor_no_show Available options:
tenant_not_home, access_refused, keys_did_not_work, wrong_tools, parts_needed, bigger_than_expected, needs_other_trade, needs_quote_approval, unsafe_to_work, ran_out_of_time, other Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes