This could look cleaner and clearer if you built the payload in one shot, like:

```python
payload = {
    'apiKey': self.api_key,
    'internalHostname': ...
    'events': {
        'api': events
    },
    'uuid': ...
    ...
}