POST/v2/webhooksCreate a webhook

Create a webhook for our platform to interact with
Due to the security-sensitive nature of our products, we recommend an HMAC to validate the integrity of our messages. Optionally, you can provide us with a simple secret.
headerAuthorizationAuthentication token (bearer token or API key).
{
"organizationId" : Number,
"deviceIds" : [Number],
"deviceGroupIds" : [Number],
"secretHttp" : String,
"webhookUrl" : String,
"topics" : ["DeviceActivationEvents" / "DeviceDeactivationEvents" / "DeviceStatusEvents" / "DeviceTamperEvents"]
}

Response

status401Invalid authentication token
{
"id" : Number,
"secretHmac" : String
}

Example: Connect a Webhook to our platform

POST/v2/webhooks

headerAuthorizationBearer 6ff09084-6077-4f7e-866b-8326ee0ff69f
{
"organizationId": 1,
"deviceIds": [1, 2, 3],
"secretHttp": "5wkLQgH9M1cosAFK",
"webhookUrl": "https://webhooks.athom.com/webhook/XXXXX",
"topics": ["DeviceActivationEvents", "DeviceDeactivationEvents", "DeviceStatusEvents", "DeviceTamperEvents"]
}

Response

status200
headerAccess-Control-Expose-Headersauthorization, content-type
headerAccess-Control-Allow-Headersauthorization, content-type
headerAccess-Control-Allow-MethodsGET, POST, DELETE, OPTIONS, PUT
headerAccess-Control-Allow-Origin*
headerStrict-Transport-Securitymax-age=31536000; includeSubDomains
headerX-Frame-OptionsSAMEORIGIN
headerX-Content-Type-Optionsnosniff
headerX-XSS-Protection1; mode=block
headerContent-Security-Policydefault-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
headerReferrer-Policyno-referrer
headerFeature-Policyself
headerPermissions-policyinterest-cohort=()
{
"id": 2,
"secretHmac": "7j8s5svgcLW4zBX7YEEdgW7XQM6ktTK2"
}

Example: Connect an insecure Webhook to our platform

POST/v2/webhooks

headerAuthorizationBearer 97d6e0b6-388e-445e-9da4-b55a3f511c3d
{
"organizationId": 1,
"deviceIds": [1, 2, 3],
"secretHttp": "ezb5BKTcqA5ESjgS",
"webhookUrl": "http://webhooks.athom.com/webhook/XXXXX",
"topics": ["DeviceActivationEvents", "DeviceDeactivationEvents", "DeviceStatusEvents", "DeviceTamperEvents"]
}

Response

status400
headerAccess-Control-Expose-Headersauthorization, content-type
headerAccess-Control-Allow-Headersauthorization, content-type
headerAccess-Control-Allow-MethodsGET, POST, DELETE, OPTIONS, PUT
headerAccess-Control-Allow-Origin*
headerStrict-Transport-Securitymax-age=31536000; includeSubDomains
headerX-Frame-OptionsSAMEORIGIN
headerX-Content-Type-Optionsnosniff
headerX-XSS-Protection1; mode=block
headerContent-Security-Policydefault-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
headerReferrer-Policyno-referrer
headerFeature-Policyself
headerPermissions-policyinterest-cohort=()
{
"message": "Unsupported protocol: We only support https for now.",
"code": "WebhookUnsupportedProtocol",
"errorMessage": "Unsupported protocol: We only support https for now.",
"errorCode": "WebhookUnsupportedProtocol"
}