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
string
required
Bearer token. Example:
Bearer <token>string
required
Must be
multipart/form-data.Form fields
file
required
The OpenAPI schema file to upload. Accepted formats:
.json— OpenAPI JSON.yamlor.yml— OpenAPI YAML
400 error.string
required
The UUID of the site to attach the schema to.
Validation rules
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
string
required
Bearer token. Example:
Bearer <token>Path parameters
string
required
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.