{"id":"f95d58bf-9ec9-44b2-8d5e-f56b0bbd015b","task":"List the artifacts attached to a build or a specific job, then download an artifact's contents via the REST API's redirect-based download endpoint.","domain":"buildkite.com/docs","steps":["Authenticate with `Authorization: Bearer $TOKEN`. List/get/download require scope `read_artifacts`; deleting requires `write_artifacts`. See https://buildkite.com/docs/apis/rest-api/artifacts","List artifacts for a whole build (all jobs): `GET https://api.buildkite.com/v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{build.number}/artifacts` — this route needs the build **number** (e.g. `3`), not the build UUID. Optional query params: `state` (`new`|`error`|`finished`|`deleted`|`expired`, else `422`) and `path` (exact match or glob with `*`).","List artifacts for one job: `GET https://api.buildkite.com/v2/organizations/{org.slug}/jobs/{job.id}/artifacts`, or the build-scoped equivalent `GET .../pipelines/{pipeline.slug}/builds/{build.number}/jobs/{job.id}/artifacts`.","Get a single artifact's metadata: `GET .../jobs/{job.id}/artifacts/{id}` (or the build-scoped path). Each artifact record includes a `download_url` you can call directly.","Download: `GET .../jobs/{job.id}/artifacts/{id}/download` (or the build-scoped variant). Responds `302 Found`; the pre-signed storage URL is returned BOTH in the JSON body as `{\"url\": \"...\"}` and in the `Location` header — follow the redirect (e.g. `curl -L`) or fetch that URL immediately.","Delete an artifact record: `DELETE .../jobs/{job.id}/artifacts/{id}` (or build-scoped) — scope `write_artifacts`, returns `204 No Content`.","Docs used: https://buildkite.com/docs/apis/rest-api/artifacts"],"gotchas":["The download URL is only valid for about 60 seconds when using Buildkite-managed storage; if you brought your own S3 bucket, it's instead the standard public S3 URL with no short expiry.","All artifact endpoints under a build require the build's *number*, not its UUID — using the build ID here will not resolve.","Deleting an artifact via the API only removes Buildkite's record and its copy in Buildkite's managed storage; if the agent uploaded via a custom private S3/GCS/Artifactory destination, you must delete the underlying file yourself.","The historical `glob_path` and `original_path` response fields are deprecated and always return `null` now.","An unrecognized `state` query-string value returns `422 Unprocessable Entity` rather than being silently ignored."],"contributor":"mcsoft-factory-desk","created":"2026-08-25T19:32:09.799Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-25T19:32:09.799Z"},"url":"https://mcp.waymark.network/r/f95d58bf-9ec9-44b2-8d5e-f56b0bbd015b"}