Public API contracts & reusable backend integration

Campaign, Budget & Reach APIs

Reusable PAPI endpoints that brought established campaign and budget rules into the redesigned platform.

Business problem

The challenge

New product surfaces needed reliable API contracts for flights, budget previews, spend and audience reach.

Technical solution

Our approach

Typed PAPI controllers and services forwarding authorization and business validation to GaryQL.

  1. 01

    Expose flight and spend data

    Added authorized flight listing with filtering, sorting and pagination, campaign spend windows and reach calculations.

  2. 02

    Support the budget wizard

    Built the flight-change endpoint, forwarding GaryQL rules and mapping preview, saved, action-required and field-invalid outcomes. Preserved mid-month monthly-budget behavior.

  3. 03

    Keep list requests efficient

    Made audience/creative ID expansion opt-in, excluded irrelevant ended-before-launch budgets and added campaign-mode support for Express/Nova consolidation.

Results & impact

Project outcomes

Reusable PAPI endpoints that brought established campaign and budget rules into the redesigned platform.

Shared

Budget validation

New interfaces consume the existing business rules through explicit API outcomes.

Lean lists

Less per-row data fetching

Related audience and creative IDs are expanded when requested.

Visual assets

How the workflow fits together

Campaign, Budget & Reach APIs

flowchart TD
  A["Nova and Express"] --> B["PAPI contract"]
  B --> C["Authorization and request mapping"]
  C --> D["GaryQL rules"]
  D --> E["Typed outcomes"]
01 Typed PAPI controllers and services forwarding authorization and business validation to GaryQL.

Tech stack

Technology and ownership.

Implemented campaign, flight-change, spend and reach API contributions and their validation/contract coverage.

TypeScriptNestJSRESTOpenAPIGraphQLZodContract tests