# Python REST APIs With Flask, Connexion, and SQLAlchemy - Part 3

DevFeed: [Python REST APIs With Flask, Connexion, and SQLAlchemy - Part 3](<https://devfeed.tech/articles/python-rest-apis-with-flask-connexion-and-sqlalchemy-part-3-99148.md>)

Original publisher: [Read original article](<https://realpython.com/flask-connexion-rest-api-part-3/>)

Author: Philipp Acsany

Published: 2026-10-25T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [REST API](<https://devfeed.tech/topics/rest-api.md>), [SQLAlchemy](<https://devfeed.tech/topics/sqlalchemy.md>), [Flask](<https://devfeed.tech/topics/flask.md>), [Python](<https://devfeed.tech/topics/python.md>), [Swagger](<https://devfeed.tech/topics/swagger.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [api-documentation](<https://devfeed.tech/tags/api-documentation.md>), [apis](<https://devfeed.tech/tags/apis.md>), [flask](<https://devfeed.tech/tags/flask.md>), [one-to-many](<https://devfeed.tech/tags/one-to-many.md>), [people](<https://devfeed.tech/tags/people.md>), [python](<https://devfeed.tech/tags/python.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [rest-apis](<https://devfeed.tech/tags/rest-apis.md>), [sqlalchemy](<https://devfeed.tech/tags/sqlalchemy.md>)

## AI overview

The tutorial extends a Flask REST API with notes linked to people through a SQLAlchemy one-to-many relationship. A `note` table stores each note's content, timestamp, and `person_id` foreign key, avoiding repeated person data; SQLAlchemy configures cascading note deletion and newest-first ordering. Marshmallow's `PersonSchema` includes a nested `NoteSchema` so people endpoints return full note objects, and the front end renders each person's notes. New API routes read, update, and delete notes by ID and create notes for an existing person; missing notes or owners produce 404 responses. The provided `build_database.py` script rebuilds `people.db` and seeds sample data, but drops existing database contents when run.

## Source excerpt

Extend your Flask REST API with a SQLAlchemy one-to-many relationship that adds notes to people, and serve them through new API endpoints.