Bug Description
Following the documented request for POST /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/from-archive does not work. The API reference shows the request as
application/json with archive as a string, but the server rejects that request with a 422 validation error stating that archive "must be a file". No variation of the request we
tried was able to create a build.
Steps to Reproduce
-
Create a project archive as instructed in the docs:
zip -r archive.zip . --exclude "node_modules/*" --exclude "dist/*"
-
Attempt A — request exactly as documented (application/json, archive as a string):
curl -i "https://developers.hostinger.com/api/hosting/v1/accounts//websites//nodejs/builds/from-archive"
--request POST
--header 'Content-Type: application/json'
--header 'Authorization: Bearer '
--data '{"archive":"archive.zip","node_version":22,"app_type":"nest","package_manager":"yarn"}'
→ 422 (see Error Messages): archive "must be a file".
-
Attempt B — archive as a base64 string in the same application/json body:
→ 422 with the same must be a file error, plus "must not be greater than 51200 characters".
-
Attempt C — multipart/form-data (file sent as archive):
curl -i "https://developers.hostinger.com/api/hosting/v1/accounts//websites//nodejs/builds/from-archive"
--request POST
--header 'Authorization: Bearer '
-F "archive=@archive.zip;type=application/zip"
-F "node_version=22" -F "app_type=nest" -F "package_manager=yarn"
→ 403, blocked by a Cloudflare managed challenge before reaching the API. The application/json requests (Attempts A/B) are not challenged; only the multipart/form-data request is.
Expected Behavior
The documented application/json request should be accepted and return a build uuid.
Actual Behavior
- Attempt A (documented
application/json, archive as string): 422 Unprocessable Entity — archive "must be a file".
- Attempt B (
application/json, archive as base64 string): 422 — same error plus a 51200 characters limit.
- Attempt C (
multipart/form-data): 403 — Cloudflare managed challenge, request never reaches the API.
Error Messages / Stack Trace
Attempt A/B response (application/json):
{
"errors": {
"archive": [
"The archive field must be a file.",
"The archive field must not be greater than 51200 characters.",
"The archive field must be a file of type: zip, gz, tgz."
]
}
}
Attempt C response (multipart/form-data): HTTP/2 403, Cloudflare managed challenge
cf-mitigated: challenge
server: cloudflare
cf-ray: a1e3b3423bbac76b-IAD
<title>Just a moment...</title>
Additional Context
- The response bodies above are the only responses we received; we could not get any request to return a successful build.
- The Cloudflare challenge occurred only on the multipart/form-data attempt (Attempt C); the application/json attempts (A/B) reached the API and returned the 422.
- Cloudflare block reference for the 403: cf-ray: a1e3b3423bbac76b.
Bug Description
Following the documented request for
POST /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/from-archivedoes not work. The API reference shows the request asapplication/jsonwitharchiveas a string, but the server rejects that request with a422validation error stating thatarchive"must be a file". No variation of the request wetried was able to create a build.
Steps to Reproduce
Create a project archive as instructed in the docs:
zip -r archive.zip . --exclude "node_modules/*" --exclude "dist/*"Attempt A — request exactly as documented (
application/json,archiveas a string):curl -i "https://developers.hostinger.com/api/hosting/v1/accounts//websites//nodejs/builds/from-archive"
--request POST
--header 'Content-Type: application/json'
--header 'Authorization: Bearer '
--data '{"archive":"archive.zip","node_version":22,"app_type":"nest","package_manager":"yarn"}'
→ 422 (see Error Messages):
archive"must be a file".Attempt B —
archiveas a base64 string in the sameapplication/jsonbody:→ 422 with the same
must be a fileerror, plus"must not be greater than 51200 characters".Attempt C —
multipart/form-data(file sent asarchive):curl -i "https://developers.hostinger.com/api/hosting/v1/accounts//websites//nodejs/builds/from-archive"
--request POST
--header 'Authorization: Bearer '
-F "archive=@archive.zip;type=application/zip"
-F "node_version=22" -F "app_type=nest" -F "package_manager=yarn"
→ 403, blocked by a Cloudflare managed challenge before reaching the API. The
application/jsonrequests (Attempts A/B) are not challenged; only themultipart/form-datarequest is.Expected Behavior
The documented
application/jsonrequest should be accepted and return a builduuid.Actual Behavior
application/json,archiveas string): 422 Unprocessable Entity —archive"must be a file".application/json,archiveas base64 string): 422 — same error plus a51200 characterslimit.multipart/form-data): 403 — Cloudflare managed challenge, request never reaches the API.Error Messages / Stack Trace
Attempt A/B response (
application/json):{ "errors": { "archive": [ "The archive field must be a file.", "The archive field must not be greater than 51200 characters.", "The archive field must be a file of type: zip, gz, tgz." ] } } Attempt C response (multipart/form-data): HTTP/2 403, Cloudflare managed challenge cf-mitigated: challenge server: cloudflare cf-ray: a1e3b3423bbac76b-IAD <title>Just a moment...</title> Additional Context - The response bodies above are the only responses we received; we could not get any request to return a successful build. - The Cloudflare challenge occurred only on the multipart/form-data attempt (Attempt C); the application/json attempts (A/B) reached the API and returned the 422. - Cloudflare block reference for the 403: cf-ray: a1e3b3423bbac76b.