Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Serverless Integrations
  • Comparison with other Yandex Cloud services
    • All guides
        • Sending events directly
        • Sending events using a connector
    • Viewing operations with service resources
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Public materials
  • Release notes
  1. Step-by-step guides
  2. EventRouter
  3. Sending events to a bus
  4. Sending events directly

Sending events directly to a bus

Written by
Yandex Cloud
Updated at July 15, 2025

Note

You can send events to a bus directly only if there is at least one rule attached to it.

To send events directly to a bus:

Management console
CLI
API
  1. In the management console, navigate to the folder with the bus you need.
  2. In the list of services, select Serverless Integrations.
  3. In the left-hand panel, select EventRouter.
  4. Select the bus you need.
  5. In the top panel, click Send event.
  6. In the window that opens, enter the event you need to send to the bus in JSON format, e.g., {"name": "value"}.
  7. Click Send.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. View the description of the CLI command to send events directly to a bus:

    yc serverless eventrouter put-event --help
    
  2. Get a list of buses:

    yc serverless eventrouter bus list
    

    Result:

    +----------------------+------------------+----------------------+--------+---------------------+
    |          ID          |       NAME       |      FOLDER ID       | STATUS | DELETION PROTECTION |
    +----------------------+------------------+----------------------+--------+---------------------+
    | f6676a9ti657******** | my-new-bus-17    | b1g681qpemb4******** | ACTIVE | false               |
    | f66aevm4ithv******** | my-favourite-bus | b1g681qpemb4******** | ACTIVE | true                |
    | f66m2q222n92******** | my-bus-42        | b1g681qpemb4******** | ACTIVE | false               |
    +----------------------+------------------+----------------------+--------+---------------------+
    
  3. Send the event to the bus you selected:

    yc serverless eventrouter put-event \
      --name <bus_name> \
      --event '<event>' \
      --file <file_path>
    

    Where:

    • --name: Name of the bus you are sending the event to.

      Instead of the bus name, you can provide its ID in the --id parameter.

    • --event: Event in JSON format, e.g., {"name": "value"}.

    • --file: Path to the file containing the event you are sending to the bus in JSON format.

    The --event and --file parameters are mutually exclusive: you can use only one of them.

Use the EventService/Put gRPC API call to send the event directly to a bus:

  1. If you do not have the gRPCurl utility installed, install it.

  2. If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

  3. Get an IAM token used for authentication in the API.

    IAM_TOKEN=$(yc iam create-token)
    

    The command will save the IAM token to the IAM_TOKEN variable.

  4. Get a list of buses:

    yc serverless eventrouter bus list
    

    Result:

    +----------------------+------------------+----------------------+--------+---------------------+
    |          ID          |       NAME       |      FOLDER ID       | STATUS | DELETION PROTECTION |
    +----------------------+------------------+----------------------+--------+---------------------+
    | f6676a9ti657******** | my-new-bus-17    | b1g681qpemb4******** | ACTIVE | false               |
    | f66aevm4ithv******** | my-favourite-bus | b1g681qpemb4******** | ACTIVE | true                |
    | f66m2q222n92******** | my-bus-42        | b1g681qpemb4******** | ACTIVE | false               |
    +----------------------+------------------+----------------------+--------+---------------------+
    
  5. Create a file with the request body, e.g., body.json:

    {
      "bus_id": "<bus_ID>",
      "body": "<event>"
    }
    

    Where:

    • bus_id: ID of the bus you are sending the event to.
    • body: Event in JSON format, e.g., {'name': 'value'}.
  6. Run a gRPC call by specifying the path to the body.json file you created earlier:

    grpcurl \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d @ < body.json \
      events.eventrouter.serverless.yandexcloud.net:443 yandex.cloud.serverless.eventrouter.v1.EventService/Put
    

Was the article helpful?

Previous
Deleting a bus
Next
Sending events using a connector
© 2025 Direct Cursus Technology L.L.C.