Back

Param "documentId" is not optional

  • 0
  • Self Hosted
  • Databases
  • Web
  • REST API
Philipp
22 Jan, 2024, 18:29

{"documentId":"unique()","data":{"firstname":"a","lastname":"b","knowledge":"c","full_age":false,"phone_one":"98345679","email":"mail@mail.com"},"permissions":[]}

got this error message when making a POST request to /databases/${dbId}/collections/${collectionId}/documents. is there something wrong with my request body? (see above)

{ message: 'Param "documentId" is not optional.', code: 400, type: 'general_argument_invalid', version: '1.4.13' }

TL;DR
Title: Error: Param "documentId" is not optional Message: Is the request body incorrect? The developer encountered an error when making a POST request to create a new document. The error message states that the "documentId" parameter is not optional. The developer provided the request body in the message, and it appears to be correct. Solution: The "documentId" parameter is required in the POST request. Ensure that a valid value is provided for the "documentId" in the request body. If using a custom ID, make sure it is correctly formatted and meets any requirements specified by the API.
kamal.panara
22 Jan, 2024, 18:43

Hmm, it looks correct

Torsten Dittmann
22 Jan, 2024, 18:46

Does this also happen with using a custom ID?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more