Create the site database

create_site_database

Gives a site a database if it does not have one yet.

POST /v1/create_site_databaseScopedata:writeMakes changes

This is what turns a site with no data layer into one that can hold collections. Calling it on a site that already has a database is harmless and reports the one that is there, so it is safe to call before any other data tool. created says whether this call made the database.

The database is ready as soon as the call returns, so the other data tools can use it straight away.

As with get_site_database, the database address and token are never returned. See Getting a database.

Request

Call it with a POST to https://api.modulify.ai/v1/create_site_database, 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_site_database \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'

Over MCP, the same method is the create_site_database tool.

Inputs

Input Type Required Description
projectId string Yes The site id.

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.