Structure of Webhook

Before using Webhooks you have to know the structure. All elements listed here are optional but the minimal requirement is non-empty content or embeds fields.

  • username - overrides the current username of the webhook
  • avatar_url - if used, it overrides the default avatar of the webhook
  • content - a simple message, the message contains (up to 2000 characters)
  • tts - if true, the message will be pronounced in chat like tts message
  • embeds - an array of embed objects. That means you put use more than one in the same body

    • color - color code of the embed. You have to use Decimal numeral system, not Hexadecimal. You can use SpyColor for that. It has a decimal number converter.
    • author - embed author object

      • name - name of author
      • url - url of author. If name was used, it becomes a hyperlink
      • icon_url - url of author icon
    • title - title of embed

    • url - url of embed. If title was used, it becomes hyperlink
    • description - description text
    • fields - array of embed field objects

      • name - the name of the field
      • value - the value of the field
      • inline - if true, fields will be displayed in the same line, but there can only be 3 max in the same line or 2 max if you used thumbnail
    • thumbnail - embed thumbnail object

      • url - url of thumbnail
    • image - embed image object

      • url - image url
    • footer - embed footer object

      • text - footer text, doesn't support Markdown
      • icon_url - url of footer icon
    • timestamp - ISO8601 timestamp (yyyy-mm-ddThh:mm:ss.msZ)

Webhook example

{
  "username": "Webhook",
  "avatar_url": "https://i.imgur.com/4M34hi2.png",
  "content": "Text message. Up to 2000 characters.",
  "embeds": [
    {
      "author": {
        "name": "Birdie♫",
        "url": "https://www.reddit.com/r/cats/",
        "icon_url": "https://i.imgur.com/R66g1Pe.jpg"
      },
      "title": "Title",
      "url": "https://google.com/",
      "description": "Text message. You can use Markdown here. *Italic* **bold** __underline__ ~~strikeout~~ [hyperlink](https://google.com) `code`",
      "color": 15258703,
      "fields": [
        {
          "name": "Text",
          "value": "More text",
          "inline": true
        },
        {
          "name": "Even more text",
          "value": "Yup",
          "inline": true
        },
        {
          "name": "Use `\"inline\": true` parameter, if you want to display fields in the same line.",
          "value": "okay..."
        },
        {
          "name": "Thanks!",
          "value": "You're welcome :wink:"
        }
      ],
      "thumbnail": {
        "url": "https://upload.wikimedia.org/wikipedia/commons/3/38/4-Nature-Wallpapers-2014-1_ukaavUI.jpg"
      },
      "image": {
        "url": "https://upload.wikimedia.org/wikipedia/commons/5/5a/A_picture_from_China_every_day_108.jpg"
      },
      "footer": {
        "text": "Woah! So cool! :smirk:",
        "icon_url": "https://i.imgur.com/fKL31aD.jpg"
      }
    }
  ]
}

And how it looks

webhook result example