LogoLogo
  • Get Started
    • Glue 101
    • Getting started for admins
    • Getting started for users
    • Download apps
    • Help & support
    • Keyboard shortcuts
  • Workspaces
    • Workspaces
    • Workspace Settings
    • Multiple workspaces
    • External Users
      • Using Glue without a workspace
    • Custom emojis
  • Groups
    • Groups Overview
    • Group Settings
      • Admin settings for groups
      • Group notification settings
    • Group Directory
  • Conversations
    • Introduction to Messaging in Glue
    • Threads
      • Creating new Threads
      • Create a thread from an existing message
      • Managing Threads
      • Thread Permissions
    • Group chat
    • Direct messages
  • Inbox
    • Inbox
    • Bulk actions
    • Search
  • Glue AI
    • Glue AI
  • Feed
    • Feed
  • Account Profile and Preferences
    • Account Setup
    • Profile
    • Preferences
    • Push Notifications
      • Notification Troubleshooting
  • For admins
    • Workspace setup
    • Slack import
      • Custom emoji import
    • Group setup
    • Manage workspace members
    • Security
    • Billing
  • Integrations
    • Glue Integrations Overview
    • Webhooks
    • Zapier apps
    • GitHub
    • Typeform
    • ClickUp
    • Monday.com
    • Zoom
    • Google Meet
    • CircleCI
    • Sentry
    • Google Drive
    • Coming soon
  • Labs
    • MCP Servers
  • Release notes
    • Release Notes
  • FAQ
    • Miscellaneous
    • Troubleshooting Questions
Powered by GitBook
On this page
  • Overview
  • Create a webhook
  • Obtain a target ID
  • Webhook payload
  • Examples
  • Coming soon

Was this helpful?

  1. Integrations

Webhooks

PreviousGlue Integrations OverviewNextZapier apps

Last updated 9 months ago

Was this helpful?

Overview

Webhooks allow you to send messages and create threads inside of Glue by making a simple POST to the webhook endpoint. Here is a basic example that sends a message to the group chat for the group with ID grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk",
    "text": "New bug reported!"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

Create a webhook

In Glue, navigate to the Apps section of the workspace settings.

Locate Webhook in the list and click Add.

Enter a name and description, and then click Create.

After creating, you can see and copy the URL for the webhook.

Obtain a target ID

In order to send a webhook, you'll need the ID of a group or thread.

To do this, navigate to the appropriate group or thread, open the menu, and then select Copy share link.

Paste the link and then look for an identifier in the URL. Group IDs start with grp_... and thread IDs start with thr_...

If you are using the app from your browser, you can also look for these values in the URL bar. Note that at times, multiple IDs may be present depending on what you're viewing.

In this case, you can see the group ID of grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk in the following URL:

https://app.gluegroups.com/grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk?t=Chat

Use this value in the target field of your webhook payload.

Webhook payload

Here are the fields that you can send to the webhook endpoint. These fields should be sent as JSON with Content-Type application/json .

Field
Description

text

Required. The text of the message to send. By default, this is treated as markdown.

target

Required. The ID of a thread or group to send to.

For a group, a message will be sent to the chat unless a threadSubject is specific - in this case a thread will be created in the group instead.

For a thread, a message will be sent to the thread. When specifying a thread target, you cannot create threads by specifying a threadSubject. Note: For the workspace wide, "General" group, the workspace id (wks_...) functions as the group ID. Use the full ID including "wks_".

threadSubject

If specified, a thread will be created instead of just sending a message.

The target must be a group if a subject is specified.

uniqueBy

Specify a value here to be able to update this message after it is created. If you call the webhook again with the same value, it will update the existing message instead of generating a new one. The uniqueBy value should be unique for the the thread or chat that the message is sent to.

threadBy

If specified, the webhook will send follow up messages to created threads with the same value. The first message will create the thread and then the following messages will be appending to that thread.

Examples

At a minimum, you must specify a target and text to send a message via a webhook.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "thr_2hTJ4DGsxUAeEhKOyJ2PMePFL0c",
    "text": "New bug reported!"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

The additional examples below demonstrate more advanced functionality.

Example: Sending and updating a message

To send a message, simply provide a target field with a thread or group ID and a text field with the message text. Optionally, you can pass a uniqueBy value that you can use to update the message by calling the webhook again with the same value.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "thr_2hTJ4DGsxUAeEhKOyJ2PMePFL0c",
    "text": "New bug reported: [BUG154](https://example.com/BUG154)",
    "uniqueBy": "BUG154"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

