logo
  • Core Gateway
  • Documentation
  • Blog
  • Pricing
  • About
  • Sign In
    Start your project
Blog
Product Update

Publish an event to multiple endpoints using convoy

2 min read March 09, 2022

Written by

Daniel Oluojomu
Daniel Oluojomu

Backend Engineer

Share

One common scenario in publishing webhook events is enabling users to provide multiple endpoints to receive events. One easy example is publishing an event that the user needs to process at more than one location. This location could be a no-code platform like zapier, a newly minted microservice or serverless function, or a good old slack notification. In this article, I’d like to explain how you can achieve this using Convoy.

multiple endpoints

Without Convoy, your users have to build in the fan-out mechanism themselves, which is more stressful.

Prerequisites

To follow along you would need the following

  1. A Convoy Cloud account.
  2. An Outgoing Project ID & API Key.

Steps

Create Two Endpoints

First, we have to create two endpoints with the same owner_id , you can think of owner_idas an id used to group multiple endpoints under one entity e.g merchant.

For the first endpoint:

Sample Payload
{
  "description": "test-endpoint-1",
  "owner_id": "<your-owner-id>",
  "events": [ "*" ],
  "secret": "12345",
  "url": "https://<your-endpoint-url>"
}
Bash
$ curl \
    --request POST \
    --data @endpoint-1.json \
    -H "Content-Type: application/json" \
    https://dashboard.getconvoy.io/api/v1/projects/{projectID}/endpoints
{
	"status": true,
	"message": "Endpoint created successfully",
	"data": {
		"uid": "7556a922-7d10-47b1-b254-4dde679d9fbd",
		"project_id": "acc1bf6d-c309-4a99-b9a7-a9410fa5f6c4",
		"target_url": "https://<your-endpoint-url>",
		"owner_id": "<your-owner-id>",
		"title": "test_endpoint_1",
		"secrets": [
			{
				"uid": "72e9d70f-b57e-4f49-b098-01e8ea9795e7",
				"value": "1234",
				"created_at": "2022-12-15T13:38:01.638Z",
				"updated_at": "2022-12-15T13:38:01.638Z"
			}
		],
		"advanced_signatures": false,
		"description": "xx",
		"http_timeout": "",
		"rate_limit": 5000,
		"rate_limit_duration": "1m0s",
		"authentication": null,
		"created_at": "2022-12-15T13:38:01.638Z",
		"updated_at": "2022-12-15T13:38:01.638Z"
	}
}

For the second endpoint:

Sample Payload
{
  "description": "test-endpoint-2",
  "owner_id": "<your-owner-id>",
  "events": [ "*" ],
  "secret": "12345",
  "url": "https://<your-endpoint-url>"
}
Bash
$ curl \
    --request POST \
    --data @endpoint-2.json \
    -H "Content-Type: application/json" \
    https://dashboard.getconvoy.io/api/v1/projects/{projectID}/endpoints
{
	"status": true,
	"message": "Endpoint created successfully",
	"data": {
		"uid": "7556a922-7d10-47b1-b254-4dde679d9fbd",
		"project_id": "acc1bf6d-c309-4a99-b9a7-a9410fa5f6c4",
		"owner_id": "<your-owner-id>",
		"target_url": "https://<your-endpoint-url>",
		"title": "test_endpoint_2",
		"secrets": [
			{
				"uid": "89e9d70f-b57e-4f49-b098-01e8ea9795e7",
				"value": "1234",
				"created_at": "2022-12-15T13:38:01.638Z",
				"updated_at": "2022-12-15T13:38:01.638Z"
			}
		],
		"advanced_signatures": false,
		"description": "xx",
		"http_timeout": "",
		"rate_limit": 5000,
		"rate_limit_duration": "1m0s",
		"authentication": null,
		"created_at": "2022-12-15T13:38:01.638Z",
		"updated_at": "2022-12-15T13:38:01.638Z"
	}
}

Create One Subscription for Each Endpoint

