The Heroku python client library is horribly out of date, and many simple things which should work don’t, throwing confusing errors. Here’s my version:

# coding: utf-8

import requests

HEROKU_URL = 'https://api.heroku.com'


class Client():
    def __init__(self, api_key, heroku_url=None):
        self.heroku_url = HEROKU_URL if heroku_url is None else heroku_url
        self.session = requests.Session()
        self.session.headers.update({'Accept': 'application/vnd.heroku+json; version=3'})
        self.session.auth = ('', api_key)

    def get(self, path):
        r = self.session.get('%s/%s' % (self.heroku_url.rstrip('/'), path.lstrip('/')))
        r.raise_for_status()
        return r.json()

    def post(self, path, data=None):
        r = self.session.post('%s/%s' % (self.heroku_url.rstrip('/'), path.lstrip('/')), data=data)
        r.raise_for_status()
        return r.json()

Add similar methods for DELETE if you find you require it. I haven’t yet, as the idea of programatically being able to delete apps is much more worrying than the ability to create them.