Instruct event
curl --request POST \
--url https://api.sortx.co.uk/planned-maintenance/events/{id}/instruct \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"contractorContactId": "<string>",
"notes": "<string>",
"override": {
"reason": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
expectedRevision: 123,
contractorContactId: '<string>',
notes: '<string>',
override: {reason: '<string>'}
})
};
fetch('https://api.sortx.co.uk/planned-maintenance/events/{id}/instruct', 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/events/{id}/instruct"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"contractorContactId": "<string>",
"notes": "<string>",
"override": { "reason": "<string>" }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"programmeId": "<string>",
"programmeReference": "<string>",
"programmeName": "<string>",
"occurrence": 123,
"reference": "<string>",
"status": "due",
"reviewState": "pending",
"dueOn": "<string>",
"instructBy": "<string>",
"overdue": true,
"revisit": true,
"statutory": true,
"propertyId": "<string>",
"propertyLabel": "<string>",
"blockId": "<string>",
"blockLabel": "<string>",
"assetId": "<string>",
"assetLabel": "<string>",
"complianceKind": "gas_safety",
"contractorContactId": "<string>",
"contractorName": "<string>",
"instructedAt": "<string>",
"instructionNotes": "<string>",
"instructedAutomatically": true,
"autoInstructSkippedReason": "<string>",
"booking": {
"appointmentId": "<string>",
"status": "held",
"startsAt": "<string>",
"endsAt": "<string>",
"staffId": "<string>",
"staffName": "<string>",
"revision": 123
},
"completedOn": "<string>",
"completedAt": "<string>",
"completedByUserId": "<string>",
"completionNotes": "<string>",
"reviewedAt": "<string>",
"reviewedByUserId": "<string>",
"reviewNotes": "<string>",
"rejectionReason": "<string>",
"remedialRepair": {
"id": "<string>",
"reference": "<string>"
},
"nextEventId": "<string>",
"certificateDocumentId": "<string>",
"costCodeId": "<string>",
"cancelledAt": "<string>",
"cancelReason": "<string>",
"evidenceCount": 123,
"revision": 123,
"createdAt": "<string>",
"updatedAt": "<string>",
"evidence": [
{
"documentId": "<string>",
"name": "<string>",
"contentType": "<string>",
"kind": "<string>",
"createdAt": "<string>",
"archivedAt": "<string>",
"purged": true
}
],
"certificate": {
"documentId": "<string>",
"name": "<string>",
"kind": "<string>",
"reference": "<string>",
"issuedOn": "<string>",
"expiresOn": "<string>",
"archivedAt": "<string>",
"replaced": true
},
"visits": [
{
"appointmentId": "<string>",
"status": "held",
"startsAt": "<string>",
"endsAt": "<string>",
"staffName": "<string>",
"outcome": "attended",
"cancelReason": "<string>"
}
],
"invoices": [
{
"id": "<string>",
"subjectKind": "<string>",
"subjectId": "<string>",
"subjectLabel": "<string>",
"propertyId": "<string>",
"propertyLabel": "<string>",
"tenancyId": "<string>",
"contractorContactId": "<string>",
"contractorName": "<string>",
"number": "<string>",
"issuedOn": "<string>",
"dueOn": "<string>",
"currency": "<string>",
"netMinor": 123,
"vatMinor": 123,
"grossMinor": 123,
"borneBy": "landlord",
"documentId": "<string>",
"status": "received",
"approvedAt": "<string>",
"creditedMinor": 123,
"paidMinor": 123,
"outstandingMinor": 123,
"disputedMinor": 123,
"payableMinor": 123,
"recoveredMinor": 123,
"recoverableMinor": 123,
"disputeReason": "<string>",
"disputedAt": "<string>",
"voidedAt": "<string>",
"voidReason": "<string>",
"legacy": true,
"legacyStatus": "<string>",
"legacySettled": true,
"revision": 123,
"createdAt": "<string>",
"lines": [
{
"id": "<string>",
"ordinal": 123,
"kind": "labour",
"description": "<string>",
"netMinor": 123,
"vatMinor": 123,
"grossMinor": 123
}
],
"payments": [
{
"id": "<string>",
"amountMinor": 123,
"paidOn": "<string>",
"reference": "<string>",
"legacy": true,
"createdAt": "<string>",
"correctedAt": "<string>",
"correctionReason": "<string>"
}
],
"creditNotes": [
{
"id": "<string>",
"number": "<string>",
"issuedOn": "<string>",
"netMinor": 123,
"vatMinor": 123,
"grossMinor": 123,
"reason": "<string>",
"documentId": "<string>",
"createdAt": "<string>",
"correctedAt": "<string>",
"correctionReason": "<string>"
}
],
"recoveries": [
{
"id": "<string>",
"amountMinor": 123,
"receivedOn": "<string>",
"reference": "<string>",
"createdAt": "<string>",
"correctedAt": "<string>",
"correctionReason": "<string>"
}
],
"authorisation": {
"state": "within",
"basis": "approved_quote",
"authorisedMinor": 123,
"authorisedCurrency": "<string>",
"earlierMinor": 123,
"chargedMinor": 123,
"remainingMinor": 123,
"excessMinor": 123
},
"limitOverride": {
"id": "<string>",
"state": "<string>",
"basis": "<string>",
"authorisedMinor": 123,
"authorisedCurrency": "<string>",
"earlierMinor": 123,
"chargedMinor": 123,
"excessMinor": 123,
"reason": "<string>",
"userId": "<string>",
"createdAt": "<string>"
}
}
]
}{
"_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
Instruct event
Instruct an eligible contractor for the visit (or change the instructed contractor before it is booked)
POST
/
planned-maintenance
/
events
/
{id}
/
instruct
Instruct event
curl --request POST \
--url https://api.sortx.co.uk/planned-maintenance/events/{id}/instruct \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"contractorContactId": "<string>",
"notes": "<string>",
"override": {
"reason": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
expectedRevision: 123,
contractorContactId: '<string>',
notes: '<string>',
override: {reason: '<string>'}
})
};
fetch('https://api.sortx.co.uk/planned-maintenance/events/{id}/instruct', 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/events/{id}/instruct"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"contractorContactId": "<string>",
"notes": "<string>",
"override": { "reason": "<string>" }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"programmeId": "<string>",
"programmeReference": "<string>",
"programmeName": "<string>",
"occurrence": 123,
"reference": "<string>",
"status": "due",
"reviewState": "pending",
"dueOn": "<string>",
"instructBy": "<string>",
"overdue": true,
"revisit": true,
"statutory": true,
"propertyId": "<string>",
"propertyLabel": "<string>",
"blockId": "<string>",
"blockLabel": "<string>",
"assetId": "<string>",
"assetLabel": "<string>",
"complianceKind": "gas_safety",
"contractorContactId": "<string>",
"contractorName": "<string>",
"instructedAt": "<string>",
"instructionNotes": "<string>",
"instructedAutomatically": true,
"autoInstructSkippedReason": "<string>",
"booking": {
"appointmentId": "<string>",
"status": "held",
"startsAt": "<string>",
"endsAt": "<string>",
"staffId": "<string>",
"staffName": "<string>",
"revision": 123
},
"completedOn": "<string>",
"completedAt": "<string>",
"completedByUserId": "<string>",
"completionNotes": "<string>",
"reviewedAt": "<string>",
"reviewedByUserId": "<string>",
"reviewNotes": "<string>",
"rejectionReason": "<string>",
"remedialRepair": {
"id": "<string>",
"reference": "<string>"
},
"nextEventId": "<string>",
"certificateDocumentId": "<string>",
"costCodeId": "<string>",
"cancelledAt": "<string>",
"cancelReason": "<string>",
"evidenceCount": 123,
"revision": 123,
"createdAt": "<string>",
"updatedAt": "<string>",
"evidence": [
{
"documentId": "<string>",
"name": "<string>",
"contentType": "<string>",
"kind": "<string>",
"createdAt": "<string>",
"archivedAt": "<string>",
"purged": true
}
],
"certificate": {
"documentId": "<string>",
"name": "<string>",
"kind": "<string>",
"reference": "<string>",
"issuedOn": "<string>",
"expiresOn": "<string>",
"archivedAt": "<string>",
"replaced": true
},
"visits": [
{
"appointmentId": "<string>",
"status": "held",
"startsAt": "<string>",
"endsAt": "<string>",
"staffName": "<string>",
"outcome": "attended",
"cancelReason": "<string>"
}
],
"invoices": [
{
"id": "<string>",
"subjectKind": "<string>",
"subjectId": "<string>",
"subjectLabel": "<string>",
"propertyId": "<string>",
"propertyLabel": "<string>",
"tenancyId": "<string>",
"contractorContactId": "<string>",
"contractorName": "<string>",
"number": "<string>",
"issuedOn": "<string>",
"dueOn": "<string>",
"currency": "<string>",
"netMinor": 123,
"vatMinor": 123,
"grossMinor": 123,
"borneBy": "landlord",
"documentId": "<string>",
"status": "received",
"approvedAt": "<string>",
"creditedMinor": 123,
"paidMinor": 123,
"outstandingMinor": 123,
"disputedMinor": 123,
"payableMinor": 123,
"recoveredMinor": 123,
"recoverableMinor": 123,
"disputeReason": "<string>",
"disputedAt": "<string>",
"voidedAt": "<string>",
"voidReason": "<string>",
"legacy": true,
"legacyStatus": "<string>",
"legacySettled": true,
"revision": 123,
"createdAt": "<string>",
"lines": [
{
"id": "<string>",
"ordinal": 123,
"kind": "labour",
"description": "<string>",
"netMinor": 123,
"vatMinor": 123,
"grossMinor": 123
}
],
"payments": [
{
"id": "<string>",
"amountMinor": 123,
"paidOn": "<string>",
"reference": "<string>",
"legacy": true,
"createdAt": "<string>",
"correctedAt": "<string>",
"correctionReason": "<string>"
}
],
"creditNotes": [
{
"id": "<string>",
"number": "<string>",
"issuedOn": "<string>",
"netMinor": 123,
"vatMinor": 123,
"grossMinor": 123,
"reason": "<string>",
"documentId": "<string>",
"createdAt": "<string>",
"correctedAt": "<string>",
"correctionReason": "<string>"
}
],
"recoveries": [
{
"id": "<string>",
"amountMinor": 123,
"receivedOn": "<string>",
"reference": "<string>",
"createdAt": "<string>",
"correctedAt": "<string>",
"correctionReason": "<string>"
}
],
"authorisation": {
"state": "within",
"basis": "approved_quote",
"authorisedMinor": 123,
"authorisedCurrency": "<string>",
"earlierMinor": 123,
"chargedMinor": 123,
"remainingMinor": 123,
"excessMinor": 123
},
"limitOverride": {
"id": "<string>",
"state": "<string>",
"basis": "<string>",
"authorisedMinor": 123,
"authorisedCurrency": "<string>",
"earlierMinor": 123,
"chargedMinor": 123,
"excessMinor": 123,
"reason": "<string>",
"userId": "<string>",
"createdAt": "<string>"
}
}
]
}{
"_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
Available options:
due, instructed, booked, completed, cancelled Available options:
pending, accepted, rejected Available options:
gas_safety, eicr, epc, smoke_co 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
Show child attributes
Show child attributes