While building the API client side interface for my employer I deleted a Term because I thought I'd be able to recreate it. Well, apparently Canvas keeps the term but it is no long accessible to be used or referenced in subsequent API calls. This wouldn't be a problem except that the SIS Term ID is already taken, so when I went to recreate a new term to replace it, I am presented with this response:
{
"errors": {
"sis_source_id": [
{
"attribute": "sis_source_id",
"type": "SIS ID \"185\" is already in use",
"message": "SIS ID \"185\" is already in use"
}
]
}
}
So the Term is already in use? But not really. It's deleted, as it shows here (workflow_state) when using the API to get the Term:
{
"id": 102,
"name": null,
"start_at": "2024-12-30T08:00:00Z",
"end_at": "2025-01-31T23:59:59Z",
"created_at": "2025-01-06T23:01:29Z",
"workflow_state": "deleted",
"grading_period_group_id": null,
"sis_term_id": "185",
"sis_import_id": null,
"overrides": {},
"course_count": 0
}
The thing is that SIS Term ID needs to be 185 to match our Term ID, so I'm in a bit of a pickle.
I was thinking from my vast experience with writing API server and clients and longevity in the Information Systems world authoring complete systems for various clients that when deleted that record is deleted. Not just made inaccessible. So my next question is, is there a way to clear the cache so to speak of deleted records? Am I stuck with this problem and won't be able to correct it ever? Alternatively can I undelete this term somehow? If there's an API method for undeleting I haven't found it.
Thanks to anyone that can illuminate the path for me.