> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/api-reference/databases/mariadb/clusters/create-a-cluster.md).

# Create a cluster

Creates a new MariaDB cluster.

```json
{"openapi":"3.0.3","info":{"title":"IONOS DBaaS MariaDB REST API","version":"0.1.0"},"tags":[{"name":"Clusters","description":"Everything about MariaDB clusters."}],"servers":[{"url":"https://mariadb.de-fra.ionos.com","description":"Frankfurt, Germany"},{"url":"https://mariadb.de-txl.ionos.com","description":"Berlin, Germany"},{"url":"https://mariadb.es-vit.ionos.com","description":"Logroño, Spain"},{"url":"https://mariadb.fr-par.ionos.com","description":"Paris, France"},{"url":"https://mariadb.gb-lhr.ionos.com","description":"London, Great Britain"},{"url":"https://mariadb.us-ewr.ionos.com","description":"Newark, USA"},{"url":"https://mariadb.us-las.ionos.com","description":"Las Vegas, USA"},{"url":"https://mariadb.us-mci.ionos.com","description":"Lenexa, USA"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Please provide header value as 'Bearer <token>' and don't forget to add\n'Bearer' HTTP Authorization Scheme before the token.\n"}},"schemas":{"CreateClusterRequest":{"description":"Request payload with all data needed to create a new MariaDB cluster.\n","properties":{"properties":{"$ref":"#/components/schemas/CreateClusterProperties"}},"type":"object"},"CreateClusterProperties":{"description":"Properties with all data needed to create a new MariaDB cluster.\n","required":["mariadbVersion","instances","cores","ram","storageSize","connections","displayName","credentials"],"properties":{"mariadbVersion":{"$ref":"#/components/schemas/MariadbVersion"},"instances":{"$ref":"#/components/schemas/Instances"},"cores":{"$ref":"#/components/schemas/Cores"},"ram":{"$ref":"#/components/schemas/Ram"},"storageSize":{"$ref":"#/components/schemas/StorageSize"},"connections":{"type":"array","minItems":1,"maxItems":1,"description":"The network connection for your cluster. Only one connection is\nallowed.\n","items":{"$ref":"#/components/schemas/Connection"}},"displayName":{"$ref":"#/components/schemas/DisplayName"},"maintenanceWindow":{"$ref":"#/components/schemas/MaintenanceWindow"},"backup":{"$ref":"#/components/schemas/BackupProperties"},"credentials":{"$ref":"#/components/schemas/DBUser"},"fromBackup":{"$ref":"#/components/schemas/RestoreRequest"}},"type":"object"},"MariadbVersion":{"type":"string","description":"The MariaDB version of your cluster.","enum":["10.6","10.11"]},"Instances":{"type":"integer","description":"The total number of instances in the cluster (one primary and n-1\nsecondary).\n","minimum":1,"maximum":5},"Cores":{"type":"integer","description":"The number of CPU cores per instance.","minimum":1},"Ram":{"type":"integer","description":"The amount of memory per instance in gigabytes (GB).","minimum":4},"StorageSize":{"type":"integer","description":"The amount of storage per instance in gigabytes (GB).","minimum":10,"maximum":2000},"Connection":{"description":"Details about the network connection for your cluster.","properties":{"datacenterId":{"description":"The datacenter to connect your cluster to.","type":"string"},"lanId":{"description":"The numeric LAN ID to connect your cluster to.","type":"string"},"cidr":{"type":"string","description":"The IP and subnet for your cluster.\nNote the following unavailable IP ranges:\n10.233.64.0/18\n10.233.0.0/18\n10.233.114.0/24\n"}},"required":["datacenterId","lanId","cidr"],"type":"object"},"DisplayName":{"type":"string","description":"The friendly name of your cluster.","maxLength":63,"pattern":"^(\\w|:|\\-|\\ |.)+$"},"MaintenanceWindow":{"description":"A weekly 4 hour-long window, during which maintenance might occur.\n","properties":{"time":{"type":"string","description":"Start of the maintenance window in UTC time.","pattern":"^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$"},"dayOfTheWeek":{"$ref":"#/components/schemas/DayOfTheWeek"}},"required":["time","dayOfTheWeek"],"type":"object"},"DayOfTheWeek":{"description":"The name of the week day.","type":"string","enum":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},"BackupProperties":{"description":"Properties configuring the backup of the cluster.\n","properties":{"location":{"$ref":"#/components/schemas/BackupLocation"}},"type":"object"},"BackupLocation":{"type":"string","description":"The S3 location where the backups will be stored."},"DBUser":{"description":"Credentials for the database user to be created.","properties":{"username":{"$ref":"#/components/schemas/InitialDBUsername"},"password":{"$ref":"#/components/schemas/DBPassword"}},"required":["username","password"],"type":"object"},"InitialDBUsername":{"description":"The username for the initial MariaDB user. Some system usernames\nare restricted (e.g. \"mariadb\", \"admin\", \"standby\").\n\nThe username should be compliant with the following rules:\n- Must not exceed 16 characters\n- Must start with a letter\n- Must contain only letters, numbers, or underscores\n","minLength":1,"maxLength":16,"type":"string","pattern":"^[a-zA-Z]([a-zA-Z0-9]+_)*[a-zA-Z0-9]+$"},"DBPassword":{"type":"string","description":"The password for a MariaDB user.","writeOnly":true,"minLength":10,"maxLength":63},"RestoreRequest":{"type":"object","required":["backupId"],"description":"Request payload to restore a cluster from a backup.\n","properties":{"backupId":{"$ref":"#/components/schemas/ResourceID"},"recoveryTargetTime":{"type":"string","format":"date-time","description":"The timestamp to which the cluster should be restored.\nIf empty, the backup will be applied to the latest\ntimestamp.\n\nThis value must be supplied as ISO 8601 timestamp, the\nbackup will be replayed up until the given timestamp.\nIf empty, the backup will be applied completely.\n\nMust be within the earliestRecoveryTargetTime and now.\n\nThe earliestRecoveryTargetTime can be looked up in the\nbackup object.\n"}}},"ResourceID":{"type":"string","description":"The unique ID of the resource."},"ClusterResponse":{"description":"A database cluster.","properties":{"id":{"$ref":"#/components/schemas/ResourceID"},"metadata":{"$ref":"#/components/schemas/ClusterMetadata"},"properties":{"$ref":"#/components/schemas/ClusterProperties"}},"type":"object"},"ClusterMetadata":{"description":"Metadata of the resource.","properties":{"createdDate":{"type":"string","format":"date-time","description":"The ISO 8601 creation timestamp."},"createdBy":{"type":"string"},"createdByUserId":{"type":"string"},"lastModifiedDate":{"type":"string","format":"date-time","description":"The ISO 8601 modified timestamp."},"lastModifiedBy":{"type":"string"},"lastModifiedByUserId":{"type":"string"},"state":{"$ref":"#/components/schemas/State"}}},"State":{"description":"The current status reported back by the cluster.","type":"string","enum":["AVAILABLE","BUSY","CREATING","UPDATING","RESTORING","DESTROYING","DEGRADED","FAILED","UNKNOWN"]},"ClusterProperties":{"description":"Properties of a database cluster.","properties":{"displayName":{"$ref":"#/components/schemas/DisplayName"},"mariadbVersion":{"$ref":"#/components/schemas/MariadbVersion"},"dnsName":{"$ref":"#/components/schemas/DNSName"},"instances":{"$ref":"#/components/schemas/Instances"},"ram":{"$ref":"#/components/schemas/Ram"},"cores":{"$ref":"#/components/schemas/Cores"},"storageSize":{"$ref":"#/components/schemas/StorageSize"},"connections":{"type":"array","minItems":1,"maxItems":1,"items":{"$ref":"#/components/schemas/Connection"}},"maintenanceWindow":{"$ref":"#/components/schemas/MaintenanceWindow"},"backup":{"$ref":"#/components/schemas/BackupProperties"}},"type":"object"},"DNSName":{"type":"string","description":"The DNS name pointing to your cluster."},"ErrorMessage":{"properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}},"type":"object"}},"responses":{"Error400":{"description":"Parse error.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error401":{"description":"Authentication error.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error403":{"description":"Unauthorized.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error404":{"description":"Not Found.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error405":{"description":"Unsupported HTTP method.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error415":{"description":"Unsupported content type.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error422":{"description":"Validation error.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error429":{"description":"Request rate limit exceeded.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error500":{"description":"Server error.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}},"Error503":{"description":"Maintenance.","content":{"application/json":{"schema":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"required":["httpStatus","messages"],"type":"object"}}}}}},"paths":{"/clusters":{"post":{"operationId":"clustersPost","summary":"Create a cluster","description":"Creates a new MariaDB cluster.\n","tags":["Clusters"],"requestBody":{"description":"The cluster to be created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClusterRequest"}}},"required":true},"responses":{"200":{"description":"The created cluster is returned with `metadata.state` set to \"BUSY\".\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterResponse"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"405":{"$ref":"#/components/responses/Error405"},"415":{"$ref":"#/components/responses/Error415"},"422":{"$ref":"#/components/responses/Error422"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/api-reference/databases/mariadb/clusters/create-a-cluster.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
