Skip to main content
HackGATE uses your OpenAPI schema to power API coverage tracking in the analytics dashboard. Upload your schema once; HackGATE rewrites the 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

This endpoint accepts a 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
  • .yaml or .yml — OpenAPI YAML
The file must be a valid OpenAPI 2.x or 3.x document. Files that fail OpenAPI validation are rejected with a 400 error.
string
required
The UUID of the site to attach the schema to.

Validation rules

Response

Returns 200 on success. No body is returned.

Example


Retrieve the schema

Returns the stored OpenAPI schema for a site. The servers 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.