In this tutorial, you will learn how to create new API endpoints to support your custom functionality. You may want to reference the BuddyBoss App API and BuddyBoss Platform API, which are both used in the app.
By default, WordPress provides a built-in API if you create a custom post type or taxonomy. In both WordPress and BuddyBoss Platform, there are already many hooks/filters to extend the REST API response.
If you need to update the core logic of an existing API, you will need to create your own custom endpoint. You may need to create your own custom endpoint if you have a custom requirement that doesn’t fit with WordPress core or BuddyBoss Platform.
For example, if instead of storing data as a core entity like a custom post type or taxonomy, you have created a custom table to store the data, you may want to expose that data in the API.
For the scenarios mentioned above, you should refer to this WordPress documentation, which includes a detailed explanation on how to create a custom API endpoint: