SPIN THE BLOC

EXPLAINER / BUILD

An API Is a Contract, Not Magic Plumbing

A plain-language guide to the five API contract questions that determine whether an AI workflow can work reliably.

Short answer

An API is a defined way for one piece of software to ask another piece of software for information or an action. An AI workflow is reliable only when the request, response, data shape, authentication, and failure behavior are understood. If a proposal cannot explain those five parts in plain language, the integration is not ready to trust.

The useful part of the "AI agent" is often a contract

A demo says the agent can check a calendar, create a ticket, update a customer record, or send a message. The screen makes the action look immediate. Underneath, one system has to make a specific request to another system and interpret what comes back.

That exchange is often an API call.

MDN describes HTTP as a client-server protocol: a client sends a request, and a server returns a response. The OpenAPI Specification provides a standard way to describe HTTP APIs so people and tools can understand available operations without inspecting the underlying code.

That is less mysterious than "agent magic," but it is more useful. Contracts can be inspected. They can also fail in recognizable ways.

Five questions reveal the real integration

1. What request can the system make?

The request is the exact thing one system asks another system to do.

"Check the calendar" is not precise enough. The actual request may need a calendar identifier, a start time, an end time, a time zone, and the number of results to return. "Create a customer" may require a name, an email address, a consent flag, and a source.

Ask which operations the API supports. Read-only operations carry different risk from actions that create, change, send, charge, or delete.

A workflow can only do what the receiving system exposes. If the software does not provide an operation for the desired action, a language model cannot talk it into existence.

2. What response comes back?

A successful request should return a defined response. That might be a customer record, a list of open appointment times, a ticket identifier, or a status code confirming that the action was accepted.

The workflow needs to know which response means success. It also needs to know whether "accepted" means completed or merely queued for later work.

This distinction matters when the next step depends on the result. If a system returns a request identifier but the workflow treats it as a completed booking, the customer may receive a confirmation for something that never finished.

3. What shape does the data use?

The schema is the expected structure of the request and response data.

A date might need to be written as 2026-07-27, a timestamp, or a time with a named zone. A phone number might be one text field or a country code plus a local number. A price might be decimal dollars or an integer number of cents.

Small mismatches create large operating problems. The field can be present and still mean the wrong thing.

Before a build, identify required fields, optional fields, allowed values, length limits, and any fields the business must never invent. If the AI extracts information from an email or call, define what happens when a required value is missing. A blank marked for review is safer than a confident guess.

4. How is access authenticated?

Authentication proves which person or system is making the request. Authorization determines what that identity may do.

The practical question is not simply whether the integration has an API key. Ask what that credential can access, where it is stored, how it is rotated, and whether the permissions can be narrowed to the job.

A workflow that reads appointment availability should not automatically receive permission to export every customer or change billing information. Separate credentials and narrow scopes reduce the damage from a mistake or compromise.

The business also needs an owner for credential changes. Tokens expire. Employees leave. Vendors change authentication methods. An integration without credential ownership can stop working long after the original builder has moved on.

5. What happens when the contract fails?

APIs reject requests. They time out. They return rate-limit responses. A vendor may change a field or remove an older version.

A reliable workflow defines what happens next. It may retry a temporary failure, send the item to a review queue, preserve the original request, or stop before taking another action. It should not hide the error and continue as if the step succeeded.

Ask where failures are recorded, who is alerted, and how an operator can replay or complete the work safely. A retry should avoid creating duplicates. If the first request created a record but the response was lost, a blind second request could create the same customer or ticket twice.

A plain-language contract review

You do not need to become a developer to review an integration proposal. Ask the builder to walk through one real example from beginning to end.

Use a customer-intake workflow as the example:

  1. Which event starts the request?
  2. Which customer fields are sent?
  3. Which system receives them?
  4. Which permission allows the action?
  5. What response confirms success?
  6. Where can an operator see that confirmation?
  7. What happens if a field is missing or the request fails?
  8. How does the process avoid duplicates?

The answers should refer to named systems, fields, permissions, and records. "The AI handles it" is not an answer.

The demo can work while the operating contract is weak

A demo usually follows the happy path. The credentials are active, the fields are complete, the service is available, and the example fits the expected schema.

Normal operations create different cases: two customers with the same name, an expired token, a date without a time zone, a vendor timeout, an unexpected field, or a person who withdraws consent. The contract review is where these cases become visible before customers depend on the workflow.

This does not mean every small automation needs a long specification. The depth should match the consequence. A private draft helper needs less ceremony than a workflow that changes a customer record or sends a confirmed appointment.

The five questions stay the same. The amount of proof changes.

Sources and limits

MDN's overview of HTTP supports the request-response description used in this guide. The OpenAPI Specification supports the claim that HTTP API capabilities and structures can be described in a standard, machine-readable form.

Those sources describe protocols and specifications. They do not certify a particular vendor integration. The five-question review is SpinTheBloc's operating interpretation for business buyers. A real review still requires the documentation, permissions, error behavior, and data rules of the systems being connected.

A PRACTICAL NEXT STEP

Map the contract before the build

Use the article as context, then choose the smallest next move that can produce evidence.

Map the contract before the build