--- import Hero from "@/components/blocks/hero-1.astro"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icon"; import { Section, SectionContent, SectionGrid, SectionProse } from "@/components/ui/section"; import { Tile, TileContent, TileDescription, TileTitle } from "@/components/ui/tile"; import BaseLayout from "@/layouts/BaseLayout.astro"; ---

API

Upload a file. Get a receipt.

This is the practical page. Copy/paste the examples, run a real request, and share the receipt URL with a reviewer.

Quickstart

Three steps.

1) Login. 2) Create an API key. 3) Upload a file to /api/v1/traces.

1) Console Login and create an API key for your organization.
2) Upload POST a file to /api/v1/traces.
curl -fsS -X POST \\
  -H 'X-API-Key: <your_key>' \\
  -F 'file=@./document.pdf' \\
  -F 'expected_sha256=<optional_expected_sha256>' \\
  https://infrafabric.io/api/v1/traces
3) Share Send the receipt URL to the reviewer. No login required.
# Response includes:
receipt_url: https://infrafabric.io/api/v1/public/receipt/<public_id>

Live test

Try an upload right now.

Paste your API key, pick a file, optionally provide an expected SHA‑256, and run the call.

API key
File
Expected SHA‑256 (optional)

This endpoint returns verified only if you provide expected_sha256. Otherwise it returns the computed hash.

Result
{"{}"}

Examples

Copy/paste for common platforms.

Python (requests)
import requests

API_KEY = "iftr_..."
with open("document.pdf", "rb") as f:
    res = requests.post(
        "https://infrafabric.io/api/v1/traces",
        headers={"X-API-Key": API_KEY},
        files={"file": ("document.pdf", f, "application/pdf")},
        data={"expected_sha256": ""},  # optional
        timeout=60,
    )
print(res.status_code)
print(res.json())
Node.js (fetch)
import fs from "node:fs";

const apiKey = "iftr_...";
const fd = new FormData();
fd.append("file", new Blob([fs.readFileSync("document.pdf")]), "document.pdf");
// fd.append("expected_sha256", ""); // optional

const res = await fetch("https://infrafabric.io/api/v1/traces", {
  method: "POST",
  headers: { "X-API-Key": apiKey },
  body: fd,
});
console.log(res.status);
console.log(await res.json());

Meaning

Integrity, not interpretation.

“Verified” means the computed hash matched an expected hash you provided. It does not mean “true”, “compliant”, or “approved”.