Skip to main content
POST
/
api
/
webhook
/
subscriptions
Create an event subscription
curl --request POST \
  --url https://gateway-api.guardhousehq.com/api/webhook/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subscriberId": 123,
  "uri": "<string>"
}
'
{
  "status": {
    "code": 123,
    "errorMessage": "<string>"
  },
  "data": {
    "id": 123,
    "webhookSubscriberEventFilterId": 123,
    "uri": "<string>",
    "isActive": true,
    "createdDateTime": "2023-11-07T05:31:56Z",
    "modifiedDateTime": "2023-11-07T05:31:56Z"
  },
  "count": 123,
  "message": "<string>",
  "errors": [
    {
      "code": 100,
      "message": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

JWT issued by POST /api/token/request. Send as Authorization: Bearer <token>.

Body

application/json
subscriberId
integer<int32>
required
event
enum<string>
required
Available options:
approve,
reject,
submit
eventType
enum<string>
required
Available options:
incidentreport,
timesheet
uri
string<uri>
required

HTTPS URL Guardhouse will POST notifications to.

Response

Subscription created

The standard envelope for every JSON endpoint.

status
object
data
object

Endpoint-specific payload. null when an error occurred.

count
integer<int32> | null
message
string
errors
object[]