
Hello, I have created a sign up form in my app and currently using the Rest API server side to create a new user like:
payload['email'] = email;
payload['password'] = password;
const response = await fetch(`${AppwriteEndpoint}/account/sessions/email`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': AppwriteProject
},
body: JSON.stringify(payload)
});```
I need to create a document in a collection called userData which will hold other information about the user, I looked over the Rest API docs but i can not find how to create a document or the correct endpoint. I am not even sure this is possible.
Thanks for any advice.

I think i figured it out.
'documentId': 'unique()',
'data': {
'firstName': 'Test',
'lastName': 'Person',
'handle': 'testperson',
'email': 'test@test.com',
}
}
const test = await fetch(`${AppwriteEndpoint}/databases/${Database.id}/collections/${Collection.userData}/documents`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': AppwriteProject,
'X-Appwrite-Key': PRIVATE_APPWRITE_KEY,
},
body: JSON.stringify(testPayload)
});```

Hey, these are 2 completely seperate POST requests, are you still in need of help?

No I solved the problem by trial and error. I wanted to know how i can add a document to a collection via REST API. I found how to do it in the docs by changing the platform to REST. Thanks anyway!

Good to know!
Please set your support title as [Solved]
, so people know it's done!

[SOLVED] Adding a document using Rest API
Recommended threads
- Looking for Partner
I'm looking for a partner for long-term collaboration. Of course, you'll get paid for it. If you are interested, please send a DM to me
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
