Ana içeriğe atla

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/routing-status/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name

Request Body

Full JSON Body Example

{
  "routingEnabled": true,
  "echoEnabled": false
}

Request Body Fields

FieldTypeRequiredDefaultDescription
routingEnabledbooleanNo-Enable/disable routing to backend
echoEnabledbooleanNo-Enable/disable echo mode (returns the request as the response without routing to backend)
Note: All fields are optional. Only provided fields are updated.

Routing

  • When routingEnabled=true, requests are forwarded to backend
  • When routingEnabled=false, requests are not forwarded (useful for testing/maintenance)

Echo Mode

  • When echoEnabled=true, the gateway returns the incoming request as the response without forwarding to the backend
  • Useful for debugging, testing API Proxy policies, and verifying request transformations

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 routing status"
}

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: Enable Routing

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/routing-status/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "routingEnabled": true
  }'

Example 2: Enable Echo Mode

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/routing-status/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "echoEnabled": true
  }'

Example 3: Disable Echo Mode and Enable Routing

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/routing-status/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "routingEnabled": true,
    "echoEnabled": false
  }'

Notes and Warnings

  • Routing Disabled: When routingEnabled=false, requests are not forwarded to backend
  • Echo Mode: When echoEnabled=true, the request is returned as-is as the response — no backend communication occurs
  • Use Cases:
    • Disable routing for maintenance/testing
    • Enable echo mode for debugging request transformations and policy effects

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.