ACE AI Startup BootcampDay 4: API Design and Interface Specification
← Back to LMS Classroom
DAY 4 TEXTBOOKACE Startup SW/AI Pilot
ACE AI Startup Bootcamp Textbook Series 04

API Design and Interface Specification

A self-study textbook covering essential theory, comparative examples, guided practice, quality review, and a capstone exercise. Central question: How do independent systems communicate through a contract without misunderstanding?

ACE AI Startup Bootcamp | Day 4Study Guide
HOW TO STUDY

Learning Goals and Study Routine

How do independent systems communicate through a contract without misunderstanding? You complete today’s lesson when you can answer this question in your own words, produce the required artifact, and review its quality.

Theory: 60 minPractice: 90 minReview: 30 min
01

Design resource-oriented URLs.

02

Select appropriate HTTP methods and status codes.

03

Distinguish safety from idempotency.

04

Specify request, response, and error schemas.

05

Explain the boundary between authentication and authorization.

06

Design versioning, pagination, and compatibility policies.

Recommended self-study routine

  1. Explain why a problem occurs before memorizing its terminology.
  2. Describe the difference between good and poor examples using observable criteria.
  3. Attempt the capstone before opening the model answer.
  4. Mark missing conditions in a second color and revise your artifact.
ACE AI Startup Bootcamp | Day 4Table of Contents
CONTENTS

Table of Contents

Completion standard

Submit the capstone artifact, score at least 80/100 on the self-review, and write your own answers to the four concept questions.

ACE AI Startup Bootcamp | Day 4Chapter 1 · Core Theory
CHAPTER 01

Core Theory: API Design and Interface Specification

Each technical term exists to solve a recurring design problem. Study when and why the concept is needed, not merely its definition.

Core conceptWorking definition
ResourceA business object identified and manipulated through the API.
HTTP MethodThe intent to read, create, replace, partially update, or delete.
Status CodeA machine-readable and human-readable processing outcome.
IdempotencyThe property that repeated execution produces the same final state.
SchemaA definition of fields, types, required values, and constraints.
AuthorizationThe decision that an authenticated principal may access a resource.

Poor and Effective Approaches

Avoid

Put creation, lookup, and cancellation behind one POST /doReservation endpoint.

Prefer

Use POST /reservations to create, GET /reservations/{id} to retrieve, and a clear cancellation resource or state transition.

Design formula

[HTTP Method] [Resource URL] + [Authentication] + [Request Schema] → [Status] + [Response/Error Schema]

ACE AI Startup Bootcamp | Day 4Chapter 2 · Guided Practice
CHAPTER 02

A Six-Step Design Workflow

1

Define the problem

Translate use cases into resources and state changes.

2

Extract the structure

Use nouns and resource hierarchy for URLs.

3

Design the core flow

Assign methods and specific success and failure status codes.

4

Add failure conditions

Define types, required fields, ranges, and examples.

5

Connect policies

Add ownership and role-based authorization rules.

6

Verify and trace

Review retries, idempotency keys, pagination, and version policy.

Worked Example

API contract example
POST /v1/reservations Idempotency-Key: 8db1... Authorization: Bearer <token> { "seatId": 12, "startsAt": "2026-08-20T10:00:00+09:00" } 201 Created { "id": "r_1024", "status": "PENDING_PAYMENT" } 409 Conflict { "code": "SEAT_ALREADY_RESERVED", "message": "The selected seat is no longer available." }

Questions for reading the example

  • Are the input and initiating condition explicit?
  • Are success and failure outcomes observable?
  • Are duplication, authorization, concurrency, and dependency failure covered as needed?
  • Can the result be traced back to a requirement?
ACE AI Startup Bootcamp | Day 4Chapter 3 · Review
CHAPTER 03

Concept Check and Quality Review

CONCEPT CHECK
  1. How do PUT and PATCH differ?
  2. When should an API return 401 versus 403?
  3. Why must errors not expose an internal stack trace?
  4. What are the tradeoffs of URL-based API versions?

Answer each in two or three sentences and add one example that supports your explanation.

Self-Assessment · 100 points

AreaStandardPoints
AccuracyConcepts and technical choices match the facts and requirements.25
CompletenessNormal flow, boundaries, failures, and recovery are covered.25
ConsistencyTerms, IDs, states, and interfaces agree across artifacts.20
VerifiabilityObservable outcomes and completion criteria are present.20
ReasoningThe choice and its tradeoffs can be explained clearly.10
If your score is below 80

Do not only correct the result. Record which question you failed to ask so your next design process prevents the same omission.

