Create from… (Materialize)

The materialize endpoint turns an existing object — one or more messages, one or more lists, a set of list rows, a document, or a selection of document elements — into a new List, a new Document, or both. It backs the "Create from…" feature in the web app. This is a Subscriber-only endpoint, mirroring the list/document create gates.

The request sends id-only references, never content. The server re-fetches and authorizes every referenced id under the calling user, then derives the new list/document from that authoritative data. Client-supplied cell values or body text are not trusted.

Endpoint

MethodPathAuthDescription
POST/api/materializeSession or BearerCreate a List, a Document, or both from a source object. Subscriber only.

POST /api/materialize

Auth required: yes (Session or Bearer) Subscriber only: yes

Request body

{
  "target": "list | doc | both",
  "source": { "kind": "messages", "messageIds": ["clx…"] },
  "listConfig": { "…": "optional; see below" },
  "docConfig": { "…": "optional; see below" }
}
FieldTypeRequiredDescription
targetstringyeslist, doc, or both — what to create.
sourceobjectyesAn id-only source reference (see the source kinds below). The server re-fetches and authorizes every id.
listConfigobjectnoColumn/schema configuration when target includes a list.
docConfigobjectnoTitle/path/style configuration when target includes a document.

Source kinds (source.kind)

kindFieldsMaterializes
messagesmessageIds: string[]One or more messages.
listslistIds: string[]One or more whole lists (schema + rows).
rowslistId: string, rowIds: string[]Selected rows from one list.
documentdocumentId: stringA whole document.
docElementsdocumentId: string, markdown: stringA selection of a document, identified by the document id plus the selected markdown.

Every id in a source is ownership-checked; referencing something you do not own returns 404.

listConfig (used when target is list or both)

FieldTypeDescription
titlestringNew list title.
descriptionstringOptional list description.
isPublicbooleanPublic visibility of the new list.
fieldsarrayColumn definitions. Each has propertyKey, propertyName, propertyType, optional isRequired/options, and a sourceKey mapping the column to a source attribute (null for a user-added empty column). The server re-derives values from the source via sourceKey — it does not accept client cell values.
includeDatabooleanSeed the list with rows derived from the source (default true). Set false to create an empty, columns-only list.

docConfig (used when target is doc or both)

FieldTypeDescription
titlestringNew document title.
relativePathstringOptional folder path for the new document.
isPublicbooleanPublic visibility of the new document.
listStylestringnumbered or bulleted — how list/row sources render as a document.
rowDataStylestringinline or sub-items — how each row's fields are laid out.

Response 201 Created

{
  "list": { "id": "clx…", "title": "From my messages" },
  "document": { "id": "clx…", "title": "From my messages" }
}

list is present when a list was created, document when a document was created; a both target returns both.

Error responses

StatusCondition
401Not authenticated.
403Authenticated but not a subscriber.
400Missing source, or an invalid request (bad field config, unsupported source shape).
404A referenced id (message, list, row, or document) is not found or not owned by you.
500Unexpected server error.