PureStamp API Quickstart

Issue and verify cryptographic provenance for AI and human content with PureStamp’s REST API. Get started with copy-paste examples in cURL, JavaScript, and Python.

Base URL
https://<REST_API_ID>.execute-api.<REGION>.amazonaws.com/<STAGE>

Authenticate with your x-api-key header. Get your key.

Overview

PureStamp’s API secures your content with tamper-evident provenance. Follow these steps: ① Get a pre-signed S3 upload URL, ② Upload your file, ③ Issue or verify a stamp.

POST /upload-url

Generate a pre-signed URL for secure S3 uploads.

POST /purestamp/issue

Add a cryptographic stamp to your file, returning a watermarked URL.

POST /purestamp/verify

Validate provenance and signature for any file or text.

API Endpoints

POST /upload-url
Auth: x-api-key

Request: { "filename": string, "contentType": string }
Response: { "uploadUrl": string, "s3Uri": string, "contentType": string }

curl -X POST "$BASE/upload-url" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename":"sample.pdf","contentType":"application/pdf"}'
POST /purestamp/issue
Auth: x-api-key

Request: { "s3_uri": string, "mime_type": string, "who": "Human | AI | Unknown", "model"?: string }
Response: { "download_url": string, "receipt_id": string }

curl -X POST "$BASE/purestamp/issue" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "s3_uri": "s3://bucket/key.pdf",
    "mime_type": "application/pdf",
    "who": "AI",
    "model": "PureVector"
  }'
POST /purestamp/verify
Auth: x-api-key

Request: { "s3_uri": string, "mime_type": string }
Response: { "status": "trusted | untrusted", "who": string, "model"?: string, "signature_valid": boolean, "receipt_id"?: string }

curl -X POST "$BASE/purestamp/verify" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "s3_uri": "s3://bucket/key.pdf",
    "mime_type": "application/pdf"
  }'

Code Examples

Try these examples with your API credentials. Update the hero inputs to customize.

export BASE="https://qer7w7y40c.execute-api.us-east-1.amazonaws.com/prod"
export API_KEY="<YOUR_API_KEY>"

# Get pre-signed URL
curl -X POST "$BASE/upload-url" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename":"file.pdf","contentType":"application/pdf"}'

# Upload file (use uploadUrl from response)
# curl -X PUT "" -H "Content-Type: application/pdf" --data-binary @file.pdf

# Issue stamp
curl -X POST "$BASE/purestamp/issue" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"s3_uri":"s3://bucket/key.pdf","mime_type":"application/pdf","who":"AI","model":"PureVector"}'

# Verify content
curl -X POST "$BASE/purestamp/verify" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"s3_uri":"s3://bucket/key.pdf","mime_type":"application/pdf"}'

Tip: Enter your API credentials in the hero section to customize examples. Try the demo UI.

Status Codes & Errors

Common Errors

  • 400 Bad Request: Missing or invalid input (e.g., no s3_uri, unsupported mime_type)
  • 401 Unauthorized: Invalid or missing x-api-key
  • 403 Forbidden: API key lacks permission or plan limit exceeded
  • 429 Too Many Requests: Rate limit hit; retry with exponential backoff
  • 5xx Server Error: Transient issue; retry with exponential backoff

CORS Configuration

Endpoints support permissive CORS with Access-Control-Allow-* headers for browser compatibility. For custom setups, ensure OPTIONS responses include these headers.

Start Building with PureStamp

Secure your AI and human content with our API. Sign up for a free API key or explore the demo UI.