All use cases
Marketing teams & developers

URL Redirect Table Managed in Google Sheets

Manage a table of URL redirects in Google Sheets and power a link shortener or redirect service with SheetsAPI.


A redirect table your whole team can edit

Link shorteners and vanity URL systems usually need a database and a small service to manage. If you just need a table of slugs that map to destinations — go/pricinghttps://company.com/pricing — a Google Sheet backed by GKit SheetsAPI is all the infrastructure you need.

Sheet structure

Create a sheet named Redirects with these columns:

slugdestinationactive
go/pricinghttps://company.com/pricingtrue
go/demohttps://cal.com/team/demotrue
go/old-bloghttps://company.com/blogfalse

The active column lets you disable a redirect without deleting the row — useful when a campaign ends and you want to keep a record.

The API call

An edge function (Vercel, Cloudflare Workers, Next.js middleware) intercepts the incoming request, looks up the slug, and issues a 301 redirect:

// middleware.js (Next.js) or a Cloudflare Worker
export async function middleware(request) {
  const slug = request.nextUrl.pathname.replace("/go/", "go/");
 
  const res = await fetch(
    `https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{userKey}/Redirects` +
    `?search_exact=1&search=slug:${slug}&search=active:true`
  );
  const { data } = await res.json();
 
  if (data.length > 0) {
    return Response.redirect(data[0].destination, 301);
  }
  return new Response("Not found", { status: 404 });
}

search_exact=1 tells SheetsAPI to match the slug precisely rather than doing a substring search — critical so go/price doesn't accidentally match go/pricing.

Curl equivalent

curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{userKey}/Redirects?search_exact=1&search=slug:go/pricing&search=active:true"

Workflow for non-technical teammates

Marketing wants to add a campaign link before a product launch:

  1. Open the Sheet.
  2. Add a row: go/launch-event, destination URL, true.
  3. Done — the redirect is live within seconds.

No pull request. No deployment. No Slack message to engineering. The Sheet is the admin panel.

When a campaign ends, they set active to false. The edge function stops matching it and falls through to a 404 (or a custom fallback page).

Caching considerations

Because the destination can change at any time, keep your edge function's cache TTL short — 60 seconds is a reasonable default for most redirect use cases. For high-traffic slugs, a CDN cache with a short stale-while-revalidate header gives you speed without sacrificing freshness.

Why this works

A redirect table is fundamentally a two-column lookup. There's no reason that lookup needs a dedicated database. Sheets handles concurrent reads comfortably at the scale most teams need, SheetsAPI surfaces the data as JSON, and an edge function does the actual redirect. The result is a link management system your whole team can operate — no engineering involvement required for day-to-day changes.

Connect your redirects Sheet and ship it today.