To update an integration, the callee needs to have the permissions manage-incoming-integrations
AND manage-own-incoming-integrations
permissions to be able to update incoming integrations and manage-outgoing-integrations
AND manage-own-outgoing-integrations
to be able to update outgoing integrations.
HTTP Method | URL | Requires Auth |
---|---|---|
PUT | /api/v1/integrations.update | yes |
Key | Example Value | Description |
---|---|---|
type * | webhook-outgoing | The type of integration to update, webhook-outgoing and webhook-incoming are supported. |
name * | Guggy | The name of the integration only is shown in the Administration area. |
enabled * | true | Whether this integration should be enabled or not. |
username * | rocket.cat | The username who to post this the messages as. |
channel * | #general | The channel, group, or @username . Can also be all_public_channels , all_private_groups , or all_direct_messages . Comma separated for more than one. |
scriptEnabled * | false | Whether the script should be enabled. |
integrationId * | ncjK_idsnms | The integration ID that you want to update. |
urls | ['http://text2gif.guggy.com/guggify'] | The urls to call whenever this integration is triggered. |
event | sendMessage | This field is required only for outgoing integration. The type of event can be any of these: |
triggerWords | !guggy | Specific words, separated by commas, which should trigger this integration. |
alias | Guggy | The alias which should be applied to messages when this integration is processed. |
avatar | http://res.guggy.com/logo_128.png | The logo to apply to the messages that this integration sends. |
emoji | :ghost: | The emoji which should be displayed as the avatar for messages from this integration. |
token | 8DFS89DMKLWEN | If your integration requires a special token from the server (api key), use this. |
script | Integrations | Script triggered when this integration is triggered. |
targetChannel | targeted channel | The channel where messages will be sent to. |
target_url | open.rocket.chat | The target url to set. |
{
"type": "webhook-incoming",
"name": "Test",
"enabled": false,
"username": "rocket.cat",
"scriptEnabled": false,
"channel": "#test",
"integrationId": "x3tPXa9XXRqW6Xp2M"
}
curl -L -X PUT 'http://localhost:3000/api/v1/integrations.update' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92' \
-H 'Content-Type: application/json' \
--data-raw '{
"type": "webhook-incoming",
"name": "Test",
"enabled": false,
"username": "rocket.cat",
"scriptEnabled": false,
"channel": "#test",
"integrationId": "x3tPXa9XXRqW6Xp2M"
}'
{
"integration": {
"_id": "x3tPXa9XXRqW6Xp2M",
"enabled": false,
"channel": [
"#test"
],
"username": "rodriq",
"name": "Test",
"alias": "Jim",
"avatarUrl": "",
"emoji": ":ghost:",
"scriptEnabled": false,
"script": "console.log(\"MANNNNN ---------------------------------------------------------\")",
"type": "webhook-incoming",
"token": "XYsrkngRr5PBkWhCqJWk5ZfKzQoxSv4QhxkK5trSgJENwbRL",
"userId": "d26x6zSkaPSe5gCyy",
"_createdAt": "2021-10-22T14:48:46.025Z",
"_createdBy": {
"_id": "d26x6zSkaPSe5gCyy",
"username": "rodriq"
},
"_updatedAt": "2021-10-22T16:08:39.843Z",
"_updatedBy": {
"_id": "d26x6zSkaPSe5gCyy",
"username": "rodriq"
}
},
"success": true
}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- Missing Key: Triggers when the endpoint is called without any required endpoint.
- No integration Found: You get this error when the integration you're trying to update is not found.
{% tabs %} {% tab title=" Authorization" %}
{
"success": false,
"error": "unauthorized"
}
{% endtab %}
{% tab title="Missing Key" %}
{
"success": false,
"error": "Match error: Missing key '<key name>'"
}
{% endtab %}
{% tab title="No Integration Found" %}
{
"success": false,
"error": "No integration found."
}
{% endtab %} {% endtabs %}
Version | Description |
---|---|
3.4.0 | Added |