+{"type":"object","description":"Response returned after creating a project and its primary database.","required":["project"],"properties":{"project":{"type":"object","description":"Project configuration and current control-plane state.","required":["id","org_id","name","status","created_at","updated_at"],"properties":{"id":{"type":"string","description":"Unique project identifier (prefixed).","example":"prj_01h455vb4pex5vsknk084sn02q"},"org_id":{"type":"string","description":"Better Auth organization ID that owns this project.","example":"org_abc123"},"name":{"type":"string","description":"Human-readable project name.","minLength":1,"maxLength":100,"example":"my-app"},"description":{"type":"string","description":"Optional project description.","maxLength":500,"example":"Production database proxy"},"tags":{"type":"array","description":"User-defined labels applied to the project.","maxItems":10,"example":["production","us-east-1"],"items":{"type":"string","maxLength":50}},"cloud":{"type":"string","enum":["aws","azure","gcp"],"description":"Cloud provider where the project runs.","readOnly":true},"proxy_host":{"type":"string","description":"Proxy hostname for connecting through PgBeam (e.g., myproject.aws.pgbeam.app).","readOnly":true},"queries_per_second":{"type":"integer","format":"int32","minimum":0,"maximum":2147483647,"description":"Maximum queries per second for this project. 0 means unlimited.","example":1000},"burst_size":{"type":"integer","format":"int32","minimum":0,"maximum":2147483647,"description":"Burst allowance above the steady-state rate. 0 uses queries_per_second as burst.","example":200},"max_connections":{"type":"integer","format":"int32","minimum":0,"maximum":2147483647,"description":"Maximum concurrent proxy connections. 0 means unlimited.","example":500},"allowed_cidrs":{"type":"array","description":"IP filtering rules as CIDR ranges with optional labels. When non-empty, only connections from matching IPs are accepted. Empty array means all IPs are allowed (default). Both IPv4 (e.g. 10.0.0.0/8) and IPv6 (e.g. 2001:db8::/32) are supported.\n","example":[{"cidr":"10.0.0.0/8","label":"VPC"},{"cidr":"2001:db8::/32","label":"IPv6 range"}],"items":{"type":"object","description":"An IP filtering rule with a CIDR range and optional human-readable label.","required":["cidr"],"properties":{"cidr":{"type":"string","description":"CIDR range in IPv4 (e.g. 203.0.113.0/24) or IPv6 (e.g. 2001:db8::/32) notation. A plain IP without prefix length defaults to /32 (IPv4) or /128 (IPv6).\n","pattern":"^[0-9a-fA-F.:]+(/[0-9]+)?$","example":"10.0.0.0/8"},"label":{"type":"string","description":"Optional human-readable label for this CIDR entry (e.g. \"Office\", \"VPC\").","maxLength":100,"example":"Office network"}},"x-readme-ref-name":"CidrEntry"},"maxItems":50},"database_count":{"type":"integer","description":"Number of databases attached to this project.","readOnly":true},"active_connections":{"type":"integer","description":"Current active connections (latest metrics snapshot). 0 when no metrics data.","readOnly":true},"status":{"type":"string","enum":["active","suspended","deleted"],"description":"Project lifecycle status.","x-readme-ref-name":"ProjectStatus"},"created_at":{"type":"string","format":"date-time","description":"When the project was created."},"updated_at":{"type":"string","format":"date-time","description":"When the project was last updated."}},"x-readme-ref-name":"Project"},"database":{"type":"object","description":"Registered upstream PostgreSQL database for a project.","required":["id","project_id","host","port","name","username","ssl_mode","cache_config","pool_config","created_at","updated_at"],"properties":{"id":{"type":"string","description":"Unique database identifier (prefixed).","example":"db_01h455vb4pex5vsknk084sn02q"},"project_id":{"type":"string","description":"Owning project ID.","example":"prj_01h455vb4pex5vsknk084sn02q"},"connection_string":{"type":"string","description":"Connection string for connecting through PgBeam proxy. Password is replaced with a placeholder.","readOnly":true,"example":"postgresql://myuser:YOUR_PASSWORD@myproject.aws.pgbeam.app:5432/mydb"},"host":{"type":"string","description":"PostgreSQL host.","example":"db.example.com"},"port":{"type":"integer","minimum":1,"maximum":65535,"description":"PostgreSQL port.","example":5432},"name":{"type":"string","description":"PostgreSQL database name.","example":"mydb"},"username":{"type":"string","description":"PostgreSQL username.","example":"pgbeam"},"ssl_mode":{"type":"string","enum":["disable","allow","prefer","require","verify-ca","verify-full"],"description":"PostgreSQL SSL connection mode.","example":"require","x-readme-ref-name":"SSLMode"},"role":{"type":"string","enum":["primary","replica"],"description":"Database role. Primary receives writes, replicas receive reads.","default":"primary","x-readme-ref-name":"DatabaseRole"},"pool_region":{"type":"string","description":"Region where the connection pool is maintained (near the database). When set and different from the client's edge region, queries are relayed through the pool region's data plane. Empty means direct connection.\n","example":"us-east-1"},"query_timeout_ms":{"type":"integer","minimum":0,"maximum":300000,"default":0,"description":"Query timeout in milliseconds. When set (> 0), the proxy sends SET statement_timeout on upstream connections. 0 means disabled (default).\n"},"auto_read_routing":{"type":"boolean","default":false,"description":"When enabled and replicas are configured, SELECT queries automatically route to read replicas without requiring the @pgbeam:replica SQL annotation.\n"},"cache_config":{"type":"object","description":"Query cache configuration.","required":["enabled","ttl_seconds","max_entries","swr_seconds"],"properties":{"enabled":{"type":"boolean","default":true,"description":"Whether query caching is enabled. When false, all queries bypass the cache."},"ttl_seconds":{"type":"integer","minimum":0,"maximum":86400,"default":60,"description":"Cache TTL in seconds for query results."},"max_entries":{"type":"integer","minimum":0,"maximum":1000000,"default":10000,"description":"Maximum number of cached query results."},"swr_seconds":{"type":"integer","minimum":0,"maximum":86400,"default":30,"description":"Stale-while-revalidate window in seconds."}},"x-readme-ref-name":"CacheConfig"},"pool_config":{"type":"object","description":"Connection pool configuration.","required":["pool_size","min_pool_size","pool_mode"],"properties":{"pool_size":{"type":"integer","minimum":1,"maximum":10000,"default":10,"description":"Maximum connections in the pool.","example":20},"min_pool_size":{"type":"integer","minimum":1,"maximum":10000,"default":1,"description":"Minimum idle connections maintained.","example":5},"pool_mode":{"type":"string","enum":["session","transaction","statement"],"description":"Connection pool mode.","example":"transaction","x-readme-ref-name":"PoolMode"},"max_active":{"type":"integer","minimum":1,"maximum":10000,"default":200,"description":"Maximum concurrent upstream connections per pool."}},"x-readme-ref-name":"PoolConfig"},"created_at":{"type":"string","format":"date-time","description":"When the database registration was created."},"updated_at":{"type":"string","format":"date-time","description":"When the database registration was last updated."}},"x-readme-ref-name":"Database"}},"x-readme-ref-name":"CreateProjectResponse"}
0 commit comments