Skip to content

Downloading Results

When compilation succeeds, the server sends a compile.done message containing a download_url — a time-limited presigned URL pointing to the compiled binary on Pure’s object storage.

Terminal window
curl -fL "$DOWNLOAD_URL" -o myapp
chmod +x myapp

The URL is a standard HTTPS GET request. No authentication header is needed — the credentials are embedded in the URL itself.

The expires_at field in compile.done is a Unix timestamp in milliseconds indicating when the URL expires.

{
"type": "compile.done",
"job_id": "job_xyz789",
"download_url": "https://...",
"expires_at": 1714003600000,
"work_units": 1280
}

Default expiry is 1 hour from when the URL is generated. After expiry the URL returns HTTP 403.

To download the binary after the URL has expired, re-subscribe to the job via jobs.subscribe. The server replays the compile.done event with a freshly generated presigned URL:

{
"type": "jobs.subscribe",
"job_id": "job_xyz789"
}

The response headers include the binary’s SHA-256 and MD5:

HeaderValue
x-amz-checksum-sha256Base64-encoded SHA-256 of the binary
Content-MD5Base64-encoded MD5 of the binary

Verify the SHA-256 after download:

Terminal window
EXPECTED=$(curl -sI "$DOWNLOAD_URL" | grep -i x-amz-checksum-sha256 | awk '{print $2}' | tr -d '\r' | base64 -d | xxd -p -c 256)
ACTUAL=$(sha256sum myapp | awk '{print $1}')
[ "$EXPECTED" = "$ACTUAL" ] && echo "ok" || echo "checksum mismatch"

The compile.done message also includes the SHA-256 (hex-encoded) in the job record accessible via the REST API.

Compiled binaries are retained on Pure’s storage for 30 days after the job finishes. After that, the presigned URL and the binary itself are deleted. Download and store binaries you intend to keep before the retention window closes.

You can also fetch job metadata and a fresh download URL via HTTP without a WebSocket connection:

GET https://api.pure.dev/jobs/<job_id>
Authorization: Bearer pk_live_...

This returns the job record including current status, work_units, and a presigned download URL for succeeded jobs.