Call FlushExpireKeys to clear expired keys in an Apsaradb for Redis instance.

For more information about how to perform the corresponding operation in the console, see Clear data.

Note Cleared expired keys cannot be recovered. Exercise caution when you call this operation.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Name Type Required Example Description
Action String Yes FlushExpireKeys

The parameter specified by the system. Value: FlushExpireKeys.

InstanceId String Yes r-bp1xxxxxxxxxxxxx

The ID of the instance.

EffectiveTime String No Immediately

The time to clear the expired keys. Valid values:

  • Immediately
  • MaintainTime
Note Default value: Immediately.
RegionId String No cn-hangzhou

The ID of the region where the instance resides.

Response parameters

Name Type Example Description
InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

RequestId String 82E30AB7-E3A4-46 AC-88A0-3E4DCDC51B1E

The ID of the request.

TaskId String 219862579

The ID of the replication task.


Sample requests
? Action=FlushExpireKeys
&<Common request parameters>

Sample success responses

XML format


JSON format

    "InstanceId": "r-bp1xxxxxxxxxxxxx",
    "RequestId": "82E30AB7-E3A4-46AC-88A0-3E4DCDC51B1E",
    "TaskId": "219862579"

Error codes

For a list of error codes, visit the API Error Center.