I'm using the /notes endpoint (joplin-random-note-reloaded/src/index.ts at master · marph91/joplin-random-note-reloaded · GitHub). Notes in the trash are returned for sure.
But I see, notes have the is_conflict and deleted_time properties. I could check them instead of relying on the notebook ID.