How to link relation when creating content from API?

System Information
  • Strapi Version: 3.6.2
  • Operating System: Ubuntu 20.04
  • Database: MongoDB
  • Node Version: 14.16.1
  • NPM Version: 7.12.1
  • Yarn Version: 1.22.10

I’ve created a content type named home, each user should have one or more home. How do I automatically link home to an authenticated user when I call POST /homes from my client application.

I’d POST /homes/:id where id is the userId. You’d allow findOne at least in the permissions settings. Also, you may want to add a check whether the authenticated user and the id posted are the same, to avoid others peeking into your directory.

Take a look at the relations sections, there are examples how to create entries with relations.