To update the previously sent message, call the webhook again with the same uniqueBy value.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "thr_2hTJ4DGsxUAeEhKOyJ2PMePFL0c",
    "text": "New bug reported: [BUG154](https://example.com/BUG154) \n\nResolved by Jason",
    "uniqueBy": "BUG154"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

To generate a new message, simply provide a new uniqueBy value, or omit the uniqueBy value if you do not need to update the message.

Example: Formatting messages

Glue uses webhooks to format messages. The following features are supported:

  • Text styling

    • Bold

    • Italics

    • Strikethrough

  • Links

  • User mentions

  • Inline code

  • Code blocks

  • Blockquotes

  • Paragraphs

  • Lists

    • Ordered

    • Unordered

These features are described in detail below.

1. Text Styling

Bold

To make text bold, wrap it with two asterisks (**) or two underscores (__). For example:

**This is bold text**
__This is also bold text__

Displays as:

Italics

To italicize text, wrap it with one asterisk (*) or one underscore (_). For example:

*This is italic text*
_This is also italic text_

Displays as:

Strikethrough

To strikethrough text, wrap it with two tildes (~~). For example:

~~This text is strikethrough~~

Displays as:

Bold and Italics Combined

You can combine bold and italics for even more emphasis. For example:

***This is bold and italic text***
___This is also bold and italic text___

Displays as:

2. Links

To create a hyperlink, use square brackets [ ] to set the text and parentheses ( ) to set the URL. For example:

[Glue](https://glue.ai)

Displays as:

User Mentions

To mention a user in our chat app, use the following format:

[Jason Yonker](glue:usr_2PtTG7GFSgcgwfpeDOBGEQtyB24)

Displays as:

3. Inline Code

To include inline code, wrap your text with backticks (`). For example:

Here is some inline code: `print("Hello, World!")`

Displays as:

4. Code Blocks

For longer code snippets, use triple backticks (```) before and after your code block. You can also specify the language for syntax highlighting. For example:

```python
for i in range(10):
    print(i)
```

Displays as:

5. Blockquotes

To create a blockquote, use the greater than (>) symbol followed by a space. For example:

> This is a blockquote.

Displays as:

6. Paragraphs

To create paragraphs, simply separate your text with one or more blank lines. For example:

This is the first paragraph.

This is the second paragraph.

Displays as:

7. Lists

Unordered Lists

To create an unordered list, use -, *, or + followed by a space. For example:

- Item 1
- Item 2
  - Subitem 1
  - Subitem 2
* Item 3
+ Item 4

Displays as:

Ordered Lists

To create an ordered list, use numbers followed by a period and a space. For example:

1. First item
2. Second item
   1. Subitem 1
   2. Subitem 2
3. Third item

Displays as:

Example: Creating threads

To create a thread instead of just sending a message, specify a threadSubject and ensure that the target value is a group. This will result in a thread created in the group with the subject of threadSubject and starter message from text. The threadBy and uniqueBy values are optional values that let us update this message (uniqueBy) and post more messages to the thread (threadBy).

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk",
    "threadSubject": "New crash in main.js",
    "text": "ReferenceError: reference to undefined property x",
    "threadBy": "BUG268",
    "uniqueBy": "BUG268-starter-message"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

When you specify a threadBy value, you can send follow up messages to the thread by calling the webhook again with the same threadBy value. In this case we're using the value BUG268. The value is normally and identifier from the external system that is generating the message.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk",
    "threadSubject": "New crash in main.js",
    "text": "Jason, can you look into this?",
    "threadBy": "BUG268"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

Because we specified a uniqueBy value for the starter message, we can call the webhook again to update that starter message (rather than send a new message). Here we're using "uniqueBy": "BUG268-starter-message" which is the value we passed in the first webhook to start the thread.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk",
    "threadSubject": "New crash in main.js",
    "text": "ReferenceError: reference to undefined property x \n\nAssigned to: Jason",
    "threadBy": "BUG268",
    "uniqueBy": "BUG268-starter-message"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

To create a different thread, send a new threadBy value or, if the thread by value is omitted, a new thread will alsways be created.

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "target": "grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk",
    "threadSubject": "New crash in index.js",
    "text": "ReferenceError: reference to undefined property y",
    "threadBy": "BUG269",
    "uniqueBy": "BUG269-starter-message"
  }' \
  "https://app.gluegroups.com/webhook/wbh_123.../456..."

Coming soon

  • File attachments

  • Automatic link parsing

  • Link previews

  • Option to send plain text instead of markdown for the text field