@GetMapping(RestProtocolConstants.ENDPOINT_TICKETS + "/{id:.+}")
    @Operation(summary = "Get the status of a ticket",
        parameters = @Parameter(name = "id", required = true, in = ParameterIn.PATH, description = "Ticket id"))
    public ResponseEntity<String> getTicketStatus(@PathVariable("id") final String id) {
        try {
            val ticket = ticketRegistry.getTicket(id, Ticket.class);
            return new ResponseEntity<>(ticket.getId(), HttpStatus.OK);
        } catch (final InvalidTicketException e) {
            return new ResponseEntity<>("Ticket could not be found", HttpStatus.NOT_FOUND);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
            return new ResponseEntity<>(StringEscapeUtils.escapeHtml4(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }
Determine the status of a given ticket id, whether it's valid, exists, expired, etc.

@param id ticket id
@return {@link ResponseEntity} representing RESTful response
support/cas-server-support-rest-core/src/main/java/org/apereo/cas/support/rest/resources/TicketStatusResource.java