POST/v2/databases/{database_cluster_uuid}/users

Add a database user

Creates a database user for a database cluster. Supply the required name and, where applicable, engine-specific options in mysql_settings or settings; PostgreSQL pg_allow_replication defaults to false when omitted. The response includes the new user and its randomly generated password, and user management is not supported for Caching or Valkey clusters.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 8 body fields
database_cluster_uuidstringrequired
The unique identifier of the database cluster to add the user to.

Database user details and optional engine-specific settings. Supply name to create the user.

namestringrequired
The name of a database user.
rolestringoptional
A string representing the database user's role. The value will be either "primary" or "normal".
Allowed:primarynormal
passwordstringoptional
A randomly generated password for the database user.<br>Requires `database:view_credentials` scope.
access_certstringoptional
Access certificate for TLS client authentication. (Kafka only)
access_keystringoptional
Access key for TLS client authentication. (Kafka only)
mysql_settingsobjectoptional
MySQL-specific user settings. If supplied, this object must include `auth_plugin`.
settingsobjectoptional
Engine-specific user settings, including PostgreSQL replication options and MongoDB user settings.
readonlybooleanoptional
(To be deprecated: use settings.mongo_user_settings.role instead for access controls to MongoDB databases). For MongoDB clusters, set to `true` to create a read-only user. This option is not currently supported for other database engines.

6 status codes
201Returns a `user` object containing the created user's attributes, including its randomly generated password and any engine-specific settings.
userobjectrequired
401Returned when authentication fails because the credentials are invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404Returned when the requested database cluster resource is not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned for invalid credentials, a 404 when the database cluster is not found, a 429 when the API rate limit is exceeded, and a 500 when a server error occurs. name is required, and mysql_settings must include auth_plugin when that object is supplied. The database_cluster_uuid path parameter must identify an existing database cluster.