Update programme
curl --request PATCH \
--url https://api.sortx.co.uk/planned-maintenance/programmes/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"name": "<string>",
"recurrenceInterval": 123,
"instructionLeadDays": 123,
"contractorContactId": "<string>",
"autoInstruct": true,
"responsibleTeamId": "<string>",
"managerStaffId": "<string>",
"costCodeId": "<string>",
"notes": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
expectedRevision: 123,
name: '<string>',
recurrenceInterval: 123,
instructionLeadDays: 123,
contractorContactId: '<string>',
autoInstruct: true,
responsibleTeamId: '<string>',
managerStaffId: '<string>',
costCodeId: '<string>',
notes: '<string>'
})
};
fetch('https://api.sortx.co.uk/planned-maintenance/programmes/{id}', 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/programmes/{id}"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"name": "<string>",
"recurrenceInterval": 123,
"instructionLeadDays": 123,
"contractorContactId": "<string>",
"autoInstruct": True,
"responsibleTeamId": "<string>",
"managerStaffId": "<string>",
"costCodeId": "<string>",
"notes": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"reference": "<string>",
"name": "<string>",
"status": "active",
"templateId": "<string>",
"templateName": "<string>",
"serviceCategory": "<string>",
"assetClass": "<string>",
"eventType": "<string>",
"statutory": true,
"instructions": "<string>",
"propertyId": "<string>",
"propertyLabel": "<string>",
"blockId": "<string>",
"blockLabel": "<string>",
"assetId": "<string>",
"assetLabel": "<string>",
"complianceKind": "gas_safety",
"recurrenceInterval": 123,
"recurrenceUnit": "day",
"anchorDay": 123,
"instructionLeadDays": 123,
"nextDueOn": "<string>",
"overdue": true,
"jobCategory": "<string>",
"contractorContactId": "<string>",
"contractorName": "<string>",
"autoInstruct": true,
"autoInstructSetAt": "<string>",
"responsibleTeamId": "<string>",
"responsibleTeamName": "<string>",
"managerStaffId": "<string>",
"managerName": "<string>",
"costCodeId": "<string>",
"costCodeLabel": "<string>",
"notes": "<string>",
"liveEventId": "<string>",
"liveEventStatus": "due",
"liveEventReviewState": "pending",
"endedAt": "<string>",
"endReason": "<string>",
"revision": 123,
"createdByUserId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"events": [
{
"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>"
}
]
}{
"_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
Update programme
Change a programme’s name, recurrence (from its next occurrence), responsible parties, cost code or notes
PATCH
/
planned-maintenance
/
programmes
/
{id}
Update programme
curl --request PATCH \
--url https://api.sortx.co.uk/planned-maintenance/programmes/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"name": "<string>",
"recurrenceInterval": 123,
"instructionLeadDays": 123,
"contractorContactId": "<string>",
"autoInstruct": true,
"responsibleTeamId": "<string>",
"managerStaffId": "<string>",
"costCodeId": "<string>",
"notes": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
expectedRevision: 123,
name: '<string>',
recurrenceInterval: 123,
instructionLeadDays: 123,
contractorContactId: '<string>',
autoInstruct: true,
responsibleTeamId: '<string>',
managerStaffId: '<string>',
costCodeId: '<string>',
notes: '<string>'
})
};
fetch('https://api.sortx.co.uk/planned-maintenance/programmes/{id}', 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/programmes/{id}"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"name": "<string>",
"recurrenceInterval": 123,
"instructionLeadDays": 123,
"contractorContactId": "<string>",
"autoInstruct": True,
"responsibleTeamId": "<string>",
"managerStaffId": "<string>",
"costCodeId": "<string>",
"notes": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"reference": "<string>",
"name": "<string>",
"status": "active",
"templateId": "<string>",
"templateName": "<string>",
"serviceCategory": "<string>",
"assetClass": "<string>",
"eventType": "<string>",
"statutory": true,
"instructions": "<string>",
"propertyId": "<string>",
"propertyLabel": "<string>",
"blockId": "<string>",
"blockLabel": "<string>",
"assetId": "<string>",
"assetLabel": "<string>",
"complianceKind": "gas_safety",
"recurrenceInterval": 123,
"recurrenceUnit": "day",
"anchorDay": 123,
"instructionLeadDays": 123,
"nextDueOn": "<string>",
"overdue": true,
"jobCategory": "<string>",
"contractorContactId": "<string>",
"contractorName": "<string>",
"autoInstruct": true,
"autoInstructSetAt": "<string>",
"responsibleTeamId": "<string>",
"responsibleTeamName": "<string>",
"managerStaffId": "<string>",
"managerName": "<string>",
"costCodeId": "<string>",
"costCodeLabel": "<string>",
"notes": "<string>",
"liveEventId": "<string>",
"liveEventStatus": "due",
"liveEventReviewState": "pending",
"endedAt": "<string>",
"endReason": "<string>",
"revision": 123,
"createdByUserId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"events": [
{
"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>"
}
]
}{
"_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:
day, week, month, quarter, year Response
Success
Available options:
active, ended Available options:
gas_safety, eicr, epc, smoke_co Available options:
day, week, month, quarter, year Available options:
due, instructed, booked, completed, cancelled Available options:
pending, accepted, rejected Show child attributes
Show child attributes