Create account database
Creates a database with a database user and password for the specified account. The database name and user are automatically prefixed with the account username when needed.
Creates a database with a database user and password for the specified account.
The database name and user are automatically prefixed with the account username when needed.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
usernamestringRequiredExample:
u123456789Body
namestringRequiredExample:
Database name. If the account username prefix is omitted, it is added automatically.
u123456789_test_dbuserstringRequiredExample:
Database user. If the account username prefix is omitted, it is added automatically.
u123456789_adminpasswordstring · passwordRequiredExample:
Database user password.
Str0ngP@ssword!website_domainstringRequiredExample:
Website domain assigned to the database.
example.comResponses
200
Success empty response
application/json
messagestringOptionalExample:
Request accepted401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
post/api/hosting/v1/accounts/{username}/databases
POST /api/hosting/v1/accounts/{username}/databases HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 115
{
"name": "u123456789_test_db",
"user": "u123456789_admin",
"password": "Str0ngP@ssword!",
"website_domain": "example.com"
}{
"message": "Request accepted"
}Last updated
Was this helpful?