Update Spec Access Type
Endpoint
PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/spec-access-type/{specAccessType}/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| specAccessType | string | Yes | Spec access type (see EnumSpecAccessType below) |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| checkApiProxyPermission | boolean | No | false | When true, enforce API proxy permission check for authenticated access |
Request Body
The request body is optional. When present, it controls optional deployment after save.
Full JSON Body Example
{
"deploy": true,
"deployTargetEnvironmentNameList": ["production"]
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| deploy | boolean | No | false | If true, deploy the API proxy after saving changes |
| deployTargetEnvironmentNameList | array[string] | No | - | List of environment names to deploy to (required when deploy=true) |
EnumSpecAccessType
| Value | Description |
|---|---|
| PUBLIC | Anyone can access the spec file |
| AUTHENTICATED | Basic Auth credential required to access the spec |
| HIDDEN | Spec file access is completely blocked |
| BACKEND_PROXY | Spec requests are forwarded directly to the backend |
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"responseTime": 1500,
"detailList": [
{
"envName": "production",
"success": true,
"detail": "Deployed successfully",
"responseTime": 450
}
]
}
}
When deploy is false or the body is omitted, deploymentResult.success may be false with an empty detailList.
Error Responses
| Status | Condition |
|---|---|
| 400 | Invalid specAccessType or proxy not found |
| 401 | Invalid or missing token |
| 500 | Unexpected server error |
cURL Example
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyApiProxy/settings/spec-access-type/PUBLIC/?checkApiProxyPermission=false" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"deploy": true,
"deployTargetEnvironmentNameList": ["production"]
}'
Notes and Warnings
- Applies to all proxy types, including AI, MCP, and A2A proxies.
checkApiProxyPermissionis stored alongside the access type and applies whenspecAccessType=AUTHENTICATED.- An empty body saves the access type without triggering deployment.
Permissions
User must have API_MANAGEMENT + MANAGE permission in the project. Deployment requires API_MANAGEMENT + DEPLOY_UNDEPLOY.