I'd rename `endpoint` to `endpoint_name` here for consistency.