API requests on fetching job's artifacts returns message 404 not found

I’m trying to list artifacts for a job. It does have artifacts - what I can see in https://gitlab.com/<namespace>/<group>/<project>/-/artifacts page:

However, I cannot neither get nor delete artifacts using API calls from the documentation:

because this request:

$ curl --request GET --header "PRIVATE-TOKEN: ${CI_JOB_TOKEN}" "https://gitlab.com/api/v4/projects/<ID>/jobs/<JID>/artifacts"


{"message":"404 Not Found"}

If I remove the /artifacts part from the "https://gitlab.com/api/v4/projects/<ID>/jobs/<JID>/artifacts" URL, it returns the job.

Any ideas?

I found the problem. The artifacts pages shows 1 file where there are actually no files. That file is the job.log one and it’s not available for the API calls. So when I tried to request artifacts for other jobs with more files it worked. Both GET and POST requests.