Auto-fill fields in document from REST API `POST` method?

default discord avatar
Arskeliss
6 months ago
2

I am trying to write a frontend where users can register themselves and take that data(e.g.username, email,password) and create a mew user document for the user amd auto-fill the collection fields with the input. All this coming from Next.js based frontend. Is it possible?

  • discord user avatar
    jesschow
    Payload Team
    6 months ago

    hi @Arskeliss - if I am understanding correctly you want to create a new user using the REST API. You can absolutely do this by sending a POST request to

    /api/users

    along with the required data as the body.

    https://payloadcms.com/docs/rest-api/overview#auth-operations
  • default discord avatar
    Arskeliss
    6 months ago

    @jesschow thank you for your reply, that's right I want to use REST API for that. It looks easy enough, reading the docs, i will try it out. 🙌

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.