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

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.

Create website database user

post

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.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
website_uidstringRequired

Agency Plan website UID

Example: zpwlGlp19
database_namestringRequired

Full database name as returned by the list databases endpoint.

Example: my_database
Body
database_userstring · min: 3 · max: 12Required

Database username to create (alphanumeric and underscores).

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

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

Example: Str0ngP@ssword!
hoststring · min: 1 · max: 40 · nullableOptional

Host the user connects from (IPv4, IPv6, % wildcard, or localhost). Defaults to localhost.

Example: localhost
Responses
200

Success response

application/json
namestringOptional

Database username.

Example: my_user
hoststringOptional

Database host the user is allowed to connect from.

Example: localhost
created_atstring · date-timeOptional

Database user creation date in ISO 8601 format.

Example: 2024-05-29T05:49:49+00:00
post/api/agency-hosting/v1/websites/{website_uid}/databases/{database_name}/users
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?