def do_POST_reinitialize(self) -> None:
        """Handle a ``POST`` request to ``/reinitialize`` path.

        The request body may contain a JSON dictionary with the following key:

            * ``force``: ``True`` if we want to cancel an already running task in order to reinit a replica.

        Response HTTP status codes:

            * ``200``: if the reinit operation has started; or
            * ``503``: if any error is returned by :func:`~patroni.ha.Ha.reinitialize`.
        """
        request = self._read_json_content(body_is_optional=True)

        if request:
            logger.debug('received reinitialize request: %s', request)

        force = isinstance(request, dict) and parse_bool(request.get('force')) or False

        data = self.server.patroni.ha.reinitialize(force)
        if data is None:
            status_code = 200
            data = 'reinitialize started'
        else:
            status_code = 503
        self.write_response(status_code, data)
Handle a ``POST`` request to ``/reinitialize`` path.

        The request body may contain a JSON dictionary with the following key:

            * ``force``: ``True`` if we want to cancel an already running task in order to reinit a replica.

        Response HTTP status codes:

            * ``200``: if the reinit operation has started; or
            * ``503``: if any error is returned by :func:`~patroni.ha.Ha.reinitialize`.
        
patroni/api.py