AutoViz Shortlink Service

URL shortlink management with Cloudflare KV storage

Endpoints

POST /create Auth Required

Create a new shortlink

curl -X POST https://shortlink.autoviz.io/create \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path": "/s/abc123", "value": "https://example.com/target"}'

Response:

{"success": true, "path": "/s/abc123", "value": "https://example.com/target"}
GET /?path={path}

Get shortlink data as JSON

curl "https://shortlink.autoviz.io/?path=/s/abc123"

Response:

{"path": "/s/abc123", "value": "https://example.com/target"}
GET /{any-path}

Redirect to target URL if shortlink exists

GET https://shortlink.autoviz.io/s/abc123
--> 302 Redirect to https://example.com/target
GET /health

Health check endpoint

curl https://shortlink.autoviz.io/health

Response:

{"status": "healthy", "environment": "production", "timestamp": "..."}

Path Flexibility

Shortlinks can use any path structure:

PatternExample
Short codes/s/abc123, /x/promo2024
Hierarchical/wheels/brand/model
Simple/abc123

Authentication

The /create endpoint requires an Authorization header:

Authorization: Bearer YOUR_API_TOKEN

Powered by Cloudflare Workers