servers field to point to the site’s hackgatedName subdomain so coverage data aligns with proxied traffic.
Upload a schema
Uploads an OpenAPI schema file for a site. The file is validated before being stored.Request
multipart/form-data body.
Headers
Bearer token. Example:
Bearer <token>Must be
multipart/form-data.Form fields
The OpenAPI schema file to upload. Accepted formats:
.json— OpenAPI JSON.yamlor.yml— OpenAPI YAML
400 error.The UUID of the site to attach the schema to.
Validation rules
| Condition | Status | Description |
|---|---|---|
File extension is not .json, .yaml, or .yml | 400 | Unsupported file type |
| File is not a valid OpenAPI document | 400 | Schema validation failure |
siteId does not exist | 404 | Site not found |
Response
Returns200 on success. No body is returned.
Example
Retrieve the schema
Returns the stored OpenAPI schema for a site. Theservers field in the returned document is rewritten to use the site’s hackgatedName subdomain.
Request
Headers
Bearer token. Example:
Bearer <token>Path parameters
The UUID of the site.
Response
string
required
The OpenAPI document as a JSON string, with the
servers field set to the site’s hackgatedName subdomain (e.g. https://www-myorg.hackgate.io). Returns 404 if no schema has been uploaded for the site.Example
The response is a JSON string, not an object. Parse it with
JSON.parse() before using it as an OpenAPI document.