<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_event(self, user_id, event_name, event_properties=None, headers=None, endpoint_url=None):
 """ Send an identified event. If a user doesn't exist it will create one. :param str user_id: identified user's ID :param str event_name: event name (e.g. "visit_website") :param dict event_properties: properties that describe the event's details :param dict headers: custom request headers (if isn't set default values are used) :param str endpoint_url: where to send the request (if isn't set default value is used) :return: Response """

        endpoint_url = endpoint_url or self._endpoint_url

        url = endpoint_url + '/users/' + user_id + '/events'
        headers = headers or self._default_headers()

        event_properties = event_properties or {}
        payload = {
            "event_name": event_name,
            "custom_properties": event_properties
        }

        response = requests.post(url, headers=headers, json=payload)

        return response