# Admin API endpoint fails with ghost docker

**URL:** <https://forum.ghost.org/t/admin-api-endpoint-fails-with-ghost-docker/14779>\
**Category:** Developer help\
**Created:** [May 30, 2020, 8:16pm UTC](https://forum.ghost.org/t/admin-api-endpoint-fails-with-ghost-docker/14779 "2020-05-30T20:16:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamjgrant](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/adamjgrant/32/8191_2.png) [@adamjgrant](https://forum.ghost.org/u/adamjgrant)\
**Post date:** [May 30, 2020, 8:16pm UTC](https://forum.ghost.org/t/admin-api-endpoint-fails-with-ghost-docker/14779/1 "2020-05-30T20:16:06Z")

</div>

[http://covidvax.everything.io](http://covidvax.everything.io)

I’m trying to integrate ghost with iA Writer. After getting an error in iA writer, I set up a request manually in Paw, verified it worked with a DigitalOcean ghost installation, and tried on my ghost docker instance.

The instance is running swimmingly, the only modification I made was to mount the content/data folder from my local machine. Everything seems to work, site loads, I can create, edit, delete, posts.

I set up an integration as per the docs but get an error

```
{"errors":[{"message":"Unknown Admin API Key","context":null,"type":"UnauthorizedError","details":null,"property":null,"help":null,"code":"UNKNOWN_ADMIN_API_KEY","id":"388c2080-a2b1-11ea-a66e-db9803cd6a2a"}]}

```

Looking at the source code, it appears this will return if it [fails to retrieve an API key record for the passed in ID](https://github.com/TryGhost/Ghost/blob/master/core/server/services/auth/api-key/admin.js#L104).

So I instead changed

```
models.ApiKey.findOne({id: apiKeyId}).then((apiKey) => {

```

to something like

```
models.ApiKey.collections().fetch().then(keys...

```

And verified it was returning all the keys as JSON.

It appears if you call `.get` on any one of those keys, you get an authorization failed error. And that’s where I’m not sure what to investigate.

Could someone point me in the right direction please?

Update: I forgot to mention I’m editing to source code directly to pipe this key.get authorization error just to be sure it’s coming directly from the source. I also 777d the content dir recursively just to diagnose.
