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

Create website subdomain

Create a new subdomain for the selected website. Provide a subdomain prefix and, optionally, a custom directory or the website public directory to use as the subdomain root.

Create website subdomain

post

Create a new subdomain for the selected website.

Provide a subdomain prefix and, optionally, a custom directory or the website public directory to use as the subdomain root.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
subdomainstringRequired

Subdomain prefix to create under the selected website

Example: blog
directorystring · nullableOptional

Directory name for the subdomain relative to the website root

Example: blog
is_using_public_directorybooleanOptional

Use the website public directory as the subdomain root directory

Example: true
Responses
200

Success empty response

application/json
messagestringOptionalExample: Request accepted
post/api/hosting/v1/accounts/{username}/websites/{domain}/subdomains
POST /api/hosting/v1/accounts/{username}/websites/{domain}/subdomains HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 72

{
  "subdomain": "blog",
  "directory": "blog",
  "is_using_public_directory": true
}
{
  "message": "Request accepted"
}

Last updated

Was this helpful?