Files
edx-platform/openedx/core/djangoapps/user_api
Feanil Patel 8143796b26 docs: update references from setup.py to pyproject.toml
Update documentation, comments, and docstrings throughout the codebase
to reflect the migration from setup.py to pyproject.toml:

- Transformer class docstrings: changed to reference "entry point name
  in the package configuration" for better future-proofing
- Block structure module docs: updated to reference pyproject.toml
- Test file comments: updated entry point references
- Config files (tox.ini, pytest.ini): updated references
- Documentation (extension_points.rst, course apps ADRs): updated to
  reference pyproject.toml with inclusive language for external packages
- Requirements documentation (github.in): updated with inclusive language
- edxmako README: modernized install command to use pip install

Historical ADRs and references to external packages that may still use
setup.py were intentionally left unchanged or updated with inclusive
language acknowledging both pyproject.toml and setup.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 10:46:16 -05:00
..
2025-12-11 11:46:44 -05:00
2024-08-22 14:56:51 -04:00

Status: Active

Responsibilities
================
The user_api app is currently a catch all that is used to provide various apis that are related to the user and also to features within the platform.

Intended responsibility: To manage user profile and general account information and to provide APIs to do so easily. This includes the following features: user preference, user profile, user retirement, and account activation/deactivation.

Direction: Decompose
====================
Currently this app is a catch all for many user related information even when that information should really belong in a different app.  If you are building a feature and need to provide information about a user within the context of your feature, you should localize that API to your feature and make your assumptions about what user information you need clear.

For example authentication related APIs have already been moved to the user_authn django app.

Glossary
========

More Documentation
==================

Persisting Optional User Metadata
*********************************
The User API is capable of storing optional learner metadata through the use of a feature called the **Extended Profile**. The **Extended Profile** is a lightweight option for storing optional user data that doesn't require the modification or update of existing Django models.

This data is persisted as part of the ``meta`` field of a learner's UserProfile instance.

Storing data requires a *PATCH* request to be made to the User API endpoint.

This request data must include a key named **extended_profile** that contains a list of dictionaries representing the additional data we wish to store for the learners. Each dictionary in the list must include two fields:

* ``field_name``: A name describing the data to be stored
* ``field_value``: The data to be stored

An example request using *curl*, storing information in a field named ``occupation``:

.. code-block:: bash

    curl --request PATCH '{{lms_host}}/api/user/v1/accounts/{{lms_username}}' \
    -- header 'Authorization: JWT {{jwt_token}}' \
    -- header 'Content-Type: application/merge-patch+json' \
    -- data '{
        "extended_profile": [
            {
                "field_name:" "occupation",
                "field_value": {
                    "name": "Organic Farmer",
                    "salary": "65000"
                }
            }
        ]
    }'

It is important to note that this data will not be returned as part of the User API until the system's Site Configuration has been updated. Details on how to update the Site Configuration can be found at `Retrieving Extended Profile Metadata`_.

.. _Retrieving Extended Profile Metadata: https://docs.openedx.org/en/latest/site_ops/install_configure_run_guide/configuration/retrieve_extended_profile_metadata.html