All Products
Search
Document Center

EventBridge:PutTargets

Last Updated:Dec 23, 2025

Creates or updates event targets for a specified event rule.

Operation description

Creates or updates event targets for a specified event rule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eventbridge:PutTargets

update

*Rule

acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/{#RuleName}

None None

Request parameters

Parameter

Type

Required

Description

Example

EventBusName

string

Yes

The name of the event bus.

eventTest

RuleName

string

Yes

The name of the event rule.

ssr-send-to-vendor-test01

Targets

array<object>

Yes

The list of event targets to create or update. For more information, see Limits.

array<object>

No

The event target to create or update.

Id

string

Yes

The custom ID of the event target.

Mlm123456JHd2RsRoKw

Type

string

Yes

The type of the event target. For more information, see Event target parameters.

acs.fc.function

Endpoint

string

No

The endpoint URL for delivery.

acs:fc:cn-hangzhou:123456789098****:services/guide.LATEST/functions/HelloFC

PushRetryStrategy

string

No

The retry policy for pushing events. Valid values:

  • BACKOFF_RETRY: Backoff retry. The system retries the push three times. The interval between retries is a random value between 10 seconds and 20 seconds.

  • EXPONENTIAL_DECAY_RETRY: Exponential decay retry. The system retries the push 176 times. The interval for each retry increases exponentially to 512 seconds. The total retry time is one day. The specific retry intervals are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512...512 seconds (a total of 167 retries of 512 seconds).

BACKOFFRETRY

DeadLetterQueue

object

No

The dead-letter queue. Events that are not processed or exceed the number of retries are written to the dead-letter queue. The dead-letter queue supports the following queue types: Message Queue for Apache RocketMQ, Simple Message Queue (formerly MNS), Message Queue for Apache Kafka, and EventBridge.

Arn

string

No

The Alibaba Cloud Resource Name (ARN) of the dead-letter queue. Events that are not processed or exceed the number of retries are written to the dead-letter queue.

acs:mns:cn-hangzhou:123456789098****:/queues/deadletterqueue or acs:mq:cn-hangzhou:123456789098****:/instances/MQ_INST_123456789098****_BX8QbBPL/topic/deadlettertopic or acs:alikafka:cn-hangzhou:123456789098****:instance/alikafka_post-cn-123456/topic/deadlettertopic or acs:eventbridge:cn-hangzhou:123456789098****:eventbus/deadletterbus

Network

string

No

VpcId

string

No

VSwitchIds

string

No

SecurityGroupId

string

No

ErrorsTolerance

string

No

The fault tolerance policy. Valid values:

  • ALL: Allow fault tolerance. The system allows fault tolerance. If an exception occurs, the execution is not blocked. After the retry policy is exhausted, the message is delivered to the dead-letter queue or discarded based on the configuration.

  • NONE: Forbid fault tolerance. The system does not allow fault tolerance. If an exception occurs and the number of retries exceeds the value specified in the retry policy, the execution is blocked.

ALL

ParamList

array<object>

No

The parameters of the event target.

object

No

The parameters of the event target.

ResourceKey

string

No

The resource parameter of the event target. For more information, see Event target parameters.

body

Form

string

No

The format of the event target parameter. For more information, see Event target parameters.

TEMPLATE

Value

string

No

The value of the event target parameter.

{\"key\"=\"value\"}

Template

string

No

The template of the event target parameter.

The value of ${key} is ${value}!

ConcurrentConfig

object

No

The concurrency control configuration.

Concurrency

integer

No

The number of concurrent operations.

34

Response elements

Element

Type

Description

Example

object

Message

string

The error message.

The event rule not existed!

RequestId

string

The unique identifier generated by Alibaba Cloud for the request.

6FB52207-7621-5292-BDF2-A17E2E984160

Data

object

The returned result.

ErrorEntriesCount

integer

The number of event targets that failed to be processed. Valid values:

  • 0: All event targets are processed.

  • An integer other than 0: the number of event targets that failed to be processed.

0

ErrorEntries

array<object>

The information about the event targets that failed to be processed.

object

The information about the event targets that failed to be processed.

ErrorMessage

string

The details of the error.

The id of event target is duplicate!

ErrorCode

string

The error code.

EventRuleTargetIdDuplicate

EntryId

string

The ID of the event target that failed to be processed.

Mlm123456JHd2RsRoKw

Code

string

The return code of the API.

  • Success: The operation is successful.

  • Other: An error code. For more information about error codes, see Error codes.

Success

Success

boolean

The value `true` is returned if the operation is successful.

true

Examples

Success response

JSON format

{
  "Message": "The event rule not existed!",
  "RequestId": "6FB52207-7621-5292-BDF2-A17E2E984160\n",
  "Data": {
    "ErrorEntriesCount": 0,
    "ErrorEntries": [
      {
        "ErrorMessage": "The id of event target is duplicate!",
        "ErrorCode": "EventRuleTargetIdDuplicate",
        "EntryId": "Mlm123456JHd2RsRoKw"
      }
    ]
  },
  "Code": "Success",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

403 ServiceNotEnable Service not enable

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.