AgencyPilotHQ | REST API, Signed Webhooks & Stripe in Next.js by Raja SheryarAgencyPilotHQ | REST API, Signed Webhooks & Stripe in Next.js by Raja Sheryar

AgencyPilotHQ | REST API, Signed Webhooks & Stripe in Next.js

Raja Sheryar

Raja Sheryar

Overview

AgencyPilotHQ is my own SaaS for web agencies: AI tools, CRM, projects, contracts and invoices in one workspace. This case study covers the integration layer: a public REST API, signed webhooks and Stripe billing.

Public REST API (v1)

Read-only endpoints for clients and projects, with an OpenAPI 3.0 spec
API keys scoped to one agency workspace, revocable at any time
60 requests per minute per key, with X-RateLimit headers and 429 + Retry-After
A live Try it console on the docs page

Webhooks

Events: INVOICE_PAID, CONTRACT_SIGNED, DEAL_WON, AI_GENERATION_COMPLETED
Every POST is signed with HMAC-SHA256 in an X-AgencyPilot-Signature header
Failed deliveries retry up to 3 times and show in a delivery log

Billing and AI

Stripe Checkout, billing portal and webhooks for monthly and yearly plans
OpenAI, Claude and Gemini APIs behind the 15 AI tools

Stack

Next.js, TypeScript, PostgreSQL + Prisma, Supabase Auth, Stripe, Resend, OpenAI and Claude APIs, Vercel
Like this project

Posted Oct 22, 2026

My own agency SaaS: a read-only REST API with rate limits and OpenAPI spec, HMAC-signed webhooks with retries, and Stripe billing. Next.js + Postgres.