Create Project
create_projectCreate a new RationalBloks project (a PostgreSQL REST API) from a JSON schema, on one of your resource pools.
⚠️ CRITICAL RULES - READ BEFORE CREATING SCHEMA:
FLAT FORMAT (REQUIRED): ✅ CORRECT: {"orders": {"total": {"type": "decimal", "precision": 10, "scale": 2}}} ❌ WRONG: {"orders": {"fields": {...}}} — never nest under 'fields'
EVERY field has a "type": string (MUST have max_length), text, integer, decimal (precision, scale), boolean, uuid, date, datetime (NOT "timestamp"), json, and the PostgreSQL arrays uuid_array, integer_array, text_array, float_array (GIN-indexed: @> contains, <@ contained_by, && overlaps)
AUTOMATIC FIELDS (DON'T define): id, created_at, updated_at, row_version
USERS: NEVER create users/customers/employees tables with email or password. Link to the built-in app_users table: {"user_id": {"type": "uuid", "foreign_key": "app_users.id"}}. A table with such a field is owner-scoped: each user sees their own rows.
FIELD OPTIONS: required, unique, default, enum, foreign_key ("table.id"), on_delete (cascade, set_null, restrict, no_action), nullable, index, description, write_only, computed. Advanced features (policy, computed columns, constraints, audit): get_schema_reference.
BACKEND ENGINE (backend_type): "python" (FastAPI, default) or "rust" (Axum: faster cold starts, lower memory).
WORKFLOW:
get_template_schemas FIRST to see valid examples
create_project with a cluster_id from list_clusters
Poll get_job_status with the returned job_id (2-5 minutes)
get_project_info gives the live URL While RationalBloks is being updated, the call is refused with 'RationalBloks is being updated': call it again in a few minutes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Project name | |
| schema | Yes | JSON schema in FLAT format (table_name → field_name → properties). Every field MUST have a 'type' property. Use get_template_schemas to see valid examples. | |
| cluster_id | Yes | REQUIRED — BYOC resource pool ID (from list_clusters) to deploy this project onto your own cluster. Owned hosting is retired: a project we operate must run on your own infrastructure. Register a pool via the Resource Pools UI first, then pass its id here. | |
| backend_type | No | Backend engine: 'python' (FastAPI, default) or 'rust' (Axum, faster). Default: python |