Now we have to create subscriptions for each endpoint.

Sample Payload
{
  "endpoint_id": "<your-endpoint-id>",
  "name": "test-sub-1"
}
Bash
$ curl \
    --request POST \
    --data @subscription-1.json \
    -H "Content-Type: application/json" \
    https://dashboard.getconvoy.io/api/v1/projects/{projectID}/subscriptions
{
	"status": true,
	"message": "Subscription created successfully",
	"data": {
  	  "uid": "eb1e6167-d076-4366-b458-2ca7e358986e",
	  "endpoint_id": "<your-endpoint-id>",
		"name": "test-sub-1",
		"type": "api",
		"status": "active",
		"filter_config": {
			"event_types": [
				"*"
			],
			"filter": {}
		},
		"created_at": "2022-12-15T13:56:22.256Z",
		"updated_at": "2022-12-15T13:56:22.256Z"
	}
}

Repeat the same for the second subscription.

Publish Event

Now let us publish an event with the type to our endpoints. We’ll specify the owner_id we used for both endpoints, this allows convoy to dispatch the event to both endpoints.

Sample Payload
{
  "owner_id": "<your-owner-id>",
  "data": {
		"blog": "https://getconvoy.io/blog"
	},
  "event_type": "ping"
}
Bash
$ curl \
    --request POST \
    --data @event.json \
    -H "Content-Type: application/json" \
    https://dashboard.getconvoy.io/api/v1/projects/{projectID}/events
{
	"status": true,
	"message": "Endpoint event created successfully",
	"data": {
		"uid": "cdff6a37-8a41-412b-aa55-748cdefd8017",
		"event_type": "ping",
		"project_id": "acc1bf6d-c309-4a99-b9a7-a9410fa5f6c4",
		"endpoints": [
			"b5e4d42e-3ad6-4546-9f88-4f36b3f82941",
			"7556a922-7d10-47b1-b254-4dde679d9fbd"
		],
		"data": {
			"blog": "https://getconvoy.io/blog"
		},
		"created_at": "2022-12-15T13:39:45.276Z",
		"updated_at": "2022-12-15T13:39:45.276Z"
	}
}

Show Endpoint Response

The screenshots below show that the events were routed to the two endpoints.

Endpoint-1 Webhook
Endpoint-2 Webhook

Conclusion

In this post, we discussed why letting your users provide multiple endpoints is important. We demostrated this ability in Convoy and how to use it. Sounds good for your platform? Why not try out our free cloud and give us feedback on our slack community!

Till next time ✌🏽

Getting started with Convoy?

Want to add webhooks to your API in minutes? Sign up to get started.

Sign up

Related Posts

What I’ve learned from talking to users as a Technical Founder

April 23, 2025

It’s widely accepted that the two most important things a startup needs to get right are building a great product and talking to users. As a technical founder, building has always come naturally to me. Talking to users? Not so much. In this post, i’ll share some of the misconceptions I had about talking to users—and the surprising benefits I’ve discovered from doing it consistently.

Subomi Oluwalana
Subomi Oluwalana

Co-Founder & CEO

Transactional Outbox: How to reliably generate webhook events

April 17, 2025

In the world of distributed systems, ensuring reliable event delivery is crucial, especially when dealing with webhooks. The transactional outbox pattern has emerged as a robust solution to this challenge. In this post, we'll explore how to implement this pattern to guarantee reliable webhook delivery, even in the face of system failures.

Subomi Oluwalana
Subomi Oluwalana

Co-Founder & CEO

logo

2261 Market Street, San Francisco, CA 94114

Companyaccordion icon

About Us

Trust Center

Terms of Use

Privacy Policy

DPA

Productaccordion icon

Open Source

Core Gateway

Cloud

Convoy Playground

Resourcesaccordion icon

API Reference

Documentation

Status Page

Roadmap

What are Webhooks?

Convoy vs. Internal Implementation

Speak to usaccordion icon

Slack

Follow Us

Copyright 2025, All Rights Reserved

soc stamp