Files
upstream-mattermost/api/v4/source/webhooks.yaml
upstream-mirror 240db4e2a7
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
2026-09-16 00:29:55 +05:00

535 lines
18 KiB
YAML

/api/v4/hooks/incoming:
post:
tags:
- webhooks
summary: Create an incoming webhook
description: |
Create an incoming webhook for a channel.
##### Permissions
`manage_webhooks` for the team the webhook is in.
`manage_others_incoming_webhooks` for the team the webhook is in if the user is different than the requester.
operationId: CreateIncomingWebhook
requestBody:
content:
application/json:
schema:
type: object
required:
- channel_id
properties:
channel_id:
type: string
description: The ID of a public channel or private group that receives
the webhook payloads.
user_id:
type: string
description: The ID of the owner of the webhook if different than the requester. Required for [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode).
display_name:
type: string
description: The display name for this incoming webhook
description:
type: string
description: The description for this incoming webhook
username:
type: string
description: The username this incoming webhook will post as.
icon_url:
type: string
description: The profile picture this incoming webhook will use when
posting.
channel_locked:
type: boolean
description: Whether the webhook is locked to the channel.
description: Incoming webhook to be created
required: true
responses:
"201":
description: Incoming webhook creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/IncomingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
get:
tags:
- webhooks
summary: List incoming webhooks
description: >
Get a page of a list of incoming webhooks. Optionally filter for a
specific team using query parameters.
##### Permissions
`manage_webhooks` for the system or `manage_webhooks` for the specific team.
operationId: GetIncomingWebhooks
parameters:
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of hooks per page.
schema:
type: integer
default: 60
- name: team_id
in: query
description: The ID of the team to get hooks for.
schema:
type: string
- name: include_total_count
description: >-
Appends a total count of returned hooks inside the response object - ex: `{ "incoming_webhooks": [], "total_count": 0 }`.
in: query
schema:
type: boolean
default: false
responses:
"200":
description: Incoming webhooks retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/IncomingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/hooks/incoming/{hook_id}":
get:
tags:
- webhooks
summary: Get an incoming webhook
description: >
Get an incoming webhook given the hook id.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: GetIncomingWebhook
parameters:
- name: hook_id
in: path
description: Incoming Webhook GUID
required: true
schema:
type: string
responses:
"200":
description: Webhook retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/IncomingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
delete:
tags:
- webhooks
summary: Delete an incoming webhook
description: >
Delete an incoming webhook given the hook id.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: DeleteIncomingWebhook
parameters:
- name: hook_id
in: path
description: Incoming webhook GUID
required: true
schema:
type: string
responses:
"200":
description: Webhook deletion successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
put:
tags:
- webhooks
summary: Update an incoming webhook
description: >
Update an incoming webhook given the hook id.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: UpdateIncomingWebhook
parameters:
- name: hook_id
in: path
description: Incoming Webhook GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- id
- channel_id
- display_name
- description
properties:
id:
type: string
description: Incoming webhook GUID
channel_id:
type: string
description: The ID of a public channel or private group that receives
the webhook payloads.
display_name:
type: string
description: The display name for this incoming webhook
description:
type: string
description: The description for this incoming webhook
username:
type: string
description: The username this incoming webhook will post as.
icon_url:
type: string
description: The profile picture this incoming webhook will use when
posting.
channel_locked:
type: boolean
description: Whether the webhook is locked to the channel.
description: Incoming webhook to be updated
required: true
responses:
"200":
description: Webhook update successful
content:
application/json:
schema:
$ref: "#/components/schemas/IncomingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
/api/v4/hooks/outgoing:
post:
tags:
- webhooks
summary: Create an outgoing webhook
description: |
Create an outgoing webhook for a team.
##### Permissions
`manage_webhooks` for the team the webhook is in.
`manage_others_outgoing_webhooks` for the team the webhook is in if the user is different than the requester.
operationId: CreateOutgoingWebhook
requestBody:
content:
application/json:
schema:
type: object
required:
- team_id
- display_name
- trigger_words
- callback_urls
properties:
team_id:
description: The ID of the team that the webhook watchs
type: string
channel_id:
description: The ID of a public channel that the webhook watchs
type: string
creator_id:
description: The ID of the owner of the webhook if different than the requester. Required in [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode).
type: string
description:
description: The description for this outgoing webhook
type: string
display_name:
description: The display name for this outgoing webhook
type: string
trigger_words:
description: List of words for the webhook to trigger on
type: array
items:
type: string
trigger_when:
description: When to trigger the webhook, `0` when a trigger word is
present at all and `1` if the message starts with a trigger
word
type: integer
callback_urls:
description: The URLs to POST the payloads to when the webhook is
triggered
type: array
items:
type: string
content_type:
description: The format to POST the data in, either `application/json` or
`application/x-www-form-urlencoded`
default: application/x-www-form-urlencoded
type: string
description: Outgoing webhook to be created
required: true
responses:
"201":
description: Outgoing webhook creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/OutgoingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
get:
tags:
- webhooks
summary: List outgoing webhooks
description: >
Get a page of a list of outgoing webhooks. Optionally filter for a
specific team or channel using query parameters.
##### Permissions
`manage_webhooks` for the system or `manage_webhooks` for the specific team/channel.
operationId: GetOutgoingWebhooks
parameters:
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of hooks per page.
schema:
type: integer
default: 60
- name: team_id
in: query
description: The ID of the team to get hooks for.
schema:
type: string
- name: channel_id
in: query
description: The ID of the channel to get hooks for.
schema:
type: string
responses:
"200":
description: Outgoing webhooks retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/OutgoingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/hooks/outgoing/{hook_id}":
get:
tags:
- webhooks
summary: Get an outgoing webhook
description: >
Get an outgoing webhook given the hook id.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: GetOutgoingWebhook
parameters:
- name: hook_id
in: path
description: Outgoing webhook GUID
required: true
schema:
type: string
responses:
"200":
description: Outgoing webhook retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/OutgoingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
delete:
tags:
- webhooks
summary: Delete an outgoing webhook
description: >
Delete an outgoing webhook given the hook id.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: DeleteOutgoingWebhook
parameters:
- name: hook_id
in: path
description: Outgoing webhook GUID
required: true
schema:
type: string
responses:
"200":
description: Webhook deletion successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
put:
tags:
- webhooks
summary: Update an outgoing webhook
description: >
Update an outgoing webhook given the hook id.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: UpdateOutgoingWebhook
parameters:
- name: hook_id
in: path
description: outgoing Webhook GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- id
- channel_id
- display_name
- description
properties:
id:
type: string
description: Outgoing webhook GUID
channel_id:
type: string
description: The ID of a public channel or private group that receives
the webhook payloads.
display_name:
type: string
description: The display name for this incoming webhook
description:
type: string
description: The description for this incoming webhook
description: Outgoing webhook to be updated
required: true
responses:
"200":
description: Webhook update successful
content:
application/json:
schema:
$ref: "#/components/schemas/OutgoingWebhook"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/hooks/outgoing/{hook_id}/regen_token":
post:
tags:
- webhooks
summary: Regenerate the token for the outgoing webhook.
description: >
Regenerate the token for the outgoing webhook.
##### Permissions
`manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
operationId: RegenOutgoingHookToken
parameters:
- name: hook_id
in: path
description: Outgoing webhook GUID
required: true
schema:
type: string
responses:
"200":
description: Webhook token regenerate successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"