Create website database user
Creates a user for an existing database on an Agency Plan website. Each database supports a single non-system user; creating a user for a database that already has one fails.
Creates a user for an existing database on an Agency Plan website.
Each database supports a single non-system user; creating a user for a database that already has one fails.
API Token authentication
Agency Plan website UID
zpwlGlp19Full database name as returned by the list databases endpoint.
my_databaseDatabase username to create (alphanumeric and underscores).
my_userPassword for the database user (requires mixed case, letters, and numbers).
Str0ngP@ssword!Host the user connects from (IPv4, IPv6, % wildcard, or localhost). Defaults to localhost.
localhostSuccess response
Database username.
my_userDatabase host the user is allowed to connect from.
localhostDatabase user creation date in ISO 8601 format.
2024-05-29T05:49:49+00:00Unauthenticated response
Validation error response
Error response
POST /api/agency-hosting/v1/websites/{website_uid}/databases/{database_name}/users HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 75
{
"database_user": "my_user",
"password": "Str0ngP@ssword!",
"host": "localhost"
}{
"name": "my_user",
"host": "localhost",
"created_at": "2024-05-29T05:49:49+00:00"
}Last updated
Was this helpful?