For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Create website database

post

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_uidstringRequired

Agency Plan website UID

Example: zpwlGlp19
Body
database_namestring · min: 3 · max: 30Required

Database name to create (alphanumeric characters).

Example: mydatabase
database_userstring · min: 3 · max: 12Required

Database username to create alongside the database (alphanumeric characters).

Example: myuser
passwordstring · password · min: 8 · max: 50Required

Password for the database user (requires mixed case, letters, and numbers).

Example: Str0ngP@ssword!
Responses
200

Success response

application/json
namestringOptional

Database name.

Example: my_database
created_atstring · date-timeOptional

Database creation date in ISO 8601 format.

Example: 2024-05-29T05:49:49+00:00
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?