curl --request POST \
--url https://api.hubapi.com/cms/source-code/2026-03/{environment}/validate/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Validate a source code file within a specified environment in your HubSpot account. This endpoint is useful for checking the correctness of code files before deployment or further processing. The validation process requires the file to be uploaded in a multipart/form-data request.
curl --request POST \
--url https://api.hubapi.com/cms/source-code/2026-03/{environment}/validate/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Required Scopes
The access token received from the authorization server in the OAuth 2.0 flow.
.+The path of the source code file to validate. This should be a string that matches the file's location within the environment.
.+The error category
A unique identifier for the request. Include this value with any error reports or support tickets
"aeb5f871-7f07-4993-9211-075dc63e7cbf"
A human readable message describing the error along with remediation steps where appropriate
"An error occurred"
Context about the error condition
Show child attributes
"{invalidPropertyName=[propertyValue], missingScopes=[scope1, scope2]}"
further information about the error
Show child attributes
A map of link names to associated URIs containing documentation about the error or recommended remediation steps
Show child attributes
A specific category that contains more specific detail about the error
Was this page helpful?