Directus icon

Directus

Consume Directus API

Item → Create

AI-generated

Summary

Create a new item in a specified collection

Inputs

  • collection (required) — The collection to create the item in; choose from the list or specify an ID using an expression.
  • collectionFields — Fields to set on the new item; each field has a name/ID and a value, with required fields marked.

Output shape

a single created item record

Returns the full data of the newly created item, including its generated ID and timestamps.

Examples

Example 1: Add a new post to the posts collection

Set Collection to 'posts', add a field 'title' with value 'Hello World' and a field 'content' with value 'First post'.

Example 2: Create a user with name and email

Set Collection to 'user', add fields 'name'='Alice' and 'email'='alice@example.com'.

Example 3: Insert a file into the files collection

Set Collection to 'file', add a field 'filename'='image.png' and 'value'='base64data'.

Discussion