---
title: "POST /rules/{InstanceId}"
method: POST
path: "/rules/{InstanceId}"
---

# POST /rules/{InstanceId}

`POST /rules/{InstanceId}`

Creates a rule for the specified Amazon Connect instance.

Use the [Rules Function language](https://docs.aws.amazon.com/connect/latest/APIReference/connect-rules-language.html) to code conditions for the rule.

## Path parameters

- `InstanceId` string, required

## Request body

- object
  - `Name` string, required — A unique name for the rule.
  - `TriggerEventSource` object, required — The name of the event source. This field is required if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code>
    - `EventSourceName` 'OnPostCallAnalysisAvailable' | 'OnRealTimeCallAnalysisAvailable' | 'OnPostChatAnalysisAvailable' | 'OnZendeskTicketCreate' | 'OnZendeskTicketStatusUpdate' | 'OnSalesforceCaseCreate' — The name of the event source.
    - `IntegrationAssociationId` string — The identifier for the integration association.
  - `Function` string, required — The conditions of the rule.
  - `Actions` RuleAction[], required — A list of actions to be run when the rule is triggered.
    - `ActionType` 'CREATE_TASK' | 'ASSIGN_CONTACT_CATEGORY' | 'GENERATE_EVENTBRIDGE_EVENT' | 'SEND_NOTIFICATION', required — The type of action that creates a rule.
    - `TaskAction` object — Information about the task action. This field is required if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code>
      - `Name` string, required — The name. Supports variable injection. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-variable-injection.html">JSONPath reference</a> in the <i>Amazon Connect Administrators Guide</i>.
      - `Description` string — The description. Supports variable injection. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-variable-injection.html">JSONPath reference</a> in the <i>Amazon Connect Administrators Guide</i>.
      - `ContactFlowId` string, required — The identifier of the flow.
      - `References` object — Information about the reference when the <code>referenceType</code> is <code>URL</code>. Otherwise, null. (Supports variable injection in the <code>Value</code> field.)
    - `EventBridgeAction` object — Information about the EventBridge action.
      - `Name` string, required — The name.
    - `AssignContactCategoryAction` object — Information about the contact category action.
    - `SendNotificationAction` object — Information about the send notification action.
      - `DeliveryMethod` 'EMAIL', required — Notification delivery method.
      - `Subject` string — The subject of the email if the delivery method is <code>EMAIL</code>. Supports variable injection. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-variable-injection.html">JSONPath reference</a> in the <i>Amazon Connect Administrators Guide</i>.
      - `Content` string, required — Notification content. Supports variable injection. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-variable-injection.html">JSONPath reference</a> in the <i>Amazon Connect Administrators Guide</i>.
      - `ContentType` 'PLAIN_TEXT', required — Content type format.
      - `Recipient` object, required — Notification recipient.
        - `UserTags` object — The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }. Amazon Connect users with the specified tags will be notified.
        - `UserIds` UserId[] — A list of user IDs.
  - `PublishStatus` 'DRAFT' | 'PUBLISHED', required — The publish status of the rule.
  - `ClientToken` string — A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.

## Response `200`

Success

- CreateRuleResponse
  - `RuleArn` string, required — The Amazon Resource Name (ARN) of the rule.
  - `RuleId` string, required — A unique identifier for the rule.

## Other responses

- `480` — InvalidRequestException
- `481` — ResourceNotFoundException
- `482` — InternalServiceException
- `483` — ThrottlingException
- `484` — AccessDeniedException
- `485` — ResourceConflictException
- `486` — ServiceQuotaExceededException

---

[API](https://skmtc.net/aws/apis/connect.md) · [All operations](https://skmtc.net/aws/apis/connect/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/connect/versions/fbcf0a4faed2/schema)
