SearchRules
Searches rules in an Connect Customer instance, with optional filtering.
Request Syntax
POST /search-rules HTTP/1.1
Content-type: application/json
{
"InstanceId": "string",
"MaxResults": number,
"NextToken": "string",
"SearchCriteria": {
"AndConditions": [
"RulesSearchCriteria"
],
"OrConditions": [
"RulesSearchCriteria"
],
"StringCondition": {
"ComparisonType": "string",
"FieldName": "string",
"Value": "string"
}
},
"SearchFilter": {
"AttributeFilter": {
"AndCondition": {
"TagConditions": [
{
"TagKey": "string",
"TagValue": "string"
}
]
},
"OrConditions": [
{
"TagConditions": [
{
"TagKey": "string",
"TagValue": "string"
}
]
}
],
"TagCondition": {
"TagKey": "string",
"TagValue": "string"
}
}
}
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- InstanceId
-
The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes
- MaxResults
-
The maximum number of results to return per page.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 200.
Required: No
- NextToken
-
The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2500.
Required: No
- SearchCriteria
-
The search criteria to be used to return rules.
Type: RulesSearchCriteria object
Required: No
- SearchFilter
-
Filters to be applied to search results, such as tag-based filters.
Type: RulesSearchFilter object
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"ApproximateTotalCount": number,
"NextToken": "string",
"Rules": [
{
"ActionSummaries": [
{
"ActionType": "string"
}
],
"CreatedTime": number,
"LastUpdatedBy": "string",
"LastUpdatedTime": number,
"Name": "string",
"PublishStatus": "string",
"RuleArn": "string",
"RuleCapabilityTiers": [ "string" ],
"RuleId": "string",
"Tags": {
"string" : "string"
},
"TriggerEventSource": {
"EventSourceName": "string",
"IntegrationAssociationId": "string"
}
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ApproximateTotalCount
-
The total number of rules which matched your search query.
Type: Long
- NextToken
-
If there are additional results, this is the token for the next set of results.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2500.
- Rules
-
Information about the rules.
Type: Array of RuleSearchSummary objects
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 403
- InternalServiceException
-
Request processing failed because of an error or failure with the service.
- Message
-
The message.
HTTP Status Code: 500
- InvalidParameterException
-
One or more of the specified parameters are not valid.
- Message
-
The message about the parameters.
HTTP Status Code: 400
- InvalidRequestException
-
The request is not valid.
- Message
-
The message about the request.
- Reason
-
Reason why the request was invalid.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource was not found.
- Message
-
The message about the resource.
HTTP Status Code: 404
- ThrottlingException
-
The throttling limit has been exceeded.
HTTP Status Code: 429
Examples
Example
The following example searches for published rules in an instance.
Sample Request
{
"InstanceId": "[instance_id]",
"MaxResults": 10,
"SearchCriteria": {
"StringCondition": {
"FieldName": "PublishStatus",
"Value": "PUBLISHED",
"ComparisonType": "EXACT"
}
}
}
Sample Response
{
"Rules": [
{
"Name": "MyRule",
"RuleId": "[rule_id]",
"RuleArn": "arn:aws:connect:[region]:[account_id]:instance/[instance_id]/rule/[rule_id]",
"PublishStatus": "PUBLISHED",
"RuleCapabilityTiers": [],
"CreatedTime": "2026-01-15T10:00:00Z",
"LastUpdatedTime": "2026-03-20T14:30:00Z"
}
],
"ApproximateTotalCount": 1
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: