Mastodon-compatible webhooks #7844

Open
mkljczk wants to merge 14 commits from mkljczk/pleroma:webhooks into develop
Owner

Intended to work like the new Mastodon feature.

Webhooks would benefit automation through the moderation API by notifying applications about system events in real-time. They would also enable integrations with chat apps like Discord, IRC and Slack, helping moderator coordination.

Events currently supported:

  • report.created
  • account.created

The X-Hub-Signature header adopted from the WebSub spec can be optionally used to verify that the payloads are authentic.

The payload delivered to the webhook has the form of:

{
  "event": "report.created",
  "created_at": "2022-06-08T12:28:31.000Z",
  "object": {
    // The report entity would be here
  }
}

Mind that created_at at the top-level refers to the event itself, and not the object.

Intended to work like the [~~new~~ Mastodon feature](https://github.com/mastodon/mastodon/pull/18510). > Webhooks would benefit automation through the moderation API by notifying applications about system events in real-time. They would also enable integrations with chat apps like Discord, IRC and Slack, helping moderator coordination. > > Events currently supported: > > * `report.created` > * `account.created` > > The `X-Hub-Signature` header adopted from the WebSub spec can be optionally used to verify that the payloads are authentic. > > The payload delivered to the webhook has the form of: > ``` > { > "event": "report.created", > "created_at": "2022-06-08T12:28:31.000Z", > "object": { > // The report entity would be here > } > } > ``` > Mind that `created_at` at the top-level refers to the event itself, and not the `object`.
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
# Conflicts:
#   config/config.exs
#   lib/pleroma/application.ex
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: mkljczk <git@mkljczk.pl>
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Use encode16(case: :lower)
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
b56484df4b
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
mkljczk force-pushed webhooks from b56484df4b
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending approval
to e4f2f0994c 2026-02-27 22:16:45 +00:00
Compare
Merge branch 'develop' into webhooks
Some checks failed
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline failed
133fc64472
Merge branch 'develop' into webhooks
Some checks failed
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline failed
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline failed
83dcc4ae36
Fix webhook create test expectations
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
afe33bcc44
Merge branch 'develop' into webhooks
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
f5f63bbc74
Harden webhook API input
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
ab634a4aa3
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/docker-armv7 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u webhooks:mkljczk-webhooks
git switch mkljczk-webhooks

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff mkljczk-webhooks
git switch mkljczk-webhooks
git rebase develop
git switch develop
git merge --ff-only mkljczk-webhooks
git switch mkljczk-webhooks
git rebase develop
git switch develop
git merge --no-ff mkljczk-webhooks
git switch develop
git merge --squash mkljczk-webhooks
git switch develop
git merge --ff-only mkljczk-webhooks
git switch develop
git merge mkljczk-webhooks
git push origin develop
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma!7844
No description provided.