Skip to content

[FC-0118] docs: ADR for documenting and consolidating internal MFE APIs#38309

Open
Abdul-Muqadim-Arbisoft wants to merge 1 commit into
openedx:docs/ADRs-axim_api_improvementsfrom
edly-io:docs/ADR-document_and_consolidate_internal_apis_used_by_mfes
Open

[FC-0118] docs: ADR for documenting and consolidating internal MFE APIs#38309
Abdul-Muqadim-Arbisoft wants to merge 1 commit into
openedx:docs/ADRs-axim_api_improvementsfrom
edly-io:docs/ADR-document_and_consolidate_internal_apis_used_by_mfes

Conversation

@Abdul-Muqadim-Arbisoft
Copy link
Copy Markdown
Contributor

Adds ADR proposing the approach for documenting and consolidating undocumented internal LMS APIs that MFEs depend on into stable, OpenAPI-described contracts.

Currently, MFEs consume internal endpoints with no schema, versioning,or deprecation guarantees, leading to silent runtime breakages on backend refactors and blocking external integrators. This ADR documents the decision to consolidate MFE configuration into a single documented endpoint (/api/mfe_config/v1/), extend it with optional course_id and user-role context behind authentication boundaries, and deprecate ad-hoc internal endpoints following the OEP-21 DEPR process with a 6-month compatibility window.
issue: #38280

Define a plan to document all undocumented internal LMS APIs consumed
by MFEs into stable, OpenAPI-described contracts. Introduces a
consolidated config endpoint pattern with optional course/user context,
authentication boundaries, and a rollout plan following OEP-21 DEPR
process.
Copy link
Copy Markdown
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a frontend developer, it would be great to have better-documented (and behaved) edx-platform REST APIs . But I have a couple of major concerns about this ADR as stated, at the moment.

Concern 1: It seems it's trying to decide two things at once: that a) existing endpoints should be better documented, and b) that there should be a new consolidated endpoint for configuration and context data. My first suggestion is to split this into two ADRs.

Concern 2: This is about the "b)" part of the ADR. I dislike multi-purpose endpoints, however well documented, however useful they might seem, for the simple fact that they go against RoA. Sure, edx-platform's REST API is only now being seriously designed, but that doesn't mean we should start implementing a new verb soup.

Finally, out of curiosity: is this part of #38137?

Context
-------

Multiple Open edX MFEs depend on undocumented internal LMS APIs. This causes two concrete problems:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have a list of these uses. It doesn't need to be comprehensive (certainly not in this ADR), but we should have a draft in the wiki we can point to. It will make this ADR's case much more compelling.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I'll put together a draft wiki page (representative, not exhaustive) of the undocumented endpoints MFEs depend on today and link it from the revised ADR. Tracking this before the next revision.


Multiple Open edX MFEs depend on undocumented internal LMS APIs. This causes two concrete problems:

1. **Runtime breakages**: Backend refactors silently break MFE data fetches because there
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an example (or two, or three) of when such a breakage happened?

Decision
--------

We will document and consolidate all internal APIs used by MFEs into stable,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here's my main concern with this ADR:

Why does it have to be about MFEs? Certainly it makes sense for edx-platform to have stable, documented REST APIs that are usable by any clients, not just our own MFEs. This is, of course, a massive undertaking, but it has already started via #38137. Is this a part of that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, this was a framing mistake. The underlying problem, undocumented endpoints with no contract guarantees, isn't MFE-specific; MFEs are just the most visible current consumer. I'll rewrite the framing to be about the platform's REST surface generally (under #38137), with MFEs as one motivating example rather than the scope. Confirming for the thread above: yes, this is part of #38137.


* All backend APIs consumed by MFEs MUST be documented with OpenAPI specifications,
including field descriptions, types, and example responses.
* Consolidate MFE configuration into a single, documented endpoint per MFE context
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an independent decision. There already is an ADR for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the existing ADR 0001 for /api/mfe_config/v1/, which already covers the mfe=<name> parameter. I won't be re-deciding that here. If MFEs need something 0001 doesn't already cover, the right vehicle is an amendment/follow-up to 0001, not a duplicate decision in this ADR.

