Skip to content
Join Now Login

cURL Guide

This guide shows how to upload test reports to Gaffer using cURL from the command line. This is useful for quick uploads, debugging, or integrating with custom CI/CD systems.

  • A Gaffer account with a project
  • Your project’s upload token
  • cURL installed (available by default on macOS and most Linux distributions)

The simplest upload with just a file:

curl
curl -X POST https://app.gaffer.sh/api/upload \
-H "X-API-Key: YOUR_UPLOAD_TOKEN" \
-F "files=@path/to/test-report.html"

Replace YOUR_UPLOAD_TOKEN with your actual upload token, and update the file path to point to your test report.

Add metadata tags to help organize your test runs. We strongly recommend including commitSha and branch:

curl
curl -X POST https://app.gaffer.sh/api/upload \
-H "X-API-Key: YOUR_UPLOAD_TOKEN" \
-F "files=@playwright-report/index.html" \
-F 'tags={"commitSha":"abc123def456","branch":"main","test_framework":"playwright","test_suite":"e2e"}'

Upload multiple files by repeating the -F "files=..." flag:

curl
curl -X POST https://app.gaffer.sh/api/upload \
-H "X-API-Key: YOUR_UPLOAD_TOKEN" \
-F "files=@playwright-report/index.html" \
-F "files=@playwright-report/data/report.json" \
-F "files=@playwright-report/screenshots/failed-test.png" \
-F 'tags={"commitSha":"abc123","branch":"feature/login"}'

You can use shell command substitution to automatically include git information:

curl
curl -X POST https://app.gaffer.sh/api/upload \
-H "X-API-Key: YOUR_UPLOAD_TOKEN" \
-F "files=@test-results/junit.xml" \
-F 'tags={"commitSha":"'"$(git rev-parse HEAD)"'","branch":"'"$(git branch --show-current)"'"}'

Check that your upload token is correct and properly formatted. The token should start with gfr_.

Ensure you’re using -F "files=@..." with the @ symbol before the file path. The @ tells cURL to read the file contents rather than using the path as a string value.

Individual files are limited to 50 MB, and total upload size is limited to 100 MB.