Ana içeriğe geç

Update Spec Access Type

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/spec-access-type/{specAccessType}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name
specAccessTypestringYesSpec access type (see EnumSpecAccessType below)

Query Parameters

ParameterTypeRequiredDefaultDescription
checkApiProxyPermissionbooleanNofalseWhen 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

FieldTypeRequiredDefaultDescription
deploybooleanNofalseIf true, deploy the API proxy after saving changes
deployTargetEnvironmentNameListarray[string]No-List of environment names to deploy to (required when deploy=true)

EnumSpecAccessType

ValueDescription
PUBLICAnyone can access the spec file
AUTHENTICATEDBasic Auth credential required to access the spec
HIDDENSpec file access is completely blocked
BACKEND_PROXYSpec 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

StatusCondition
400Invalid specAccessType or proxy not found
401Invalid or missing token
500Unexpected 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.
  • checkApiProxyPermission is stored alongside the access type and applies when specAccessType=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.