API Design And Evolution
Design an interface as a durable agreement with its consumers, not a route list.
Start with the consumer job, domain meaning, authority boundary, and failure modes;
then choose the interface style and contract format. Keep facts, assumptions, and
policy decisions distinguishable.
When to use
Use for a new or changed REST/HTTP API, GraphQL schema, RPC operation, event or
message contract, webhook, or streaming interface. Use it before implementation and
again whenever consumer-visible behavior changes.
When not to use
Do not use this as an ADR template, a complete product-discovery method, a security
assessment, or an implementation test plan. Hand those concerns to
adr-authoring,
product-discovery,
secure-software-engineering, and
verification-methodology, respectively.
Workflow
- Discover the agreement. State consumer jobs, domain terms and invariants,
authoritative data and schema owners, actors, object/action authority boundaries,
data sensitivity, and failure modes. Record unanswered questions rather than
inventing policy. Start templates/api-design-brief.md.
- Choose the interface shape. Compare interaction direction, coupling,
delivery needs, query flexibility, mutation semantics, caching, observability,
and evolution surface. Read references/interface-selection.md.
Record the choice and rejected options in the brief; use an ADR only when the
choice is consequential beyond this interface.
- Make the contract explicit. Define representations and their semantics,
including null versus absent, defaults, enums/unions, identifiers, timestamps,
units, ordering, filtering, and pagination. Use
templates/endpoint-contract.md with
references/contract-semantics.md.
- Design mutation and failure behavior. Define authority checks, preconditions,
idempotency scope and equivalence, retries, concurrency, partial outcomes,
long-running operation state, errors, and resource limits. Read
references/operations-and-failures.md
and create templates/error-taxonomy.md when
errors are shared across operations.
- Describe asynchronous delivery where relevant. For messages, webhooks, or
streams, state the publisher/subscriber perspective, envelope, delivery contract,
duplicate/gap/reordering behavior, ordering scope, and security boundary. Read
references/events-webhooks-streaming.md.
- Assess change from each consumer's perspective. Inventory consumers,
generated clients, strict decoders, signatures, caches, quotas, and operational
dependencies. Complete templates/compatibility-change-assessment.md.
Do not call a change safe solely because it is additive.
- Plan and verify rollout. For a deprecation or migration, use
templates/deprecation-migration-plan.md
and references/evolution-and-deprecation.md.
Review the contract using templates/contract-review.md.
Test provider conformance, consumer expectations, compatibility diffs, examples,
negative cases, and the deployed boundary. Load
release-engineering for release sequencing,
artifact promotion, progressive exposure, and coordinated rollback after the
compatibility policy is defined.
Reference Guide
| Load when |
File |
| Selecting REST/HTTP, GraphQL, RPC, event/message, webhook, or streaming |
references/interface-selection.md |
| Modeling data, collection reads, schemas, or OpenAPI |
references/contract-semantics.md |
| Designing writes, errors, retry behavior, limits, or authorization handoff |
references/operations-and-failures.md |
| Designing event contracts, webhook delivery, or streams |
references/events-webhooks-streaming.md |
| Reviewing compatibility, versions, deprecation, migration, or rollback |
references/evolution-and-deprecation.md |
| Preparing contract/provider/consumer/deployment verification |
references/contract-verification.md |
| Checking exact sources, versions, status, and intended use |
references/source-index.md |
| Exercising required edge cases before claiming readiness |
references/scenario-probes.md |
Security Boundary
Document authentication requirements and server-side object/action authorization in
the interface contract. For the threat model, credential handling, tenant isolation,
untrusted URLs or files, webhook signature design, output minimization, redaction,
or abuse resistance, load
secure-software-engineering. An API
contract cannot prove that an authorization boundary is enforced.
Completion
Stop when the selected interface has an owner, an authoritative contract, explicit
consumer and failure assumptions, a compatibility assessment for each change, and
evidence or an explicit gap for each required review item. Escalate unresolved domain
semantics, authority, delivery, or consumer-impact questions to their accountable
owner.
1---2name: api-design-and-evolution3description: Design, document, review, and evolve consumer-facing APIs and event interfaces. Use when choosing REST/HTTP, GraphQL, RPC, events, webhooks, or streaming; writing OpenAPI or AsyncAPI contracts; defining schemas, pagination, mutations, errors, idempotency, or API compatibility; or planning API versioning, deprecation, and migration. Use secure-software-engineering for a full security lifecycle, ADR authoring for durable architecture decisions, and spec-driven-development for a delivery specification and implementation gates.4license: MIT5---6
7# API Design And Evolution
8
9Design an interface as a durable agreement with its consumers, not a route list.
10Start with the consumer job, domain meaning, authority boundary, and failure modes;
11then choose the interface style and contract format. Keep facts, assumptions, and
12policy decisions distinguishable.
13
14## When to use
15
16Use for a new or changed REST/HTTP API, GraphQL schema, RPC operation, event or
17message contract, webhook, or streaming interface. Use it before implementation and
18again whenever consumer-visible behavior changes.
19
20## When not to use
21
22Do not use this as an ADR template, a complete product-discovery method, a security
23assessment, or an implementation test plan. Hand those concerns to
24[adr-authoring](../adr-authoring/SKILL.md),
25[product-discovery](../product-discovery/SKILL.md),
26[secure-software-engineering](../secure-software-engineering/SKILL.md), and
27[verification-methodology](../verification-methodology/SKILL.md), respectively.
28
29## Workflow
30
311. **Discover the agreement.** State consumer jobs, domain terms and invariants,
32 authoritative data and schema owners, actors, object/action authority boundaries,
33 data sensitivity, and failure modes. Record unanswered questions rather than
34 inventing policy. Start [templates/api-design-brief.md](templates/api-design-brief.md).
352. **Choose the interface shape.** Compare interaction direction, coupling,
36 delivery needs, query flexibility, mutation semantics, caching, observability,
37 and evolution surface. Read [references/interface-selection.md](references/interface-selection.md).
38 Record the choice and rejected options in the brief; use an ADR only when the
39 choice is consequential beyond this interface.
403. **Make the contract explicit.** Define representations and their semantics,
41 including null versus absent, defaults, enums/unions, identifiers, timestamps,
42 units, ordering, filtering, and pagination. Use
43 [templates/endpoint-contract.md](templates/endpoint-contract.md) with
44 [references/contract-semantics.md](references/contract-semantics.md).
454. **Design mutation and failure behavior.** Define authority checks, preconditions,
46 idempotency scope and equivalence, retries, concurrency, partial outcomes,
47 long-running operation state, errors, and resource limits. Read
48 [references/operations-and-failures.md](references/operations-and-failures.md)
49 and create [templates/error-taxonomy.md](templates/error-taxonomy.md) when
50 errors are shared across operations.
515. **Describe asynchronous delivery where relevant.** For messages, webhooks, or
52 streams, state the publisher/subscriber perspective, envelope, delivery contract,
53 duplicate/gap/reordering behavior, ordering scope, and security boundary. Read
54 [references/events-webhooks-streaming.md](references/events-webhooks-streaming.md).
556. **Assess change from each consumer's perspective.** Inventory consumers,
56 generated clients, strict decoders, signatures, caches, quotas, and operational
57 dependencies. Complete [templates/compatibility-change-assessment.md](templates/compatibility-change-assessment.md).
58 Do not call a change safe solely because it is additive.
597. **Plan and verify rollout.** For a deprecation or migration, use
60 [templates/deprecation-migration-plan.md](templates/deprecation-migration-plan.md)
61 and [references/evolution-and-deprecation.md](references/evolution-and-deprecation.md).
62 Review the contract using [templates/contract-review.md](templates/contract-review.md).
63 Test provider conformance, consumer expectations, compatibility diffs, examples,
64 negative cases, and the deployed boundary. Load
65 [release-engineering](../release-engineering/SKILL.md) for release sequencing,
66 artifact promotion, progressive exposure, and coordinated rollback after the
67 compatibility policy is defined.
68
69## Reference Guide
70
71| Load when | File |
72|---|---|
73| Selecting REST/HTTP, GraphQL, RPC, event/message, webhook, or streaming | [references/interface-selection.md](references/interface-selection.md) |
74| Modeling data, collection reads, schemas, or OpenAPI | [references/contract-semantics.md](references/contract-semantics.md) |
75| Designing writes, errors, retry behavior, limits, or authorization handoff | [references/operations-and-failures.md](references/operations-and-failures.md) |
76| Designing event contracts, webhook delivery, or streams | [references/events-webhooks-streaming.md](references/events-webhooks-streaming.md) |
77| Reviewing compatibility, versions, deprecation, migration, or rollback | [references/evolution-and-deprecation.md](references/evolution-and-deprecation.md) |
78| Preparing contract/provider/consumer/deployment verification | [references/contract-verification.md](references/contract-verification.md) |
79| Checking exact sources, versions, status, and intended use | [references/source-index.md](references/source-index.md) |
80| Exercising required edge cases before claiming readiness | [references/scenario-probes.md](references/scenario-probes.md) |
81
82## Security Boundary
83
84Document authentication requirements and server-side object/action authorization in
85the interface contract. For the threat model, credential handling, tenant isolation,
86untrusted URLs or files, webhook signature design, output minimization, redaction,
87or abuse resistance, load
88[secure-software-engineering](../secure-software-engineering/SKILL.md). An API
89contract cannot prove that an authorization boundary is enforced.
90
91## Completion
92
93Stop when the selected interface has an owner, an authoritative contract, explicit
94consumer and failure assumptions, a compatibility assessment for each change, and
95evidence or an explicit gap for each required review item. Escalate unresolved domain
96semantics, authority, delivery, or consumer-impact questions to their accountable
97owner.