Ana içeriğe geç

Update Idempotency Settings

Endpoint​

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

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

Request Body​

Full JSON Body Example​

{
"idempotencySettings": {
"name": "Idempotency Settings",
"description": "Idempotency-Key configuration",
"idempotencyActive": true,
"keyType": "HEADER",
"headerName": "Idempotency-Key",
"keyRequired": false,
"missingKeyHttpStatus": 400,
"applicableHttpMethods": ["POST", "PUT", "PATCH", "DELETE"],
"payloadHashEnabled": true,
"processingTimeoutInSeconds": 60,
"retentionInDays": 7,
"cacheStorageType": "DISTRIBUTED",
"handlingAction": "CONTINUE",
"cacheConnectionTimeoutInSeconds": 3,
"conflictHttpStatus": 409,
"mismatchHttpStatus": 422,
"replayCompletedResponse": true,
"conflictMessage": "{\"error\":\"idempotency_conflict\",\"message\":\"A request with this Idempotency-Key is already being processed.\"}",
"mismatchMessage": "{\"error\":\"idempotency_payload_mismatch\",\"message\":\"This Idempotency-Key was already used with a different request payload.\"}",
"missingKeyMessage": "{\"error\":\"idempotency_key_required\",\"message\":\"The Idempotency-Key header is required.\"}",
"errorContentType": "application/json",
"missingKeyBodyEnabled": true,
"conflictBodyEnabled": true,
"mismatchBodyEnabled": true,
"variableList": []
},
"deploy": false,
"deployTargetEnvironmentNameList": []
}

Request Body Fields​

FieldTypeRequiredDefaultDescription
idempotencySettingsobjectNo-Idempotency 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)

idempotencySettings Fields​

FieldTypeRequiredDefaultDescription
namestringNo-Settings name
descriptionstringNo-Settings description
idempotencyActivebooleanNofalseEnable/disable idempotency handling
keyTypestringNoHEADERHEADER or CUSTOM
headerNamestringNoIdempotency-KeyHeader name when keyType=HEADER
variableListarrayNo[]Custom key variables when keyType=CUSTOM
keyRequiredbooleanNofalseReject requests missing the idempotency key
missingKeyHttpStatusintegerNo400HTTP status when key is required but missing
applicableHttpMethodsarray[string]NoPOST, PUT, PATCH, DELETEHTTP methods subject to idempotency
payloadHashEnabledbooleanNotrueHash request payload to detect mismatches
processingTimeoutInSecondsintegerNo60In-flight processing lock timeout
retentionInDaysintegerNo7Completed entry retention (1–30)
cacheStorageTypestringNoDISTRIBUTEDLOCAL or DISTRIBUTED
handlingActionstringNo-CONTINUE or STOP when cache hit occurs
cacheConnectionTimeoutInSecondsintegerNo3Distributed cache connection timeout
conflictHttpStatusintegerNo409HTTP status for in-flight duplicate
mismatchHttpStatusintegerNo422HTTP status for payload mismatch
replayCompletedResponsebooleanNotrueReplay stored response for completed keys
conflictMessagestringNo(built-in JSON)Custom conflict response body
mismatchMessagestringNo(built-in JSON)Custom mismatch response body
missingKeyMessagestringNo(built-in JSON)Custom missing-key response body
errorContentTypestringNoapplication/jsonContent-Type for custom error bodies
missingKeyBodyEnabledbooleanNotrueInclude body on missing-key response
conflictBodyEnabledbooleanNotrueInclude body on conflict response
mismatchBodyEnabledbooleanNotrueInclude body on mismatch response
Partial update behavior

This endpoint applies only the fields present in the request body. Omitting a field, or sending it as null, keeps the value that is currently stored — including a setting an operator deliberately turned off. To change a value you must send it explicitly; false, 0 and an empty string are explicit values, not omissions.

The Default column above applies only when the settings object is created for the first time. On a proxy that already has these settings, an omitted field keeps its stored value, not the default.

List fields are replaced as a whole: an omitted list keeps the stored list, and an explicitly empty list ([]) clears it.

Clients that read the settings and send the complete object back keep working unchanged; properties the endpoint does not recognise are ignored rather than rejected.

EnumIdempotencyKeyType​

  • HEADER — Extract key from an HTTP header (headerName)
  • CUSTOM — Build key from variableList

EnumCacheStorageType​

  • LOCAL — Local cache (per worker instance)
  • DISTRIBUTED — Distributed cache (shared across all workers)

EnumCacheHandlingAction​

  • CONTINUE — Return cached response and continue to backend (for logging/monitoring)
  • STOP — Return cached response and stop processing

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 omitted, deploymentResult.success may be false with an empty detailList.

Error Responses​

StatusCondition
400Validation failure 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/idempotency/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"idempotencySettings": {
"idempotencyActive": true,
"keyType": "HEADER",
"headerName": "Idempotency-Key"
},
"deploy": false
}'

Partial Update (Change One Field)​

Only retentionInDays is sent, so the other settings — the key type, the header name, the applicable methods and all three custom error bodies — keep the values stored on the proxy.

curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyApiProxy/settings/idempotency/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"idempotencySettings": {
"retentionInDays": 14
}
}'

Notes and Warnings​

  • Applies to all proxy types, including AI, MCP, and A2A proxies.
  • retentionInDays is constrained to 1–30 at the model level.
  • Set deploy: true with deployTargetEnvironmentNameList to push changes to Gateway environments in the same call.

Permissions​

User must have API_MANAGEMENT + MANAGE permission in the project. Deployment requires API_MANAGEMENT + DEPLOY_UNDEPLOY.