# Latest Artifacts API returns empty list

**URL:** <https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283>\
**Category:** Deployments\
**Tags:** artifacts\
**Created:** [February 11, 2019, 3:35pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283 "2019-02-11T15:35:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DudeWhoCode](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dudewhocode/32/21386_2.png) [@DudeWhoCode](https://discuss.circleci.com/u/DudeWhoCode)\
**Post date:** [February 11, 2019, 3:35pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/1 "2019-02-11T15:35:54Z")

</div>

I can see the artifact of the latest build from master branch in circleci UI but “latest artifacts” API always returns empty list.

This API call returns empty list.  
`https://circleci.com/api/v1.1/project/github/user/project/latest/artifacts?circle-token=123456789&branch=master`

But if I use latest build number and call “/:build\_num/artifacts” API, it returns the correct artifact.

`https://circleci.com/api/v1.1/project/github/user/project/320/artifacts?circle-token=123456789`

The above API works fine by pulling the latest artifact using build number.

What could be the issue?

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [February 11, 2019, 4:01pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/2 "2019-02-11T16:01:09Z")

</div>

I’m not able to reproduce this

[https://circleci.com/api/v1.1/project/github/drazisil/junit-merge/389/artifacts](https://circleci.com/api/v1.1/project/github/drazisil/junit-merge/389/artifacts)

[https://circleci.com/api/v1.1/project/github/drazisil/junit-merge/latest/artifacts?&branch=master](https://circleci.com/api/v1.1/project/github/drazisil/junit-merge/latest/artifacts?&branch=master)

Can you [open a ticket with the details](https://support.circleci.com/hc/en-us/requests/new) of the project (and what type of token you are using) so we can take a look?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [February 21, 2019, 4:01pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/3 "2019-02-21T16:01:11Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [June 3, 2019, 8:16pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/4 "2019-06-03T20:16:05Z")

</div>



---

<div class="post-metadata">

**Author:** ![ericmacfa](https://avatars.discourse-cdn.com/v4/letter/e/258eb7/32.png) [@ericmacfa](https://discuss.circleci.com/u/ericmacfa)\
**Post date:** [July 18, 2019, 8:55pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/5 "2019-07-18T20:55:03Z")

</div>

TLDR: Two jobs in the same workflow call the latest artifacts endpoint. The first gets the correct artifacts, the second gets an empty array.

* * *

I’m experiencing a similar issue, however in my case the trouble is that the api call to fetch the latest artifacts sometimes returns the expected data, and other times it is empty.

I have a [repro workflow](https://circleci.com/workflow-run/8db6cff3-e356-4478-a460-2db1725acb14).  
Essentially, the flow is:

1. `create` job generates some dynamic text and stores it in a file, which is artifacted
2. `list` job calls the `/api/v1.1/project/github/user/project/latest/artifacts` endpoint and outputs the result
3. `show` job calls the same endpoint as `list`, but it stores the result in a file for later parsing

While the api call in `list` routinely outputs the expected response with a single artifact, the `show` job has always (thus far) received an empty array of artifacts.

* * *

 ![image](https://global.discourse-cdn.com/circleci/original/3X/c/c/ccae69b76ca666f1629b93fa65a332cd869b2348.png)

---

<div class="post-metadata">

**Author:** ![nicodn](https://avatars.discourse-cdn.com/v4/letter/n/ecccb3/32.png) [@nicodn](https://discuss.circleci.com/u/nicodn)\
**Post date:** [September 23, 2019, 5:29pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/6 "2019-09-23T17:29:51Z")

</div>

We’re running into this issue as well. It seems to have started when we split our workflow into jobs and the job that produces the artifacts finishes before the others.

We’re looking at a workaround using [https://circleci.com/api/v1.1/recent-builds](https://circleci.com/api/v1.1/recent-builds) but it would be nice to know if this can be solved another way, for example with an api argument to specify which job to get the artifacts from?

Thanks

---

<div class="post-metadata">

**Author:** ![MikhailTymchukFT](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mikhailtymchukft/32/24688_2.png) [@MikhailTymchukFT](https://discuss.circleci.com/u/MikhailTymchukFT)\
**Post date:** [April 17, 2020, 1:42pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/7 "2020-04-17T13:42:01Z")

</div>

How do I filter builds by jobs for a single branch inside a workflow?

[https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts?branch=master](https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts?branch=master) returns a list of artifacts for the latest build, but this can be different types of jobs - build, publish, test and so on.  
So the structure of artifacts varies from query to query.

---

<div class="post-metadata">

**Author:** ![kudoR](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@kudoR](https://discuss.circleci.com/u/kudoR)\
**Post date:** [June 17, 2020, 8:08pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/8 "2020-06-17T20:08:23Z")

</div>

hi, i have also the exact same issue…

- [https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/:buildnum/artifacts](https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/:buildnum/artifacts) -\> works as expected
- [https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts](https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts) -\> returns empty list  
any help on this?

---

<div class="post-metadata">

**Author:** ![geekorlife](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/geekorlife/32/26294_2.png) [@geekorlife](https://discuss.circleci.com/u/geekorlife)\
**Post date:** [January 21, 2021, 11:12pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/9 "2021-01-21T23:12:00Z")

</div>

Exactly the same issue here…

---

<div class="post-metadata">

**Author:** ![JulienKode](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/julienkode/32/23689_2.png) [@JulienKode](https://discuss.circleci.com/u/JulienKode)\
**Post date:** [October 13, 2021, 5:15pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/10 "2021-10-13T17:15:52Z")

</div>

Same issue for me

---

<div class="post-metadata">

**Author:** ![jaydorsey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaydorsey/32/35890_2.png) [@jaydorsey](https://discuss.circleci.com/u/jaydorsey)\
**Post date:** [December 24, 2024, 3:22pm UTC](https://discuss.circleci.com/t/latest-artifacts-api-returns-empty-list/28283/11 "2024-12-24T15:22:53Z")

</div>

I opened up a new thread [over here](https://discuss.circleci.com/t/retrieving-latest-artifacts-for-a-specific-branch-via-api/52504/3) and filed a support ticket.

Support confirmed the behavior that I was seeing w/ artifacts: for an active branch this isn’t a great way to get artifacts because each new build appears to clear out the artifacts (it’s almost like the `completed` filter doesn’t work at all)

I posted a potential workaround w/ the v1 API in my thread. There may also be a way to retrieve this data w/ the graphql API or the v2 API (if you can figure out the best way to get a list of jobs) but I haven’t figured it out yet (love if someone else finds a better way)
