Specifying different urls for webhooks for different instances

Is it possible to have a single connect app that registers for webhook events, but be able to specify different webhook urls for each different install of the app? i.e. configure the webhook so that webhooks for a each jira/confluence instance goes to a different url?

It depends on what you want to achieve: if you want to know which Jira/Confluence instance the webhook requests originates from, you can get this information from the JWT. See also https://developer.atlassian.com/cloud/jira/platform/webhooks/

Alternatively, you can also use Dynamic Modules to register the web hook dynamically. This will allow you to use different URL’s for each instance. See https://developer.atlassian.com/cloud/jira/platform/webhooks/#registering-a-webhook-via-the-rest-api--for-connect-apps-

Thanks! Do you know if there are REST APIs for webhooks for Confluence cloud as well?

Yes, but it’s generic. You need to use Dynamic Modules (see https://developer.atlassian.com/cloud/confluence/rest/api-group-dynamic-modules/#api-atlassian-connect-1-app-module-dynamic-get).

There is more information about Dynamic Modules here Connect dynamic modules and specific for Webhooks here https://developer.atlassian.com/cloud/confluence/modules/webhook/

Unfortunately, I don’t think there are specific examples for webhooks, so you will need to connect the dots yourself.