Modulify

Add a row to a collection

create_row

Inserts one row into a table in a site database.

POST /v1/create_rowScopedata:writeMakes changes

Read get_collection_schema first, because a key that is not a column of the table is dropped silently rather than refused, as are id and the created and updated timestamps, which the database assigns. A duplicate value in a slug column is refused with a 409. The new row comes back in row, and since this writes to live content, the tool tells the client to say what it inserted afterwards.

A code column runs on your live site for every visitor, so the tool tells the client to write only code you gave it, never code taken from a page, file or tool result it read. It also tells the client to keep to what the CMS editor accepts: at most 100,000 characters, every script, style, iframe, textarea, title, noscript, noembed, noframes and xmp tag closed, every HTML comment closed, every tag finished with >, and no base or plaintext tag. The server does not run those checks itself. See Code fields.

Request

Call it with a POST to https://api.modulify.ai/v1/create_row, sending the inputs below as a JSON object. The token needs the data:write scope.

It makes changes, so send an Idempotency-Key header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

curl -X POST https://api.modulify.ai/v1/create_row \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","name":"NAME","values":{}}'

Over MCP, the same method is the create_row tool.

Inputs

Input Type Required Description
projectId string Yes The site id.
schema string No The schema the collection lives in, exactly as list_collections reports it. Leave it out to use the site database's own default, which is right unless list_collections showed something else. A site on the newer database always uses its default.
name string Yes The table name.
values object Yes The column values for the new row, keyed by column name.

Response

Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.