Read a collection schema
get_collection_schema
Reads the columns of one table in a site database, with their types, nullability, primary key and CMS field type.
Each column carries its uiType, the CMS field type registered for it, such as image, richtext or code, or null. A language column with no type of its own reports its base field's type when that type is color, richtext, code, file, image, date or datetime. A code value is raw HTML, CSS or JavaScript that the site runs exactly as written. A richtext value is HTML, and an embed inside it is an empty <div data-embed="…"> whose attribute holds the embed's code with &, <, > and " escaped.
A foreign key column names the table and column it points at in references. Read this before writing a row with create_row or update_row, so the right columns are supplied. See Column types.
A collection that does not exist in the site's database is refused with a 404 and the message "That collection was not found in your database!".
Request
Call it with a POST to https://api.modulify.ai/v1/get_collection_schema, sending the inputs below as a JSON object. The token needs the data:read scope.
It only reads and changes nothing, so retrying it is safe.
curl -X POST https://api.modulify.ai/v1/get_collection_schema \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID","name":"NAME"}'Over MCP, the same method is the get_collection_schema tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
name |
string | Yes | The table name, from list_collections. |
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.