Ana içeriğe atla

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/grpc/

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

{
  "grpcSettings": {
    "maxInboundMessageSize": 4194304,
    "maxInboundMetadataSize": 8192,
    "keepAliveTime": 60,
    "keepAliveTimeout": 20,
    "keepAliveWithoutCalls": false,
    "channelIdleTimeout": 300,
    "perRpcBufferLimit": 1048576,
    "maxRetryAttempts": 5,
    "maxHedgedAttempts": 2,
    "maxTraceEvents": 24
  },
  "deploy": false,
  "deployTargetEnvironmentNameList": []
}

Request Body Fields

FieldTypeRequiredDefaultDescription
grpcSettingsobjectYes-gRPC settings object (see fields below)
deploybooleanNofalseIf true, deploy the API proxy after saving changes
deployTargetEnvironmentNameListarray[string]No-List of environment names to deploy to (required when deploy=true)

grpcSettings Fields

FieldTypeRequiredDefaultDescription
maxInboundMessageSizeintegerNoSystem defaultMaximum size of inbound gRPC messages in bytes
maxInboundMetadataSizeintegerNoSystem defaultMaximum size of inbound metadata (headers) in bytes
keepAliveTimeintegerNoSystem defaultInterval in seconds between keep-alive pings
keepAliveTimeoutintegerNoSystem defaultTimeout in seconds for keep-alive ping response
keepAliveWithoutCallsbooleanNoSystem defaultSend keep-alive pings even without active RPCs
channelIdleTimeoutintegerNoSystem defaultClose channel after this idle period in seconds
perRpcBufferLimitintegerNoSystem defaultPer-RPC buffer size limit in bytes
maxRetryAttemptsintegerNoSystem defaultMaximum number of retry attempts per RPC
maxHedgedAttemptsintegerNoSystem defaultMaximum number of hedged attempts per RPC
maxTraceEventsintegerNoSystem defaultMaximum number of trace events to keep in channel trace
Note: All fields are optional. Only provided fields are updated. Default values are inherited from system settings.

Response

Success Response (200 OK)

{
  "success": true
}
When deploy=true is specified:
{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Deployment successful"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
deploymentResultobjectDeployment result (only present when deploy=true)
deploymentResult.successbooleanOverall deployment success
deploymentResult.deploymentResultsarrayIndividual environment deployment results

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "API Proxy type is not GRPC"
}

Error Response (401 Unauthorized)

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

Error Response (404 Not Found)

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

cURL Example

Example 1: Configure Message Size and Keep-Alive

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyGrpcAPI/settings/grpc/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "grpcSettings": {
      "maxInboundMessageSize": 8388608,
      "maxInboundMetadataSize": 16384,
      "keepAliveTime": 30,
      "keepAliveTimeout": 10,
      "keepAliveWithoutCalls": true
    }
  }'

Example 2: Configure Retry and Hedging

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyGrpcAPI/settings/grpc/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "grpcSettings": {
      "maxRetryAttempts": 3,
      "maxHedgedAttempts": 2,
      "perRpcBufferLimit": 2097152
    }
  }'

Example 3: Configure Channel Idle Timeout

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyGrpcAPI/settings/grpc/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "grpcSettings": {
      "channelIdleTimeout": 600,
      "maxTraceEvents": 48
    }
  }'

Example 4: Save and Deploy

curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyGrpcAPI/settings/grpc/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "grpcSettings": {
      "maxInboundMessageSize": 8388608,
      "keepAliveTime": 30
    },
    "deploy": true,
    "deployTargetEnvironmentNameList": ["production"]
  }'

Notes and Warnings

  • gRPC Only: This endpoint is only applicable to API Proxies with gRPC type. Using it on HTTP/REST proxies will result in an error.
  • Message Size: maxInboundMessageSize limits the size of individual gRPC messages. Increase for large payloads (e.g., file uploads).
  • Keep-Alive: Keep-alive pings maintain the connection to the backend. keepAliveWithoutCalls=true keeps the connection alive even when no RPCs are active.
  • Retry vs Hedging: Retry attempts are sequential (retry after failure), hedged attempts are parallel (send multiple copies simultaneously).
  • Buffer Limit: perRpcBufferLimit controls how much data can be buffered per RPC — relevant for retries and hedging.
  • System Defaults: When a field is not set, the value is inherited from system-level settings.
  • Deploy: When deploy=true, the API proxy is automatically deployed to the specified environments after saving

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.