Create Integration

Creates an integration, if the callee has the permissions.

Permissions required to create incoming integrations:

  • manage-incoming-integrations

  • manage-own-incoming-integrations

Permissions required to create incoming integrations:

  • manage-outgoing-integrations

  • manage-own-outgoing-integrations

Incoming Webhook

Body Parameters

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -H "Content-type: application/json" \
     http://localhost:3000/api/v1/integrations.create \
     -d '{ 
          "type": "webhook-incoming", 
          "username": "rocket.cat", 
          "channel": "#general", 
          "scriptEnabled": false,
          "name": "testHook",
          "enabled": true }'

Example Response

{
    "integration": {
        "type": "webhook-incoming",
        "username": "rocket.cat",
        "channel": false,
        "scriptEnabled": "sendMessage",
        "name": "sendMessage",
        "enabled": "sendMessage",
        }

Outgoing Webhook

Body Parameters

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -H "Content-type: application/json" \
     http://localhost:3000/api/v1/integrations.create \
     -d '{ 
          "type": "webhook-outgoing", 
          "name": "Testing via REST API", 
          "event": "sendMessage", 
          "enabled": false, 
          "channel": "#general", 
          "username": "rocket.cat", 
          "urls": ["http://text2gif.guggy.com/guggify"], 
          "scriptEnabled": false }'

Example Response

{
    "integration": {
        "type": "webhook-outgoing",
        "name": "Testing via REST API",
        "enabled": false,
        "username": "rocket.cat",
        "event": "sendMessage",
        "urls": [
            "http://text2gif.guggy.com/guggify"
        ],
        "scriptEnabled": false,
        "userId": "rocket.cat",
        "channel": [],
        "_createdAt": "2017-01-06T13:23:46.018Z",
        "_createdBy": {
            "username": "graywolf336",
            "_id": "aobEdbYhXfu5hkeqG"
        },
        "_updatedAt": "2017-01-06T13:23:46.018Z",
        "_id": "3aazpZ2WzoBP8msi9"
    },
    "success": true
}

Change Log

Last updated

Rocket.Chat versions receive support for six months after release.