Ana içeriğe atla

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/hide-spec-file/{hideSpecFile}/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name
hideSpecFilebooleanYesHide spec file (true or false)

Request Body

Full JSON Body Example

{
  "hideSpecFile": true
}

Request Body Fields

FieldTypeRequiredDescription
hideSpecFilebooleanNoEnable/disable hiding of specification file. When set to true, the OpenAPI/Swagger specification file will be hidden from public access. When set to false, the spec file will be publicly accessible

Query Parameters

None

Request Body

This endpoint does not require a request body.

Response

Success Response (200 OK)

{
  "success": true
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "Invalid hideSpecFile parameter"
}

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

Error Response (404 Not Found)

{
  "error": "not_found",
  "error_description": "ApiProxy (name: MyAPI) was not found!"
}

cURL Example

Example 1: Hide Spec File

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/hide-spec-file/true/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example 2: Show Spec File

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/hide-spec-file/false/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Path Parameter: hideSpecFile must be true or false (boolean as string in URL)
  • Public Access: When hideSpecFile=false, spec file is accessible via public endpoints
  • Security: Hiding spec file prevents public access to API structure/endpoints
  • Use Cases:
    • Hide internal API specifications
    • Protect API structure from public view

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.