All Products
Search
Document Center

EventBridge:PutTargets

Last Updated:Sep 15, 2025

Creates or updates event targets under a rule.

Operation description

You can call this API operation to create or update event targets under a rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eventbridge:PutTargetsupdate
*Rule
acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#EventBusName}/rule/{#RuleName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EventBusNamestringYes

The name of the event bus.

eventTest
RuleNamestringYes

The name of the event rule.

ssr-send-to-vendor-test01
Targetsarray<object>Yes

The event targets to be created or updated. For more information, see Limits .

objectYes

The event target to be created or updated.

IdstringYes

The ID of the event target.

Mlm123456JHd2RsRoKw
TypestringYes

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

acs.fc.function
EndpointstringNo

The endpoint of the event target.

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

The retry policy to be used to push events. Valid values:

  • BACKOFF_RETRY: backoff retry. A failed event can be retried up to three times. The interval between two consecutive retries is a random value from 10 seconds to 20 seconds.
  • EXPONENTIAL_DECAY_RETRY: exponential decay retry. A failed event can be retried up to 176 times. The interval between two consecutive retries exponentially increases to a maximum of 512 seconds. The total retry time is 1 day. The specific retry intervals are 1, 2, 4, 8, 16, 32, 64, 128, 256, and 512 seconds. The interval of 512 seconds is used for 167 retries.
BACKOFFRETRY
DeadLetterQueueobjectNo

The dead-letter queue. Events that are not processed or whose maximum retries are exceeded are written to the dead-letter queue. You can use queues in ApsaraMQ for RocketMQ, Simple Message Queue (SMQ, formerly MNS), and ApsaraMQ for Kafka as dead-letter queues. You can also use event buses in EventBridge as dead-letter queues.

ArnstringNo

The Alibaba Cloud Resource Name (ARN) of the dead-letter queue. Events that are not processed or whose maximum retries are exceeded 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
ErrorsTolerancestringNo

The fault tolerance policy. Valid values:

  • ALL: allows fault tolerance. If an error occurs, event processing is not blocked. If the message exceeds the number of retries specified by the retry policy, the message is delivered to a dead-letter queue or discarded based on your configurations.
  • NONE: prohibits fault tolerance. If an error occurs and the message exceeds the number of retries specified by the retry policy, event processing is blocked.
ALL
ParamListarray<object>No

The parameters that are configured for the event target.

objectNo

The parameters that are configured for the event target.

ResourceKeystringNo

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

body
FormstringNo

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

TEMPLATE
ValuestringNo

The event target.

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

The structure of the template for the event target.

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

The concurrency configuration.

ConcurrencylongNo

The concurrency.

34

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

The error message that is returned if the request failed.

The event rule not existed!
RequestIdstring

The request ID.

6FB52207-7621-5292-BDF2-A17E2E984160
Dataobject

The returned result.

ErrorEntriesCountinteger

The number of failed event targets. Valid values:

  • 0: All event targets succeeded.
  • An integer other than 0: indicates the number of failed event targets.
0
ErrorEntriesarray<object>

The ID of the failed event target.

ErrorEntriesobject
ErrorMessagestring

The error message returned.

The id of event target is duplicate!
ErrorCodestring

The error code returned.

EventRuleTargetIdDuplicate
EntryIdstring

The ID of the failed event target.

Mlm123456JHd2RsRoKw
Codestring

The response code. Valid values:

  • Success: The call succeeded.
  • Other codes: The call failed. For more information about error codes, see Error codes.
Success
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request is successful.
  • false: The request failed.
true

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
403ServiceNotEnableService not enable

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-09-25The Error code has changedView Change Details