All Products
Search
Document Center

Microservices Engine:CreateSentinelBlockFallbackDefinition

Last Updated:Jun 01, 2026

Creates a block fallback definition in Microservices Engine (MSE). A block fallback definition specifies the response that a client receives when Sentinel flow control or circuit breaking rules block a request, such as an HTTP 429 status code with a custom JSON body.

Try it now

Try this API in OpenAPI Explorer. OpenAPI Explorer signs requests automatically and generates SDK samples that you can download and run locally.

RAM authorization

Grant the following permission in a Resource Access Management (RAM) policy before you call this API operation.

ActionAccess levelResource typeCondition keyDependent action
mse:CreateSentinelBlockFallbackDefinitionupdateAll resources *NoneNone

For details on policy elements, see Common condition keys.

Request parameters

ParameterTypeRequiredDescriptionExample
AppNamestringNoThe application name.example-app
NamespacestringNoThe MSE namespace.test
RegionIdstringNoThe region ID.cn-hangzhou
LanguagestringNoThe programming language, such as Java or Go.JAVA
ResourceClassificationintegerNoThe resource type that the fallback applies to. Valid values: 1 (Web), 2 (RPC).1
FallbackBehaviorstringNoThe behavior details, specified as a JSON string.{"webFallbackMode":0,"webRespMessage":"{}","webRespStatusCode":429,"webRespContentType":0}
NamestringNoThe name of the fallback definition.MyFallback
ScenariostringNoThe scenario. Set this to default.default
AppIdstringNoThe application ID. Optional.abcde@12345
SourcestringNoRedundant parameter, currently ignored.edasmsc
AcceptLanguagestringNoThe language for response messages. Valid values: zh (default, Chinese), en (English).zh

Response parameters

ParameterTypeDescriptionExample
CodeintegerThe response code. 200 indicates success.200
SuccessstringWhether the request succeeded. Valid values: true, false.true
MessagestringThe response message.success
RequestIdstringThe request ID.ADDD8AB7-8D1C-4697-A83E-410D2607\*\*\*\*
HttpStatusCodeintegerThe HTTP status code.200
DataobjectThe created fallback definition. See the following table.

Data object

ParameterTypeDescriptionExample
IdintegerThe ID of the created fallback definition.34726
AppNamestringThe application name.spring-cloud-a
NamespacestringThe namespace.default
NamestringThe fallback definition name.test
ResourceClassificationintegerThe resource type. 1: Web, 2: RPC.1
FallbackBehaviorstringThe fallback behavior as a JSON string.{"webRespStatusCode":429,"webRespMessage":"test","webFallbackMode":0,"webRespContentType":0}
UserIdstringThe user ID.123456

Examples

Sample response

{
  "Message": "success",
  "RequestId": "ADDD8AB7-8D1C-4697-A83E-410D2607****",
  "Data": {
    "ResourceClassification": 1,
    "UserId": "123456",
    "AppName": "spring-cloud-a",
    "Id": 34726,
    "Namespace": "default",
    "Name": "test",
    "FallbackBehavior": "{\"webRespStatusCode\":429,\"webRespMessage\":\"test\",\"webFallbackMode\":0,\"webRespContentType\":0}"
  },
  "Code": 200,
  "Success": "true",
  "HttpStatusCode": 200
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalRequestInvalid request:%sThe request format is invalid. Verify the request body and parameter values.
400InvalidParameterParameter error:%sA parameter is missing or invalid. Check parameter names, types, and allowed values.
403NoPermissionYou are not authorized to perform this operation:%sThe caller lacks the required RAM permission. Attach a policy that grants the mse:CreateSentinelBlockFallbackDefinition action.
404NotFoundNot found:%sThe specified resource does not exist. Verify the application name, namespace, and region ID.
500InternalErrorConsole error. Try again later:%sAn internal error occurred. Retry the request after a brief wait. If the error persists, contact technical support.

For a complete list, see Error codes.

Release notes

For the change history of this API, see Release notes.