Update Integration
    • Dark
      Light
    • PDF

    Update Integration

    • Dark
      Light
    • PDF

    Article summary

    Put
    /api/v1/integrations.update

    Update an existing integration.

    Permissions required:

    • manage-incoming-integrations
    • manage-own-incoming-integrations
    • manage-outgoing-integrations
    • manage-own-outgoing-integrations

    Changelog

    VersionDescription
    3.4.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authorization token of the user.

    Example9HqLlyZOugD_0YdwAJF8V47U3QHXSq
    X-User-Id
    stringRequired

    The user ID of the user.

    ExampleaobEdbYhXfu5hkeqG
    Body parameters
    Example 1
    {
      "type": "webhook-incoming",
      "name": "Test",
      "enabled": false,
      "username": "rocket.cat",
      "scriptEnabled": false,
      "channel": "#test",
      "integrationId": "x3tPXa9XXRqW6Xp2M"
    }
    object
    type
    string Required

    The type of integration. The possible values are:

    • webhook-outgoing
    • webhook-incoming
    name
    string Required

    The name of the integration.

    enabled
    boolean Required

    Whether this integration should be enabled or not.

    username
    string Required

    The username to post this the messages as.

    scriptEnabled
    boolean Required

    Whether the script should be enabled.

    channel
    string Required

    The channel, group, or @username. The values can also be all_public_channels, all_private_groups, or all_direct_messages. Comma separated for more than one.

    integrationId
    string Required

    The integration ID.

    urls
    Array of string

    The urls to call whenever this integration is triggered.

    string
    event
    string

    This field is required only for outgoing integrations. The type of event can be any of these: sendMessage, fileUploaded, roomArchived, roomCreated, roomJoined, roomLeft, userCreated.

    triggerWords
    string

    Specific words, separated by commas, which should trigger this integration.

    alias
    string

    The alias which should be applied to messages when this integration is processed.

    avatar
    string

    The logo to apply to the messages that this integration sends.

    Examplehttp://res.guggy.com/logo_128.png
    emoji
    string

    The emoji which should be displayed as the avatar for messages from this integration.

    Example:ghost:
    token
    string

    If your integration requires a special token from the server (API key), use this parameter.

    script
    string

    Script triggered when this integration is triggered.

    targetChannel
    string

    The channel where messages will be sent to.

    target_url
    string

    The target url to set.

    Responses
    200
    Success Example
    {
      "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": "rod"
        },
        "_updatedAt": "2021-10-22T16:08:39.843Z",
        "_updatedBy": {
          "_id": "d26x6zSkaPSe5gCyy",
          "username": "rod"
        }
      },
      "success": true
    }
    Expand All
    object
    integration
    object
    _id
    string
    enabled
    boolean
    channel
    Array of string
    string
    username
    string
    name
    string
    alias
    string
    avatarUrl
    string
    emoji
    string
    scriptEnabled
    boolean
    script
    string
    type
    string
    token
    string
    userId
    string
    _createdAt
    string
    _createdBy
    object
    _id
    string
    username
    string
    _updatedAt
    string
    _updatedBy
    object
    _id
    string
    username
    string
    success
    boolean
    400

    Bad Request

    Example 1
    {
      "success": false,
      "error": "must have required property 'type'\n must have required property 'type'\n must match exactly one schema in oneOf [invalid-params]",
      "errorType": "invalid-params"
    }
    Example 2
    {
      "success": false,
      "error": "must have required property 'integrationId'\n must have required property 'type'\n must match exactly one schema in oneOf [invalid-params]",
      "errorType": "invalid-params"
    }
    Example 3
    {
      "success": false,
      "error": "No integration found."
    }
    object
    success
    boolean
    error
    string
    errorType
    string
    401

    Unauthorized

    Authorization Error
    {
      "status": "error",
      "message": "You must be logged in to do this."
    }
    object
    status
    string
    message
    string

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.