* Consolidate MFE configuration into a single, documented endpoint per MFE context
(target pattern: ``/api/mfe_config/v1/``).
* The consolidated endpoint MUST accept ``mfe=<name>`` for app-specific overrides and
MAY accept ``course_id`` for course-contextual data (see `Authentication & Authorization`_
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is yet another decision. Is this ADR supposed to be about API documentation, or the creation of a new configuration endpoint?

(By the way, there already is a new configuration endpoint: /api/frontend_site_config/v1. I'm not sure we want to create yet another one, so soon.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both which is the scoping problem you flagged up top, so I'll split. And thanks for pointing to /api/frontend_site_config/v1; Adding a third config endpoint isn't on the table. The right question is whether the existing two cover what MFEs need today, and that's an audit I'll do it

* The consolidated endpoint MUST accept ``mfe=<name>`` for app-specific overrides and
MAY accept ``course_id`` for course-contextual data (see `Authentication & Authorization`_
below for scope rules).
* Deprecate undocumented internal endpoints once a supported, documented replacement
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor quibble with the naming choice: if you mean REST endpoints, they're external by definition, even if not documented properly.

And, again, I'd be curious to learn of cases where REST endpoints were broken from one release to the next.


* **Public configuration** (``BASE_URL``, ``LMS_BASE_URL``, feature flags): No
authentication required. Highly cacheable.
* **User-contextual data** (user roles, course-specific permissions): Requires a valid
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I'm looking at a separate ADR, here. What you seem to be suggesting is a single new multi-purpose endpoint that would be useful exclusively for MFEs.

I'm sorry to say that I'm not in favor of this, as it goes against resource-oriented API design. The key concept is that each API resource can be reused for different purposes, and a monolithic endpoint would be the antithesis of this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed and addressed in more detail in my top-level reply. The multi-purpose endpoint piece is coming out of the proposal entirely. User roles and course permissions belong as their own resources, usable by any client, not as fields on a config blob.

@Faraz32123 Faraz32123 changed the title docs: ADR for documenting and consolidating internal MFE APIs [FC-0118] docs: ADR for documenting and consolidating internal MFE APIs May 5, 2026
@Abdul-Muqadim-Arbisoft
Copy link
Copy Markdown
Contributor Author

As a frontend developer, it would be great to have better-documented (and behaved) edx-platform REST APIs . But I have a couple of major concerns about this ADR as stated, at the moment.

Concern 1: It seems it's trying to decide two things at once: that a) existing endpoints should be better documented, and b) that there should be a new consolidated endpoint for configuration and context data. My first suggestion is to split this into two ADRs.

Concern 2: This is about the "b)" part of the ADR. I dislike multi-purpose endpoints, however well documented, however useful they might seem, for the simple fact that they go against RoA. Sure, edx-platform's REST API is only now being seriously designed, but that doesn't mean we should start implementing a new verb soup.

Finally, out of curiosity: is this part of #38137?

As a frontend developer, it would be great to have better-documented (and behaved) edx-platform REST APIs . But I have a couple of major concerns about this ADR as stated, at the moment.

Concern 1: It seems it's trying to decide two things at once: that a) existing endpoints should be better documented, and b) that there should be a new consolidated endpoint for configuration and context data. My first suggestion is to split this into two ADRs.

Concern 2: This is about the "b)" part of the ADR. I dislike multi-purpose endpoints, however well documented, however useful they might seem, for the simple fact that they go against RoA. Sure, edx-platform's REST API is only now being seriously designed, but that doesn't mean we should start implementing a new verb soup.

Finally, out of curiosity: is this part of #38137?

Thanks you for reviewing it, these are fair concerns and on reviewing them I think they point to a real scoping problem on my side. Let me address them in turn.Please share your thoghts on them

On Concern 1 (two decisions in one ADR): You're right, and splitting is the right call. "Document the endpoints MFEs currently depend on" and "consolidate MFE configuration into one endpoint" are genuinely separate decisions, and bundling them makes both harder to evaluate. The documentation piece also overlaps with #38189 (drf-spectacular adoption), so I want to make sure I'm not re-deciding that here either.So for this ADR lets just focus on consolidate MFE configuration into one endpoint only since #38189 covers the docuementation thing

On Concern 2 (multi-purpose endpoint + RoA): This is the more important point and I agree. What I described drifts toward an RPC-style "give an MFE everything it needs in one call" endpoint, which is the wrong direction when the platform is only now adopting proper resource-oriented design. User-role and course-permission data shouldn't be folded into a config endpoint — those belong as their own resources (e.g. /api/courses/{id}/permissions/me/, /api/users/me/roles/), usable by any client, not just MFEs. If MFEs end up making more calls as a result, that's a client-side concern to address with batching or a BFF pattern, not by inflating endpoint surface.

On the existing endpoints I missed: I overlooked both ADR 0001 for /api/mfe_config/v1/ and the newer /api/frontend_site_config/v1 you linked. Proposing a "new consolidated /api/mfe_config/v1/" when that path is already an accepted ADR is clearly wrong. The right move is to audit what those two endpoints already provide against what MFEs actually consume today and, if there's a real gap, propose a minimal extension to whichever is the right home — not invent a third endpoint.

On #38137: Yes, this is intended to live under that epic, same FC-0118 umbrella as #38189.
Concrete next steps on my side:

  1. Compile a draft wiki page listing the undocumented endpoints MFEs depend on today, with 2–3 concrete examples of past silent breakages from backend refactors. I'll link it back here once it's up, and if I can't find solid breakage examples, that's also useful signal to soften the claim.
  2. Audit /api/mfe_config/v1/ and /api/frontend_site_config/v1 for current MFE usage so any future proposal is grounded in a real gap.
  3. Re-scope this work: one ADR focused on documentation/contract hygiene for the broader REST surface, framed around [FC-0118] Add ADRs for technical Recommendations on Open edX REST API Standards #38137 rather than MFEs specifically; and only if the audit finds a genuine gap, a second one about resource-oriented endpoints to fill it.

Does that direction sound right? Happy to correct now rather than rework after.

@arbrandes
Copy link
Copy Markdown
Contributor

Sounds good to me! Thanks, @Abdul-Muqadim-Arbisoft!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants