Creating a directory structure from JSON
It seems fine, but I suggest to improve some minor improvements:


filename is not a simple file name but has directory element too, so I'd call it path
Instead of calling os.path.dirname twice, I'd call it once and cache the result in a local variable


Like this:

package_name = response['Package'][0]['fields']['name']
for doc in response['Document']:                
    path = os.path.join(package_name, doc[0]['fields']['name'])
    basedir = os.path.dirname(filename)
    if not os.path.exists(basedir):
        os.makedirs(basedir)

    content = doc[0]['fields']['content']
    with open(filename, "w") as f:
        f.write(content) 


Btw, the JSON structure looks a bit odd,
with several arrays with a single element.
Makes me wonder why these arrays are there at all,
instead of their contained objects directly.

I'd also be concerned about format changes in the JSON:
your code is tightly coupled to an unintuitive structure,
and if anything changes later,
it might be difficult to migrate the implementation.