liveBook · Manning

Specific operation

As explained in The Design of Web APIs, Second Edition

A specific operation is an API operation tailored to a particular use-case step or context rather than designed for broader reuse.

A specific operation serves a particular use-case step or context instead of aiming for broad reuse. It can make a flow clearer and reduce consumer processing, but turning every step into an operation creates duplication and weak reuse. section 2.5.1 section 10.1.4

Choose a specific operation when:

  • A generic operation would require consumers to filter, combine, or interpret data before continuing the flow. section 10.2.2 section 10.3.5
  • The required data would push an existing operation beyond its subject-matter scope. section 10.3.5
  • An aggregation represents a meaningful domain concept rather than a consumer-specific convenience. section 10.3.6
  • Keep the operation understandable and interoperable; excessive aggregation can obscure data meaning and operation granularity. section 10.3.6 section 10.5

Money-transfer eligibility

Instead of adding transfer-specific parameters to GET /accounts, expose GET /transfer-sources to return accounts eligible as transfer sources. Then expose GET /transfer-sources/{accountId}/destinations to combine eligible accounts and beneficiaries for that source. These operations prevent guesswork and intermediate data processing without requiring a separate resource representation for every source. section 10.3.5 section 10.3.6

Figure 10.6 The “List transfer sources” operation prevents adding money transfer parameters to “List accounts.” The “List destinations for source” use-case-specific operation avoids processing data of the generic “List accounts” and “List beneficiaries” operations.
figure

Compare generic account and beneficiary operations with transfer-specific source and destination operations, including how source eligibility shapes the destination list. section 10.3.5 section 10.3.6

How The Design of Web APIs, Second Edition covers it

How deep it goes
Explains selection, scope, aggregation, and trade-offs through HTTP examples, while stopping short of implementation mechanics.
Examples
Uses product carts, car rental searches, money-transfer sources and destinations, and dedicated transaction-category operations.
What it assumes
Assumes distinguishing use-case steps from reusable operations and teaches when contextual specificity justifies a separate operation.
What you can do after
Apply it by designing context-focused endpoints that reduce processing while preserving reusable scope and domain clarity.
How it connects
Connects specific operations to API operation flows, reusable API design, interoperability, data aggregation, and operation granularity.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.