Skip to main content

Overview

useCreateEntity returns a function that creates a new entity. It supports both JSON and multipart form requests — the hook automatically selects multipart when images or files are included.

Usage Example

With image upload

Parameters

string
An ID from your own system to link this entity to an existing item.
string
An identifier for grouping entities by source (e.g., a section of your app).
string
The ID of the space this entity belongs to.
string
Entity title.
string
Entity body content.
Record<string, any>[]
Array of attachment objects. Flexible structure — can represent media URLs, file metadata, or any structured data.
string[]
Tags or keywords for filtering and discovery.
Mention[]
Users mentioned in the entity content.
{ latitude: number; longitude: number }
Geographic location for the entity.
Record<string, any>
Arbitrary project-specific data. Limited to 10 KB.
boolean
If true, creates the entity as a draft (not publicly visible). Default false.
boolean
If true, the authenticated user is not associated as the entity author.
boolean
If true, the request fails if no authenticated user is present.
{ files: File[]; options?: UploadImageOptions }
Images to upload and attach. Triggers a multipart form request.
{ files: File[]; options?: { pathParts?: string[] } }
Files to upload and attach. Triggers a multipart form request.

Returns

Entity
The newly created entity. See Entity data model.