Platform / Field guide

Product API & machine-readable schema

Give customers a documented way to use the product beyond its screens.

One contract, two API styles

PUBLISHED MACHINE-READABLE CONTRACTopenapi.yamlpaths:/reports:get:operationId: listList reportsCustomer-scoped requestTyped resultKnown shape + errorsThe service still checks who may access each report

An OpenAPI document describes stable HTTP operations, typed inputs, results, and errors.

01 / CONTEXT

Why it matters

A product API turns the actions customers can take in your UI into a dependable integration surface. A machine-readable contract makes those actions discoverable to developers, generated clients, CLIs, and AI tools. The contract is a map of what the product can do; it does not replace authorization or good workflow design.

REST with OpenAPI and GraphQL with a documented schema are both workable choices. What matters is that meaningful customer operations have stable names, typed inputs and outputs, clear errors, and a versioning story. Keep the contract aligned with the behavior people actually see in the product.

02 / DESIGN

Decisions to make

  • Choose REST, GraphQL, or a deliberate mix based on customer workflows and the way clients will use them.
  • Decide which customer-visible actions and data must have programmatic parity with the UI.
  • Define resource identity, tenant scope, pagination, filtering, and asynchronous job behavior.
  • Describe request, response, and error shapes, including examples and the meaning of each field.
  • Choose user-delegated authorization, scoped API keys, or both for different clients.
  • Set compatibility, deprecation, and change-review rules for the published contract.
03 / IMPLEMENTATION

Build checklist

  • Publish the OpenAPI document or GraphQL schema alongside task-oriented API documentation.
  • Give each operation a stable name, useful description, typed inputs, and a predictable result.
  • Enforce the same tenant and permission checks used by the product UI on every request.
  • Add pagination, idempotency, and asynchronous status where customer workflows need them.
  • Test examples and generated clients against a running API so the contract cannot silently drift.
  • Track UI workflows without an API path and either close the gap or explain the intentional exception.
04 / WATCH FOR

Common mistakes

  • Publishing a schema that documents endpoints but omits the customer tasks people need to finish.
  • Treating a typed request as proof that its caller is authorized for the selected tenant.
  • Changing fields or errors without a compatibility plan for existing integrations.
05 / GO DEEPER

Tools & references

3 starting points to compare or study. Check fit, maintenance, terms and current capabilities before choosing one.

BUILDING THIS NOW?

Explore the SaaSLayer approach.

See the services and developer guides behind our AWS backed SaaS building blocks.

Read SaaSLayer docs
NEXT FEATUREProduct CLI & scriptable workflows