# Status 400 when accessing Jira Cloud API endpoints anonymously inside ACE lifecycle hook

**URL:** <https://community.developer.atlassian.com/t/status-400-when-accessing-jira-cloud-api-endpoints-anonymously-inside-ace-lifecycle-hook/33448>\
**Category:** Jira Cloud\
**Tags:** ac-express, lifecycle\
**Created:** [November 15, 2019, 3:47am UTC](https://community.developer.atlassian.com/t/status-400-when-accessing-jira-cloud-api-endpoints-anonymously-inside-ace-lifecycle-hook/33448 "2019-11-15T03:47:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RhysDiab](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rhysdiab/32/38004_2.png) [@RhysDiab](https://community.developer.atlassian.com/u/RhysDiab)\
**Post date:** [November 15, 2019, 3:47am UTC](https://community.developer.atlassian.com/t/status-400-when-accessing-jira-cloud-api-endpoints-anonymously-inside-ace-lifecycle-hook/33448/1 "2019-11-15T03:47:53Z")

</div>

I’m trying to add a field to select issues after the addon has been installed. However, when I try to access the currently available fields, I get a status 400.

If I add userAccountId to the httpClient it works.

```auto
 addon.on('host_settings_saved', async (clientKey, data) => {
    const httpClient = addon.httpClient({
      clientKey,
    });

     httpClient.get(
      {
        headers: {
          'Content-Type': 'application/json',
          Accept: 'application/json',
        },
        url: `/rest/api/3/field`,
      })...
  });

```

Any idea how I can access API endpoints like these without needing a userAccountId inside the install lifecycle hook?

---

<div class="post-metadata">

**Author:** ![RhysDiab](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rhysdiab/32/38004_2.png) [@RhysDiab](https://community.developer.atlassian.com/u/RhysDiab)\
**Post date:** [November 15, 2019, 11:50pm UTC](https://community.developer.atlassian.com/t/status-400-when-accessing-jira-cloud-api-endpoints-anonymously-inside-ace-lifecycle-hook/33448/2 "2019-11-15T23:50:08Z")

</div>

Ok, I found a hacky solution.

I needed to wrap my function in a setTimeout and wait 5 seconds before calling it.

Looks like this lifecycle hook gets called a little bit early.
