Actions14
- Collection Actions
- Global Actions
- Endpoint Actions
Collection → Create
AI-generatedSummary
Create a new document in a Payload CMS collection
Inputs
- collection (required) — Name or identifier of the collection to create a document in
- data (required) — JSON payload containing the fields and values for the new document
- additionalOptions — Optional query parameters and settings such as depth, limit, upload handling, etc.
Output shape
a created document object
The operation returns the created document; on failure it can return an error envelope depending on continueOnFail setting
Examples
Example 1: Create a Post with title and content
collection = BlogPosts, data = {"title": "Hello", "content": "World"}
Example 2: Create with image upload
collection = Media, data = {"filename": "photo.jpg"}, additionalOptions = {"upload": "data"}
Example 3: Create with custom headers via query parameters
collection = Users, data = {"email": "user@example.com"}, additionalOptions = {"query": {"meta": "public"}}