Quantcast
Channel: Mattermost Discussion Forums - Latest posts
Viewing all articles
Browse latest Browse all 25778

Is there support for creating webhooks using Mattermost API?

$
0
0

Hi @keithg,

There are actually APIs for adding webhooks, but our documentation is incomplete at this time. It includes most of the commonly used ones, but still doesn't contain everything used by the web app.

For incoming webhooks, there are a few routes that either require a user on the team or a team admin/system admin depending on if Integrations > Custom Integrations > Restrict managing integrations to Admins is enabled in the System console.

  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/incoming/create (POST) which takes a JSON-formatted IncomingWebhook as the body and returns it with its ID field set
  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/incoming/delete (POST) which takes a JSON object like {id: ID} as the body and returns its argument
  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/incoming/list (GET) which returns a list of all incoming webhooks for that team

For outgoing webhooks, the routes are mostly the same with the same permissions except for an additional route to regenerate an outgoing webhook's token

  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/create (POST) which takes a JSON-formatted OutgoingWebhook as the body and returns it with its ID field set
  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/delete (POST) which takes a JSON object like {id: ID} as the body and returns its argument
  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/list (GET) which returns a list of all outgoing webhooks for that team
  • api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/regen_token (POST) which takes a JSON object like {id: ID} as the body and returns the webhook with its updated token field set

Viewing all articles
Browse latest Browse all 25778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>