From 9f348a8459b00612524ecae640a85cac485ce282 Mon Sep 17 00:00:00 2001 From: PEDRO DIEZ GARCIA Date: Mon, 5 Oct 2026 13:09:03 +0200 Subject: [PATCH 1/5] Business Level Outcome Scenarios Guidance --- documentation/CAMARA-API-Design-Guide.md | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/documentation/CAMARA-API-Design-Guide.md b/documentation/CAMARA-API-Design-Guide.md index 7e9c9313..d9fc1278 100644 --- a/documentation/CAMARA-API-Design-Guide.md +++ b/documentation/CAMARA-API-Design-Guide.md @@ -373,6 +373,56 @@ An example JSON response body for an HTTP `200` response when the data is unavai * Existing stable APIs MAY adopt it in a future MAJOR version where behavior or response semantics would otherwise change. * Where possible, APIs MAY introduce `contextCode` and `contextMessage` as additive, backward-compatible changes. +#### 3.1.6. Scope of Business-Level Outcome Scenarios + +Business-level outcomes in successful responses apply to a specific set of scenarios. This section clarifies which situations fall within scope and which require error responses instead. + +**Out of Scope — Use HTTP Error Responses:** + +The following scenarios MUST be rejected with appropriate HTTP error codes and MUST NOT be modeled as business-level outcomes in 2xx responses: + +* **Request validation failures:** Syntax errors, invalid parameters, missing required fields → `400 INVALID_ARGUMENT` or `400 OUT_OF_RANGE` +* **Authentication failures:** Missing, invalid, or expired credentials → `401 UNAUTHENTICATED` +* **Authorization failures:** Insufficient permissions, forbidden business logic conditions → `403 PERMISSION_DENIED` or `403 {{SPECIFIC_CODE}}` +* **Resource not found:** Non-existent identifiers, missing resources → `404 NOT_FOUND` or `404 IDENTIFIER_NOT_FOUND` +* **State conflicts:** Resource incompatibility, already exists, state mismatch → `409` status +* **Identifier issues:** Missing, unnecessary, or unsupported identifiers in authentication context → `422 MISSING_IDENTIFIER`, `422 UNNECESSARY_IDENTIFIER`, or `422 UNSUPPORTED_IDENTIFIER` +* **Service unavailable for subscriber:** Subscription or segment not supported, not commercially delivered → `422 SERVICE_NOT_APPLICABLE` +* **Service cannot be delivered at all:** Permanent conditions preventing fulfillment, where the request context does not change the outcome → `422 {{SPECIFIC_CODE}}` + +**In Scope — May Use HTTP 2xx with Business-Level Outcomes:** + +The following scenarios are candidates for HTTP `2xx` responses with business-level outcomes: + +* **Service available with degraded precision:** The API can provide a response with lower precision, accuracy, or completeness than the ideal case (e.g., location data with reduced accuracy). +* **Service temporarily unavailable:** The service cannot be provided at this moment but may be available later; the response includes valuable context for the API consumer (e.g., device temporarily not reachable, but retry advised). +* **Empty or out-of-range results:** Resource arrays are empty due to filtering, sorting, or pagination boundaries (e.g., requested page exceeds total pages). +* **Partial data availability:** Only a subset of requested information can be provided due to constraints that may vary over time (e.g., some device properties unavailable, user privacy restrictions). + +**Distinction Criteria:** + +An outcome scenario qualifies for 2xx modeling if it meets ALL of the following conditions: + +* The service **can be delivered**, albeit potentially in a degraded or partial form at this moment. +* The scenario represents a **temporal or contextual condition** that may change over time, where a retry could yield a different (potentially complete) response. +* The scenario **does not hide a permanent inability** to deliver the service — the API request context does not fundamentally preclude service delivery. +* The scenario is **chargeable** and the API design supports differentiated charging models if required by business alignment. Such a decision for this differentiated charging is outside CAMARA scope and it is up to business aligments and other forums (e.g. GSMA), but CAMARA APIs design MUST be ready to provide a mean for that business aligment. +* The scenario is **agreed within the API initiative** and documented in the API specification so consumers understand the behavior. +* There is no **sensible information, privacy regulation or data minimization** risk on providing that information + +**Initial Scenarios:** + +The following scenarios are identified as candidates for 2xx business-level outcome modeling: + +| Scenario | Applicable Behavior | +|----------|---------------------| +| Business condition where service can be provided with lower precision | 2xx Business-level Outcomes in Successful Responses | +| Business condition where service cannot be provided temporarily, indicating valuable information for API Consumer | 2xx Business-level Outcomes in Successful Responses | +| Resource Array is empty | 2xx Business-level Outcomes in Successful Responses | +| Pagination Scenario — requested page is out of range (then the returned array is empty) | 2xx Business-level Outcomes in Successful Responses | + +**Note:** When in doubt, prefer using appropriate HTTP error codes. The primary goal of this guidance is to improve consistency and predictability across CAMARA APIs while ensuring API consumers can reliably distinguish between request failures and degraded service delivery. + ### 3.2. Error Responses To ensure interoperability, it is crucial to implement error management that strictly adheres to the error codes defined in the HTTP protocol. From 1384fbbc92124787ef3b7d88d608cd4a76e72f29 Mon Sep 17 00:00:00 2001 From: PEDRO DIEZ GARCIA Date: Mon, 5 Oct 2026 13:21:53 +0200 Subject: [PATCH 2/5] fix_editorial_typo --- documentation/CAMARA-API-Design-Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/CAMARA-API-Design-Guide.md b/documentation/CAMARA-API-Design-Guide.md index d9fc1278..3395449f 100644 --- a/documentation/CAMARA-API-Design-Guide.md +++ b/documentation/CAMARA-API-Design-Guide.md @@ -386,7 +386,7 @@ The following scenarios MUST be rejected with appropriate HTTP error codes and M * **Authorization failures:** Insufficient permissions, forbidden business logic conditions → `403 PERMISSION_DENIED` or `403 {{SPECIFIC_CODE}}` * **Resource not found:** Non-existent identifiers, missing resources → `404 NOT_FOUND` or `404 IDENTIFIER_NOT_FOUND` * **State conflicts:** Resource incompatibility, already exists, state mismatch → `409` status -* **Identifier issues:** Missing, unnecessary, or unsupported identifiers in authentication context → `422 MISSING_IDENTIFIER`, `422 UNNECESSARY_IDENTIFIER`, or `422 UNSUPPORTED_IDENTIFIER` +* **Identifier issues:** Missing, unnecessary, or unsupported identifiers in authentication context → `422 MISSING_IDENTIFIER`, `422 UNNECESSARY_IDENTIFIER` * **Service unavailable for subscriber:** Subscription or segment not supported, not commercially delivered → `422 SERVICE_NOT_APPLICABLE` * **Service cannot be delivered at all:** Permanent conditions preventing fulfillment, where the request context does not change the outcome → `422 {{SPECIFIC_CODE}}` From 05c95745a93c48d72fd9080928ca95f8aa7d39d9 Mon Sep 17 00:00:00 2001 From: PEDRO DIEZ GARCIA Date: Mon, 5 Oct 2026 17:24:35 +0200 Subject: [PATCH 3/5] clarify_service_temporarily_unavailable_scenario --- documentation/CAMARA-API-Design-Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/CAMARA-API-Design-Guide.md b/documentation/CAMARA-API-Design-Guide.md index 3395449f..bbdfc046 100644 --- a/documentation/CAMARA-API-Design-Guide.md +++ b/documentation/CAMARA-API-Design-Guide.md @@ -395,7 +395,7 @@ The following scenarios MUST be rejected with appropriate HTTP error codes and M The following scenarios are candidates for HTTP `2xx` responses with business-level outcomes: * **Service available with degraded precision:** The API can provide a response with lower precision, accuracy, or completeness than the ideal case (e.g., location data with reduced accuracy). -* **Service temporarily unavailable:** The service cannot be provided at this moment but may be available later; the response includes valuable context for the API consumer (e.g., device temporarily not reachable, but retry advised). +* **Service temporarily unavailable**: The request was processed successfully but the service cannot be provided at this moment but may be available later; the response includes valuable context for the API consumer (e.g., device temporarily not reachable, but retry advised). * **Empty or out-of-range results:** Resource arrays are empty due to filtering, sorting, or pagination boundaries (e.g., requested page exceeds total pages). * **Partial data availability:** Only a subset of requested information can be provided due to constraints that may vary over time (e.g., some device properties unavailable, user privacy restrictions). From 8cff6726887592db1b6a21677ce5a790c1e52a42 Mon Sep 17 00:00:00 2001 From: PEDRO DIEZ GARCIA Date: Thu, 15 Oct 2026 14:32:25 +0200 Subject: [PATCH 4/5] clarify_distinction_200_business_level_outcome_vs_503 --- documentation/CAMARA-API-Design-Guide.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/documentation/CAMARA-API-Design-Guide.md b/documentation/CAMARA-API-Design-Guide.md index bbdfc046..783dc6f3 100644 --- a/documentation/CAMARA-API-Design-Guide.md +++ b/documentation/CAMARA-API-Design-Guide.md @@ -395,7 +395,7 @@ The following scenarios MUST be rejected with appropriate HTTP error codes and M The following scenarios are candidates for HTTP `2xx` responses with business-level outcomes: * **Service available with degraded precision:** The API can provide a response with lower precision, accuracy, or completeness than the ideal case (e.g., location data with reduced accuracy). -* **Service temporarily unavailable**: The request was processed successfully but the service cannot be provided at this moment but may be available later; the response includes valuable context for the API consumer (e.g., device temporarily not reachable, but retry advised). +* **Temporary business condition after processing:** The request was processed successfully and its domain outcome can be determined, but the service cannot be provided for the current subject or context at this moment. The response includes valuable information for the API Consumer, and a later retry may produce a different outcome. * **Empty or out-of-range results:** Resource arrays are empty due to filtering, sorting, or pagination boundaries (e.g., requested page exceeds total pages). * **Partial data availability:** Only a subset of requested information can be provided due to constraints that may vary over time (e.g., some device properties unavailable, user privacy restrictions). @@ -403,13 +403,21 @@ The following scenarios are candidates for HTTP `2xx` responses with business-le An outcome scenario qualifies for 2xx modeling if it meets ALL of the following conditions: -* The service **can be delivered**, albeit potentially in a degraded or partial form at this moment. +* The request is valid and has been processed to the point where a domain-level outcome can be determined, even if the requested service cannot be fully delivered for the current subject or context. * The scenario represents a **temporal or contextual condition** that may change over time, where a retry could yield a different (potentially complete) response. * The scenario **does not hide a permanent inability** to deliver the service — the API request context does not fundamentally preclude service delivery. * The scenario is **chargeable** and the API design supports differentiated charging models if required by business alignment. Such a decision for this differentiated charging is outside CAMARA scope and it is up to business aligments and other forums (e.g. GSMA), but CAMARA APIs design MUST be ready to provide a mean for that business aligment. * The scenario is **agreed within the API initiative** and documented in the API specification so consumers understand the behavior. * There is no **sensible information, privacy regulation or data minimization** risk on providing that information +**Distinction between 2xx Business-Level Outcomes and `503 UNAVAILABLE`:** + +The fact that a condition is temporary or that the API Consumer may retry the request later MUST NOT, by itself, determine the HTTP status code. + +* A `2xx` response with a business-level outcome MUST be used when the request has been successfully validated and processed to the point where the API can determine the domain outcome, but a business or subject-specific condition prevents complete fulfilment. For example, a device status request may be processed successfully while the device is switched off or disconnected from the network. The response MUST expose the corresponding domain outcome. +* `503 UNAVAILABLE` MUST be used when a temporary technical condition prevents the API from processing the request, or from processing it sufficiently to determine the domain outcome. In this case, the API MUST NOT represent the condition as a business-level outcome. Examples include service maintenance or a temporary failure of an internal dependency. +* A recommendation to retry later MAY apply to both cases, but they are not equivalent: `2xx` indicates that a business outcome has been determined, whereas `503` indicates that the API could not determine that outcome. + **Initial Scenarios:** The following scenarios are identified as candidates for 2xx business-level outcome modeling: @@ -417,7 +425,7 @@ The following scenarios are identified as candidates for 2xx business-level outc | Scenario | Applicable Behavior | |----------|---------------------| | Business condition where service can be provided with lower precision | 2xx Business-level Outcomes in Successful Responses | -| Business condition where service cannot be provided temporarily, indicating valuable information for API Consumer | 2xx Business-level Outcomes in Successful Responses | +| Business condition where the request has been processed but the service cannot be provided temporarily for the current subject or context | 2xx Business-level Outcomes in Successful Responses | | Resource Array is empty | 2xx Business-level Outcomes in Successful Responses | | Pagination Scenario — requested page is out of range (then the returned array is empty) | 2xx Business-level Outcomes in Successful Responses | From 2bab7c35941abac483df7e7b3d0e9d78f6a2ff82 Mon Sep 17 00:00:00 2001 From: PEDRO DIEZ GARCIA Date: Thu, 15 Oct 2026 14:34:24 +0200 Subject: [PATCH 5/5] additional_clarification_on_503_scope --- documentation/CAMARA-API-Design-Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/CAMARA-API-Design-Guide.md b/documentation/CAMARA-API-Design-Guide.md index 783dc6f3..2957d443 100644 --- a/documentation/CAMARA-API-Design-Guide.md +++ b/documentation/CAMARA-API-Design-Guide.md @@ -535,7 +535,7 @@ In the following, we elaborate on the existing errors. In particular, we identif | 500 | `INTERNAL` | Unknown server error. Typically a server bug. | Problem in Server side. Regular Server Exception | | 501 | `NOT_IMPLEMENTED` | This functionality is not implemented yet. | Service not implemented. The use of this code SHOULD be avoided as far as possible to get the objective to reach aligned implementations | | 502 | `BAD_GATEWAY` | An upstream internal service cannot be reached. | Internal routing problem in the Server side that blocks to manage the service properly | -| 503 | `UNAVAILABLE` | Service Unavailable. | Service is not available. Temporary situation usually related to maintenance process in the server side | +| 503 | `UNAVAILABLE` | Service Unavailable. | Service is not available. Temporary situation usually related to maintenance process in the server side. It represents a temporary technical condition preventing the API from processing the request, or from processing it sufficiently to determine a business-level outcome. | | 504 | `TIMEOUT` | Request timeout exceeded. | API Server Timeout | > _NOTE 1: When no login has been performed or no authentication has been assigned, a non-descriptive generic error will always be returned in all cases, an `UNAUTHENTICATED` 401 “Request not authenticated due to missing, invalid, or expired credentials.” is returned, whatever the reason._