Create website database
Creates a MySQL database with a dedicated user for an Agency Plan website. The database name, username, and password must all be provided by the caller.
Creates a MySQL database with a dedicated user for an Agency Plan website.
The database name, username, and password must all be provided by the caller.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
website_uidstringRequiredExample:
Agency Plan website UID
zpwlGlp19Body
database_namestring · min: 3 · max: 30RequiredExample:
Database name to create (alphanumeric characters).
mydatabasedatabase_userstring · min: 3 · max: 12RequiredExample:
Database username to create alongside the database (alphanumeric characters).
myuserpasswordstring · password · min: 8 · max: 50RequiredExample:
Password for the database user (requires mixed case, letters, and numbers).
Str0ngP@ssword!Responses
200
Success response
application/json
namestringOptionalExample:
Database name.
my_databasecreated_atstring · date-timeOptionalExample:
Database creation date in ISO 8601 format.
2024-05-29T05:49:49+00:00401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
post/api/agency-hosting/v1/websites/{website_uid}/databases
POST /api/agency-hosting/v1/websites/{website_uid}/databases HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 84
{
"database_name": "mydatabase",
"database_user": "myuser",
"password": "Str0ngP@ssword!"
}{
"name": "my_database",
"created_at": "2024-05-29T05:49:49+00:00",
"users": [
{
"name": "my_user",
"host": "localhost",
"created_at": "2024-05-29T05:49:49+00:00"
}
]
}Last updated
Was this helpful?