Requires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.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. A signed-in user’s entity is always theirs. Without a signed-in user, the entity has no author, and the request is allowed only while the project’s Who can create entities without an author setting is Everyone (the default); otherwise it fails with 403 entity/authorless-creation-not-allowed. See Create Entity.
Usage Example
With image upload
Parameters
string
An ID from your own system to link this entity to an existing item.
string | null
An identifier for grouping entities by source (e.g., a section of your app). For no source, leave it out or pass
null. "none", "null" and "undefined" are reserved and refused with 400 entity/invalid-body.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
Marks the entity’s own NSFW flag. Defaults to
false. This is only the entity’s own flag — its effective NSFW status also inherits from its space. Sublay labels and filters NSFW content but does not blur or age-gate it. See Entity NSFW flagging.boolean
If
true, creates the entity as a draft (not publicly visible). Default false.{ 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.

