def event_handler(keyset_id, handler_id=None):
    """Provide endpoint which allow block's event handlers manipulation.

    :type keyset_id:   int
    :param keyset_id:  Reference on unique identifier of application's
                       keyset for which event handler access required.
    :type handler_id:  int | None
    :param handler_id: Reference on unique identifier of block's event
                       handler.

    :rtype:  str
    :return: Target REST API endpoint which is relative to base address.
    """
    endpoint = '/v1/blocks/key/{0}/event_handler'.format(keyset_id)
    if handler_id:
        endpoint = '{0}/{1}'.format(endpoint, handler_id)
    return endpoint
