Events
curl --request GET \
--url https://api.sortx.co.uk/planned-maintenance/events \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/planned-maintenance/events', 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"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"items": [
{
"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>"
}
],
"counts": {
"due": 123,
"overdue": 123,
"instructed": 123,
"booked": 123,
"awaitingReview": 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
Events
Service events (occurrences) with their booking, and the workspace’s live counts
GET
/
planned-maintenance
/
events
Events
curl --request GET \
--url https://api.sortx.co.uk/planned-maintenance/events \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/planned-maintenance/events', 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"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"items": [
{
"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>"
}
],
"counts": {
"due": 123,
"overdue": 123,
"instructed": 123,
"booked": 123,
"awaitingReview": 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.