List SQL Users
Retrieve all SQL users in a cluster.GET /v1/clusters/{cluster_id}/sql-users
Path Parameters
Unique identifier for the cluster
The cluster ID used in the Cloud API is different from the routing ID used when connecting to clusters.
Response
Array of SQL user objects
Pagination information
Create a SQL User
Create a new SQL user in a cluster.POST /v1/clusters/{cluster_id}/sql-users
Path Parameters
Unique identifier for the cluster
Request Body
SQL username for the new userConstraints:
- Cannot be empty
- Cannot contain spaces
- Should follow SQL identifier rules
- Cannot be a reserved keyword
Password for the new userRequirements:
- Minimum 12 characters recommended
- Should include uppercase, lowercase, numbers, and special characters
- Store securely - cannot be retrieved later
Response
Store the password securely after creation. Passwords cannot be retrieved later - they can only be reset.
Delete a SQL User
Permanently delete a SQL user from a cluster.DELETE /v1/clusters/{cluster_id}/sql-users/{sql_username}
Path Parameters
Unique identifier for the cluster
Username of the SQL user to delete
Response
Change User Password
Update a SQL user’s password.PUT /v1/clusters/{cluster_id}/sql-users/{sql_username}/password
Path Parameters
Unique identifier for the cluster
Username of the SQL user
Request Body
New password for the userRequirements:
- Must be different from the current password
- Minimum 12 characters recommended
- Should include uppercase, lowercase, numbers, and special characters
Response
Changing a password does not terminate existing sessions. Users will need to reconnect with the new password for new sessions.
Managing User Privileges
While you create users through the Cloud API, you manage their privileges using SQL statements via a SQL client connection.Grant Specific Database Access
To limit a user to a specific database:Grant Table-Level Permissions
For more granular control:Create a Read-Only User
Revoke Admin Privileges
If a user was created with admin privileges:Required Permissions
| Operation | Required Role |
|---|---|
| List SQL users | Cluster Developer, Cluster Admin |
| Create SQL user | Cluster Creator, Cluster Admin |
| Delete SQL user | Cluster Creator, Cluster Admin |
| Change password | Cluster Creator, Cluster Admin |
Best Practices
Use Strong Passwords
Use Strong Passwords
Always use strong, unique passwords for SQL users:
- Minimum 12-16 characters
- Mix of uppercase, lowercase, numbers, and special characters
- Avoid dictionary words and common patterns
- Use a password manager to generate and store passwords
Follow Least Privilege Principle
Follow Least Privilege Principle
After creating users via the API:
- Connect to the cluster with an admin account
- Revoke the default admin role if not needed
- Grant only the minimum required privileges
- Use role-based access control for groups of users
Rotate Passwords Regularly
Rotate Passwords Regularly
Implement a password rotation policy:
- Change passwords every 90 days
- Immediately rotate passwords if they may have been compromised
- Use the password change API endpoint programmatically
- Coordinate password changes with application deployments
Use Service Accounts for Applications
Use Service Accounts for Applications
For application access:
- Create dedicated SQL users for each application or service
- Never share credentials between applications
- Use descriptive names (e.g.,
payment_service,analytics_worker) - Document which application uses which user
Audit User Access Regularly
Audit User Access Regularly
Periodically review SQL users:Remove users that are no longer needed.
Common Workflows
Create Application User with Limited Access
Rotate All Application Passwords
Script