Documentation

Webhook

How to view and edit your Webhook

Request Overview

Actions

Returns

Description

GET /api/v1/webhook

Object

Get webhook

POST /api/v1/webhook

201 Object

Update webhook

GET /api/v1/webhook/logs

Collection

Get latest webhook logs

Fields

Webhook Object

Field

Type

Required

Specifics

version

String

The Webhook version which is used

headers

Array

Array of Request Headers that will send with every webhook request

enabled

Boolean

Indicates if the Webhook is active

failed_count

Number

If your Webhook endpoint returns an error, this counter will be increased until the webhooks gets automatically disabled

url

String

Your Webhook endpoint URL

secret

String

The secret we use to create a validation hash of the payload. You can use this hash to verify that the received payload has not been tempered with

trigger

Array

Array of all triggers available

trigger.ticket

Object

Object of all trigger events available for tickets Webhooks Events

trigger.customer

Object

Object of all trigger events available for customers

Webhooks Events

trigger.tag

Object

Object of all trigger events available for tags

Webhooks Events

Requests

Get Webhook Data

GET /api/v1/webhook Returns your webhook

GET /api/v1/webhook HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

200 Response

HTTP/1.1 200 OK
Content-Type: application/json
...

{
  "data": {
    "version": "V1",
    "headers": [
        {
            "key": "X-MY-CUSTOM-HEADER",
            "value": "my custom test value"
        }
    ],
    "enabled": true,
    "failed_count": 0,
    "url": "https://my-webhook-url.com/test",
    "secret": "NnhB3ga34IOiqO9rOPcR",
    "trigger": {
        "ticket": {
            "created": true,
            "assigned": true,
            "deleted": true,
            "status_updated": true,
            "tags_updated": false,
            "customer_message_created": true,
            "agent_message_created": false,
            "note_created": false
        },
        "customer": {
            "created": false,
            "updated": true,
            "deleted": false
        },
        "tag": {
            "created": true,
            "updated": true,
            "deleted": false
        }
    }
  }
}

Update Multiple Webhook Attributes

POST /api/v1/webhook Update certain attributes of your Webhook

POST /api/v1/webhook HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

{
    "webhooks": {
        "enabled": false,
        "url": "https://my-webhook-url.com/new_url",
        "trigger": {
            "ticket": {
                "created": false,
            },
            "customer": {
                "updated": false,
                "deleted": true
            }
        }
    }
}

201 Response

HTTP/1.1 201 OK
Content-Type: application/json
...

{
  "data": {
    "version": "V1",
    "headers": [
        {
            "key": "X-MY-CUSTOM-HEADER",
            "value": "my custom test value"
        }
    ],
    "enabled": false,
    "failed_count": 0,
    "url": "https://my-webhook-url.com/new_url",
    "secret": "NnhB3ga34IOiqO9rOPcR",
    "trigger": {
        "ticket": {
            "created": false,
            "assigned": true,
            "deleted": true,
            "status_updated": true,
            "tags_updated": false,
            "customer_message_created": true,
            "agent_message_created": false,
            "note_created": false
        },
        "customer": {
            "created": false,
            "updated": false,
            "deleted": true
        },
        "tag": {
            "created": true,
            "updated": true,
            "deleted": false
        }
    }
  }
}

Get Latest Error Logs

GET /api/v1/webhook/logs Returns your latest error logs

GET /api/v1/webhook/logs HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

200 Response

HTTP/1.1 200 OK
Content-Type: application/json
...

{
  "data": [
    {
        "description": "Webhook has been disabled due to many failed requests.",
        "created_at": "2022-04-01T15:12:43.000000Z",
        "properties": {
            "status_code": 404,
            "webhook_url": "https://my-webhook-url.com/new_url",
            "response_body": "Client error: POST https://my-webhook-url.com/new_url
                              resulted in a 404 Not Found response:..."
        }
    },
    {
        "description": "Webhook request failed.",
        "created_at": "2022-04-01T15:12:43.000000Z",
        "properties": {
            "status_code": 404,
            "webhook_url": "https://my-webhook-url.com/new_url",
            "response_body": "Client error: POST https://my-webhook-url.com/new_url
                              resulted in a `404 Not Found` response:..."
        }
    },
    ...
  ]
}