# Trying to get list of API\_ACCESS\_TOKEN\_CREATED returns nothing

**URL:** <https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896>\
**Category:** General\
**Created:** [February 9, 2022, 6:48pm UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896 "2022-02-09T18:48:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chanukov](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@chanukov](https://forum.buildkite.community/u/chanukov)\
**Post date:** [February 9, 2022, 6:48pm UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896/1 "2022-02-09T18:48:39Z")

</div>

I am trying to audit the API tokens grammatically, so that i can notify users whose token is old and should be rotated.  
I am testing using graphql explorer running

```auto
{
  organization(slug: $ORG_SLUG) {
    auditEvents(first: 500, type: API_ACCESS_TOKEN_CREATED) {
      edges {
        node {
          type
          occurredAt
          actor {
            name
          }
          subject {
            name
            type
          }
          data
        }
      }
    }
  }
}

```

returns:

````auto
{
  "data": {
    "organization": {
      "auditEvents": {
        "edges": []
      }
    }
  }
}```

I see other events just none to do with API keys. Is there another way for me to get a list of API_KEYS created?
````

---

<div class="post-metadata">

**Author:** ![jeremy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jeremy/32/1040_2.png) [@jeremy](https://forum.buildkite.community/u/jeremy)\
**Post date:** [February 9, 2022, 10:02pm UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896/2 "2022-02-09T22:02:02Z")

</div>

Hey @chanukov!  
Thank you for raising this, I think you may have run into a bug in the GraphQL API. Since I was able to reproduce the same results, I’ll raise this with the team to have it looked at. 🙂

Cheers,

Jeremy

---

<div class="post-metadata">

**Author:** ![chanukov](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@chanukov](https://forum.buildkite.community/u/chanukov)\
**Post date:** [March 10, 2022, 11:40pm UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896/3 "2022-03-10T23:40:13Z")

</div>

Any update here? ETA on possibly getting this looked at or fixed?

---

<div class="post-metadata">

**Author:** ![anon4496704](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon4496704](https://forum.buildkite.community/u/anon4496704)\
**Post date:** [March 11, 2022, 12:16am UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896/4 "2022-03-11T00:16:42Z")

</div>

Hi @chanukov,

Thanks for checking with us here! As we are currently working on other priority tasks, we don’t have a timeframe yet on this one. We will update you as soon as we have any info on this.

Best,  
Nithya

---

<div class="post-metadata">

**Author:** ![Ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Ash](https://forum.buildkite.community/u/Ash)\
**Post date:** [October 5, 2022, 8:52pm UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896/5 "2022-10-05T20:52:32Z")

</div>

Hello, I’m bumping this thread as we’re still trying to use the GraphQL API. Is there any updated ETA on a fix for this bug or any hope that it’s priority can be increased?

I just tried to manually parse the API\_ACCESS\_TOKEN\_CREATED events from all entries in the audit log, but they aren’t there. So no matter what the API doesn’t return any info on these events, even when not querying for them explicitly.

---

<div class="post-metadata">

**Author:** ![jeremy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jeremy/32/1040_2.png) [@jeremy](https://forum.buildkite.community/u/jeremy)\
**Post date:** [October 6, 2022, 12:12am UTC](https://forum.buildkite.community/t/trying-to-get-list-of-api-access-token-created-returns-nothing/1896/6 "2022-10-06T00:12:27Z")

</div>

Hi @Ash Welcome to the community!

Unfortunately, it is still not possible to get this value via the GraphQL API. API access tokens are not associated with an organization, but rather with individual users and because of that, you won’t see them in the audit events exposed via the API which are tied to a Buildkite organization.

I’ll raise this with the team again, but I can’t promise any timeframes as to when it will be changed - we’ll be sure to update this thread when there is more information to share!

Cheers,  
Jeremy
