Retrieve stored artifacts on subsequent jobs

Trying to get the stored artifact when a job runs & use the info stored in the artifact on subsequent jobs. The URL that the API mentions always returns a 404.

The gitlab API, describes a URL to fetch the artifact with a help of a URL which in our case gets generated like so: but gives out a 404 where as the information regarding CI_JOB_NAME & CI_COMMIT_REF_NAME are picked up correctly.

The artifact in theory gets stored here after the job runs:

Troubleshooting steps:

  • Tried to generate a PRIVATE_TOKEN and used it as per the API docs, returns 404.

I have a feeling you want to use artifacts from previous pipelines so there are couple options.

Option 1: Use cache
Option 2: Use artifact storage outside GitLab. Like Artifactory or Nexus.
Option 3: Use the API where the URL is You can find more examples in the official documentation.