Prod Squad

APIs for PMs: REST, status codes, auth, rate limits, webhooks

The API concepts PMs use every week, from requests and status codes to auth, rate limits and webhooks, and how to explain them simply.

6 min readAll levels#apis#rest#status codes#oauth
Ask about this lesson
On this page

APIs are how software talks to software. Your app calls your own backend through APIs, your product integrates with Stripe, Slack or Google through APIs, and platform products are APIs. PMs who understand them write better specs, scope integrations realistically, and debug faster with engineers.

Why interviewers ask this

"Explain an API to a non-technical stakeholder" and "How would you design the API for this feature?" are common in technical PM loops. Interviewers check your vocabulary (endpoints, methods, status codes), your grasp of tradeoffs (auth, rate limits, versioning, webhooks vs polling), and whether you can translate it into plain English.

The framework

1. Request and response

An API is a menu of requests a system accepts. In a REST API, you act on resources with HTTP methods:

Method Meaning Example
GET Read GET /orders/42
POST Create POST /orders
PUT / PATCH Update PATCH /orders/42
DELETE Remove DELETE /orders/42

Requests carry headers (who's asking) and often a JSON body. Responses carry a status code and a JSON body.

2. Status codes worth knowing

  • 200 OK / 201 Created: success.
  • 400 Bad Request: the request was invalid (a missing field).
  • 401 Unauthorized: not authenticated. 403 Forbidden: authenticated, but not allowed.
  • 404 Not Found. 429 Too Many Requests: rate limited.
  • 500 / 503: the server failed or is unavailable. Rule of thumb: 4xx means the caller did something wrong, 5xx means the server did.

3. Authentication

  • API keys: a secret that identifies the calling app. Simple; must stay on servers, never in mobile or browser code.
  • OAuth: lets a user grant your app limited access to their account elsewhere ("Connect your Google Calendar") without sharing their password. Access is limited by scopes (read calendar, not send email).

4. Rate limits

Providers cap requests per minute or day to protect their systems. Your product must handle 429s gracefully: retry with backoff, queue work, or cache results.

5. Webhooks vs polling

sequenceDiagram
    participant A as Your app
    participant P as Payment provider
    Note over A,P: Polling
    A->>P: Is payment 42 done?
    P-->>A: Not yet
    A->>P: Is payment 42 done?
    P-->>A: Yes
    Note over A,P: Webhook
    P->>A: POST /webhooks/payments - payment 42 succeeded
    A-->>P: 200 OK

Polling asks repeatedly; it's simple but wasteful and slow to notice changes. Webhooks push an event to your endpoint when something happens; they're efficient and fast, but you must verify the sender, handle duplicates, and cope with missed deliveries.

6. Versioning

Once others depend on your API, breaking changes hurt them. Version it (/v1/, /v2/) and give deprecation notice.

Worked example

Question: "Explain an API to a non-technical stakeholder, then tell me what you'd consider when integrating our app with a calendar provider."

Sample answer:

"The simple explanation: an API is like a restaurant menu and a waiter. The menu lists what you can order. You don't go into the kitchen; you tell the waiter, and they bring back exactly what you asked for, or tell you it's unavailable. Our app 'orders' data from other systems the same way.

The calendar integration, as a PM:

  1. User value and scope: read availability only, or also create events? Fewer permissions mean less friction at the consent screen and less risk.
  2. Auth: OAuth, with the narrowest scopes. We'd explain on the consent screen why we need access, because trust drives the connection rate.
  3. Keeping data fresh: use the provider's webhooks to hear about changes rather than polling every user's calendar, which would hit rate limits fast as we grow.
  4. Failure modes: tokens expire or users revoke access, so we need a clear 'Reconnect your calendar' state. If the provider's API is down, show cached data with a 'last updated' note.
  5. Rate limits and cost: check the quotas against our expected user numbers before committing to the design.
  6. Metrics: connection success rate, sync errors, and the share of users who stay connected after 30 days."

Common mistakes

  • Putting API keys in a mobile app or front end.
  • Asking for broad OAuth scopes "just in case", which hurts conversion and trust.
  • Ignoring rate limits until launch day.
  • Polling at scale when webhooks exist.
  • Breaking API changes without versioning or notice.

Interviewer tips

What "great" sounds like:

  • "4xx means the caller made a mistake, 5xx means we did. Both need different handling in the UX."
  • "I'd request the narrowest scope, because every extra permission lowers the connection rate."
  • "Webhooks for freshness, with a periodic reconciliation job in case one is missed."
  • "Let's check the provider's rate limits against our growth before we commit."
  • A crisp analogy for non-technical audiences, then the real detail.

Practice questions

Answer one in a mock interview and get graded instantly.

  1. 1.Explain an API to a non-technical stakeholder.

    Practice this →
  2. 2.When would you use webhooks instead of polling, and what can go wrong with each?

    Practice this →
  3. 3.Our integration partner keeps returning 429 errors at peak times. What do you do?

    Practice this →

Finished reading?