Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Publish events via HTTP

Focus mode
Publish events via HTTP - AWS AppSync Events

AWS AppSync Events allows you to publish events via your API’s HTTP endpoint using a POST operation. Publishing is the only supported action over the endpoint.

Publish steps

  1. Send a POST request to the address: https://HTTP_DOMAIN/event.

  2. Add the authorization header(s) required to authorize your request.

  3. Specify the following in the request body:

    • The channel that you are publishing to.

    • The list of events you are publishing. You can publish up to 5 events in a batch.

Each specified event in your publish request must be a stringified valid JSON value.

Publish example

The following is an example of a request.

{ "method": "POST", "headers": { "content-type": "application/json", "x-api-key": "da2-your-api-key" }, "body": { "channel": "default/channel", "events": [ "{\"event_1\":\"data_1\"}", "{\"event_2\":\"data_2\"}" ] } }

You can use your Browser’s fetch API to publish the events. The following example demonstrates this.

await fetch(`https://${HTTP_DOMAIN}/event`, { "method": "POST", "headers": { "content-type": "application/json", "x-api-key": "da2-your-api-key" }, "body": { "channel": "default/channel", "events": [ "{\"event_1\":\"data_1\"}", "{\"event_2\":\"data_2\"}" ] } })

To learn more about the different authorization types that AWS AppSync Events supports, see Configuring authorization and authentication to secure Event APIs.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.