ACE AI Startup Bootcamp | Day 4Chapter 4 · Capstone
CHAPTER 04

Capstone Exercise and Model Answer

SUBMISSION

Design APIs to create, retrieve, and cancel an order. Include duplicate-order prevention and protection against reading another user’s order.

  1. List assumptions and unresolved decisions first.
  2. Produce the main design as a table, diagram, or code block.
  3. Include the normal flow and at least three failures or boundaries.
  4. Score it with the rubric and compare before and after revision.
Open the model answer

POST /orders should accept an Idempotency-Key and return 201. GET /orders/{id} must allow only the owner or an administrator. Cancellation can be modeled as POST /orders/{id}/cancellations; return 409 when shipment has already started.

How to use the answer

The model is not the only valid design. If yours differs, explain the requirement, cost, complexity, or risk that justifies your choice.

ACE AI Startup Bootcamp | Day 4Lesson Review
REVIEW

Glossary and Final Checklist

TermPlain-English meaning
Safe MethodA method not intended to change server state.
IdempotentA repeated call whose final state remains the same.
PaginationDividing a large collection into pages.
Rate LimitA policy that restricts request volume over time.
OpenAPIA standard for describing HTTP API contracts.
Backward CompatibilityAvoiding changes that break existing clients.

Eight checks before submission

  1. Can you answer today’s central question in your own words?
  2. Are inputs, conditions, and results explicit?
  3. Did you include failures and recovery, not only the happy path?
  4. Did you review concurrency, duplicate requests, and permissions?
  5. Did you account for dependency failure and timeouts?
  6. Can you explain the disadvantages and alternatives to your choice?
  7. Are terminology and states consistent across artifacts?
  8. Is there an observable or testable completion standard?
Day 4 in one question

How do independent systems communicate through a contract without misunderstanding? Answer it now using evidence from the artifact you created.

ACE AI Startup Bootcamp | Day 4Self-study reference
SELF-STUDY 01

Key Terms in Context

Learn each term as a decision tool. Read across each row: definition, reason to use it, and the failure it prevents.

TermPlain definitionWhy it mattersExample or caution
ResourceA business object identified and manipulated through the API.It keeps URLs noun-oriented and predictable.Use a consistent path such as `/orders/{id}`.
HTTP methodThe verb that communicates read, create, replace, update, or delete intent.It gives clients and servers a shared contract.Do not mix the meanings of GET, POST, PUT, PATCH, and DELETE.
Status codeA numeric, machine-readable outcome of a request.It separates success, client errors, and server errors.Do not return 500 for ordinary validation failure.
Request/response schemaThe fields, types, requirements, and constraints of a payload.It is the frontend-backend contract.Specify ranges and nullability, not only an example.
PaginationA rule for retrieving a large collection in smaller parts.It controls payload size and latency.Offset and cursor approaches have different ordering guarantees.
VersioningA policy for separating incompatible API changes.It protects existing clients from sudden failure.Announce deprecation and provide a migration window.
Practice scenario

A mobile app lists, creates, and cancels orders while handling stockouts, expired authentication, and duplicate submissions.

ACE AI Startup Bootcamp | Day 4Guided practice
SELF-STUDY 02

Guided Practice and Troubleshooting

Practice scenario

A mobile app lists, creates, and cancels orders while handling stockouts, expired authentication, and duplicate submissions.

Complete in order

  1. Translate each user action into a resource and HTTP method.
  2. Specify inputs, success responses, and error responses for every endpoint.
  3. Define authentication, authorization, validation, and idempotency.
  4. Compare OpenAPI examples with real server responses in contract tests.
Required evidence

Save one artifact, three assumptions, and at least three failure cases. A classmate should be able to reproduce your reasoning without asking what you meant.

If the result is wrong, diagnose it

Observed symptomLikely causeNext action
Frontend misreads a fieldType or nullability is unspecifiedProvide a schema and representative examples
Retry creates duplicate ordersPOST has no idempotency policySupport an Idempotency-Key
Every screen handles errors differentlyNo error code standardStandardize code, message, and details
ACE AI Startup Bootcamp | Day 4Retrieval practice
SELF-STUDY 03

Check Your Understanding

Retrieval check — answer before opening

How do PUT and PATCH differ?

PUT usually replaces a full representation; PATCH changes selected fields.

How do 401 and 403 differ?

401 means authentication is required or failed; 403 means the authenticated caller lacks permission.

When is an API spec complete?

Independent teams can implement and verify success and failure cases without guessing.

Teach it back in two minutes

Explain the day's main decision, one failure mode, and one verification method without reading the page. If you cannot connect all three, return to the row or diagnostic case you missed.