Webhooks¶
Reference for the webhooks endpoints of the Surfmeter API.
Surfmeter API – Webhooks v1¶
The Surfmeter API lets you manage clients, users, capabilities, measurements, and organization-wide settings programmatically.
Servers¶
| Description | URL |
|---|---|
| https://surfmeter-server.{host}/client_admin_api/v1 | https://surfmeter-server.{host}/client_admin_api/v1 |
Webhooks¶
GET /webhooks/event_types¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
Response 200 OK
{
"groups": [
{
"key": "string",
"label": "string"
}
],
"filters": [
{
"key": "string",
"description": "string"
}
],
"severities": [
"string"
],
"health_metrics": [
"string"
],
"measurement_types": [
"string"
],
"event_types": [
{
"type": "string",
"group": "string",
"description": "string",
"filters": [
"string"
],
"sample": {}
}
]
}
Schema of the response body
{
"description": "Webhook event catalogue",
"type": "object",
"required": [
"groups",
"filters",
"severities",
"health_metrics",
"measurement_types",
"event_types"
],
"properties": {
"groups": {
"type": "array",
"items": {
"type": "object",
"required": [
"key",
"label"
],
"properties": {
"key": {
"type": "string"
},
"label": {
"type": "string"
}
}
}
},
"filters": {
"type": "array",
"items": {
"type": "object",
"required": [
"key",
"description"
],
"properties": {
"key": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
},
"severities": {
"type": "array",
"items": {
"type": "string"
}
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"event_types": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"group",
"description",
"filters",
"sample"
],
"properties": {
"type": {
"type": "string"
},
"group": {
"type": "string"
},
"description": {
"type": "string"
},
"filters": {
"type": "array",
"items": {
"type": "string"
}
},
"sample": {
"type": "object"
}
}
}
}
}
}
GET /webhooks¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
Response 200 OK
{
"webhooks": [
{
"id": 0,
"name": "string",
"description": "string",
"url": "string",
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
},
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"enabled": true,
"active": true,
"headers": {},
"secret_hint": "string",
"auto_disabled_at": "string",
"auto_disabled_reason": "string",
"consecutive_failures": 0,
"last_delivery_at": "string",
"last_success_at": "string",
"last_failure_at": "string",
"last_response_status": 0,
"last_error": "string",
"created_by_id": 0,
"created_at": "string",
"updated_at": "string"
}
]
}
Schema of the response body
{
"description": "Response for webhooks index action",
"type": "object",
"required": [
"webhooks"
],
"properties": {
"webhooks": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"url",
"payload_format",
"format_options",
"event_types",
"filters",
"enabled",
"active",
"headers",
"secret_hint",
"auto_disabled_at",
"auto_disabled_reason",
"consecutive_failures",
"last_delivery_at",
"last_success_at",
"last_failure_at",
"last_response_status",
"last_error",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"enabled": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"secret_hint": {
"type": "string"
},
"auto_disabled_at": {
"type": "string",
"nullable": true
},
"auto_disabled_reason": {
"type": "string",
"nullable": true
},
"consecutive_failures": {
"type": "integer"
},
"last_delivery_at": {
"type": "string",
"nullable": true
},
"last_success_at": {
"type": "string",
"nullable": true
},
"last_failure_at": {
"type": "string",
"nullable": true
},
"last_response_status": {
"type": "integer",
"nullable": true
},
"last_error": {
"type": "string",
"nullable": true
},
"created_by_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
}
}
}
}
POST /webhooks¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
Request body
{
"name": "string",
"description": "string",
"url": "string",
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"headers": {},
"enabled": true,
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
}
}
Schema of the request body
{
"description": "Request body for creating a webhook endpoint",
"type": "object",
"required": [
"name",
"url",
"event_types"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"enabled": {
"type": "boolean"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
}
}
}
Response 201 Created
{
"webhook": {
"id": 0,
"name": "string",
"description": "string",
"url": "string",
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
},
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"enabled": true,
"active": true,
"headers": {},
"secret_hint": "string",
"auto_disabled_at": "string",
"auto_disabled_reason": "string",
"consecutive_failures": 0,
"last_delivery_at": "string",
"last_success_at": "string",
"last_failure_at": "string",
"last_response_status": 0,
"last_error": "string",
"created_by_id": 0,
"created_at": "string",
"updated_at": "string",
"secret": "string"
}
}
Schema of the response body
{
"description": "Response for webhooks create action; the only time the secret is returned",
"type": "object",
"required": [
"webhook"
],
"properties": {
"webhook": {
"type": "object",
"required": [
"id",
"name",
"url",
"payload_format",
"format_options",
"event_types",
"filters",
"enabled",
"active",
"headers",
"secret_hint",
"auto_disabled_at",
"auto_disabled_reason",
"consecutive_failures",
"last_delivery_at",
"last_success_at",
"last_failure_at",
"last_response_status",
"last_error",
"created_at",
"updated_at",
"secret"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"enabled": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"secret_hint": {
"type": "string"
},
"auto_disabled_at": {
"type": "string",
"nullable": true
},
"auto_disabled_reason": {
"type": "string",
"nullable": true
},
"consecutive_failures": {
"type": "integer"
},
"last_delivery_at": {
"type": "string",
"nullable": true
},
"last_success_at": {
"type": "string",
"nullable": true
},
"last_failure_at": {
"type": "string",
"nullable": true
},
"last_response_status": {
"type": "integer",
"nullable": true
},
"last_error": {
"type": "string",
"nullable": true
},
"created_by_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"secret": {
"type": "string"
}
}
}
}
}
GET /webhooks/{id}¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
id |
path | string | No |
Response 200 OK
{
"webhook": {
"id": 0,
"name": "string",
"description": "string",
"url": "string",
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
},
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"enabled": true,
"active": true,
"headers": {},
"secret_hint": "string",
"auto_disabled_at": "string",
"auto_disabled_reason": "string",
"consecutive_failures": 0,
"last_delivery_at": "string",
"last_success_at": "string",
"last_failure_at": "string",
"last_response_status": 0,
"last_error": "string",
"created_by_id": 0,
"created_at": "string",
"updated_at": "string"
}
}
Schema of the response body
{
"description": "Response for webhooks show action",
"type": "object",
"required": [
"webhook"
],
"properties": {
"webhook": {
"type": "object",
"required": [
"id",
"name",
"url",
"payload_format",
"format_options",
"event_types",
"filters",
"enabled",
"active",
"headers",
"secret_hint",
"auto_disabled_at",
"auto_disabled_reason",
"consecutive_failures",
"last_delivery_at",
"last_success_at",
"last_failure_at",
"last_response_status",
"last_error",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"enabled": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"secret_hint": {
"type": "string"
},
"auto_disabled_at": {
"type": "string",
"nullable": true
},
"auto_disabled_reason": {
"type": "string",
"nullable": true
},
"consecutive_failures": {
"type": "integer"
},
"last_delivery_at": {
"type": "string",
"nullable": true
},
"last_success_at": {
"type": "string",
"nullable": true
},
"last_failure_at": {
"type": "string",
"nullable": true
},
"last_response_status": {
"type": "integer",
"nullable": true
},
"last_error": {
"type": "string",
"nullable": true
},
"created_by_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
}
}
}
PUT /webhooks/{id}¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
id |
path | string | No |
Request body
{
"name": "string",
"description": "string",
"url": "string",
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"headers": {},
"enabled": true,
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
}
}
Schema of the request body
{
"description": "Request body for updating a webhook endpoint. A header value of ******** keeps the stored value.",
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"enabled": {
"type": "boolean"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
}
}
}
Response 200 OK
{
"webhook": {
"id": 0,
"name": "string",
"description": "string",
"url": "string",
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
},
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"enabled": true,
"active": true,
"headers": {},
"secret_hint": "string",
"auto_disabled_at": "string",
"auto_disabled_reason": "string",
"consecutive_failures": 0,
"last_delivery_at": "string",
"last_success_at": "string",
"last_failure_at": "string",
"last_response_status": 0,
"last_error": "string",
"created_by_id": 0,
"created_at": "string",
"updated_at": "string"
}
}
Schema of the response body
{
"description": "Response for webhooks update action",
"type": "object",
"required": [
"webhook"
],
"properties": {
"webhook": {
"type": "object",
"required": [
"id",
"name",
"url",
"payload_format",
"format_options",
"event_types",
"filters",
"enabled",
"active",
"headers",
"secret_hint",
"auto_disabled_at",
"auto_disabled_reason",
"consecutive_failures",
"last_delivery_at",
"last_success_at",
"last_failure_at",
"last_response_status",
"last_error",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"enabled": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"secret_hint": {
"type": "string"
},
"auto_disabled_at": {
"type": "string",
"nullable": true
},
"auto_disabled_reason": {
"type": "string",
"nullable": true
},
"consecutive_failures": {
"type": "integer"
},
"last_delivery_at": {
"type": "string",
"nullable": true
},
"last_success_at": {
"type": "string",
"nullable": true
},
"last_failure_at": {
"type": "string",
"nullable": true
},
"last_response_status": {
"type": "integer",
"nullable": true
},
"last_error": {
"type": "string",
"nullable": true
},
"created_by_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
}
}
}
DELETE /webhooks/{id}¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
id |
path | string | No |
Response 200 OK
POST /webhooks/{id}/test¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
id |
path | string | No |
Response 200 OK
{
"webhook_delivery": {
"id": 0,
"webhook_endpoint_id": 0,
"event_id": "string",
"event_type": "string",
"status": "pending",
"attempts": 0,
"max_attempts": 0,
"next_attempt_at": "string",
"response_status": 0,
"error_message": "string",
"duration_ms": 0,
"delivered_at": "string",
"manual": true,
"created_at": "string",
"updated_at": "string",
"payload": {
"id": "string",
"type": "string",
"timestamp": "string",
"data": {}
},
"response_body": "string",
"rendered_body": "string",
"payload_format": "standard",
"rendered_content_type": "string"
}
}
Schema of the response body
{
"description": "Response for webhooks test action",
"type": "object",
"required": [
"webhook_delivery"
],
"properties": {
"webhook_delivery": {
"type": "object",
"required": [
"id",
"webhook_endpoint_id",
"event_id",
"event_type",
"status",
"attempts",
"max_attempts",
"next_attempt_at",
"response_status",
"error_message",
"duration_ms",
"delivered_at",
"manual",
"created_at",
"updated_at",
"payload",
"response_body",
"payload_format",
"rendered_body",
"rendered_content_type"
],
"properties": {
"id": {
"type": "integer"
},
"webhook_endpoint_id": {
"type": "integer"
},
"event_id": {
"type": "string"
},
"event_type": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"pending",
"succeeded",
"failed",
"exhausted",
"cancelled"
]
},
"attempts": {
"type": "integer"
},
"max_attempts": {
"type": "integer"
},
"next_attempt_at": {
"type": "string",
"nullable": true
},
"response_status": {
"type": "integer",
"nullable": true
},
"error_message": {
"type": "string",
"nullable": true
},
"duration_ms": {
"type": "integer",
"nullable": true
},
"delivered_at": {
"type": "string",
"nullable": true
},
"manual": {
"type": "boolean"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"payload": {
"type": "object",
"required": [
"id",
"type",
"timestamp",
"data"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
},
"timestamp": {
"type": "string"
},
"data": {
"type": "object"
}
}
},
"response_body": {
"type": "string",
"nullable": true
},
"rendered_body": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"rendered_content_type": {
"type": "string"
}
}
}
}
}
POST /webhooks/{id}/rotate_secret¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
id |
path | string | No |
Response 200 OK
{
"webhook": {
"id": 0,
"name": "string",
"description": "string",
"url": "string",
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
},
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"enabled": true,
"active": true,
"headers": {},
"secret_hint": "string",
"auto_disabled_at": "string",
"auto_disabled_reason": "string",
"consecutive_failures": 0,
"last_delivery_at": "string",
"last_success_at": "string",
"last_failure_at": "string",
"last_response_status": 0,
"last_error": "string",
"created_by_id": 0,
"created_at": "string",
"updated_at": "string",
"secret": "string"
}
}
Schema of the response body
{
"description": "Response for webhooks rotate_secret action; returns the new secret once",
"type": "object",
"required": [
"webhook"
],
"properties": {
"webhook": {
"type": "object",
"required": [
"id",
"name",
"url",
"payload_format",
"format_options",
"event_types",
"filters",
"enabled",
"active",
"headers",
"secret_hint",
"auto_disabled_at",
"auto_disabled_reason",
"consecutive_failures",
"last_delivery_at",
"last_success_at",
"last_failure_at",
"last_response_status",
"last_error",
"created_at",
"updated_at",
"secret"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"enabled": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"secret_hint": {
"type": "string"
},
"auto_disabled_at": {
"type": "string",
"nullable": true
},
"auto_disabled_reason": {
"type": "string",
"nullable": true
},
"consecutive_failures": {
"type": "integer"
},
"last_delivery_at": {
"type": "string",
"nullable": true
},
"last_success_at": {
"type": "string",
"nullable": true
},
"last_failure_at": {
"type": "string",
"nullable": true
},
"last_response_status": {
"type": "integer",
"nullable": true
},
"last_error": {
"type": "string",
"nullable": true
},
"created_by_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"secret": {
"type": "string"
}
}
}
}
}
POST /webhooks/{id}/enable¶
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
ApiKeyAuth |
header | string | N/A | No | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |
id |
path | string | No |
Response 200 OK
{
"webhook": {
"id": 0,
"name": "string",
"description": "string",
"url": "string",
"payload_format": "standard",
"format_options": {
"mention_users": [
"string"
],
"mention_groups": [
"string"
],
"mention_channel": "here"
},
"event_types": [
"string"
],
"filters": {
"client_tags": [
"string"
],
"measurement_types": [
"string"
],
"min_severity": "warning",
"health_metrics": [
"string"
]
},
"enabled": true,
"active": true,
"headers": {},
"secret_hint": "string",
"auto_disabled_at": "string",
"auto_disabled_reason": "string",
"consecutive_failures": 0,
"last_delivery_at": "string",
"last_success_at": "string",
"last_failure_at": "string",
"last_response_status": 0,
"last_error": "string",
"created_by_id": 0,
"created_at": "string",
"updated_at": "string"
}
}
Schema of the response body
{
"description": "Response for webhooks enable action",
"type": "object",
"required": [
"webhook"
],
"properties": {
"webhook": {
"type": "object",
"required": [
"id",
"name",
"url",
"payload_format",
"format_options",
"event_types",
"filters",
"enabled",
"active",
"headers",
"secret_hint",
"auto_disabled_at",
"auto_disabled_reason",
"consecutive_failures",
"last_delivery_at",
"last_success_at",
"last_failure_at",
"last_response_status",
"last_error",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
},
"payload_format": {
"type": "string",
"enum": [
"standard",
"slack",
"microsoft_teams"
]
},
"format_options": {
"type": "object",
"additionalProperties": false,
"properties": {
"mention_users": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"mention_channel": {
"type": "string",
"enum": [
"here",
"channel",
null
],
"nullable": true
}
}
},
"event_types": {
"type": "array",
"items": {
"type": "string"
}
},
"filters": {
"type": "object",
"properties": {
"client_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"measurement_types": {
"type": "array",
"items": {
"type": "string"
}
},
"min_severity": {
"type": "string",
"enum": [
"warning",
"critical"
]
},
"health_metrics": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"enabled": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"secret_hint": {
"type": "string"
},
"auto_disabled_at": {
"type": "string",
"nullable": true
},
"auto_disabled_reason": {
"type": "string",
"nullable": true
},
"consecutive_failures": {
"type": "integer"
},
"last_delivery_at": {
"type": "string",
"nullable": true
},
"last_success_at": {
"type": "string",
"nullable": true
},
"last_failure_at": {
"type": "string",
"nullable": true
},
"last_response_status": {
"type": "integer",
"nullable": true
},
"last_error": {
"type": "string",
"nullable": true
},
"created_by_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
}
}
}
Schemas¶
WebhookCreateData¶
| Name | Type |
|---|---|
description |
string| null |
enabled |
boolean |
event_types |
Array<string> |
filters |
Properties: client_tags, measurement_types, min_severity, health_metrics |
format_options |
Properties: mention_users, mention_groups, mention_channel |
headers |
|
name |
string |
payload_format |
string |
url |
string |
WebhookCreateResponse¶
| Name | Type |
|---|---|
webhook |
Properties: id, name, description, url, payload_format, format_options, event_types, filters, enabled, active, headers, secret_hint, auto_disabled_at, auto_disabled_reason, consecutive_failures, last_delivery_at, last_success_at, last_failure_at, last_response_status, last_error, created_by_id, created_at, updated_at, secret |
WebhookDestroyResponse¶
WebhookEnableResponse¶
| Name | Type |
|---|---|
webhook |
Properties: id, name, description, url, payload_format, format_options, event_types, filters, enabled, active, headers, secret_hint, auto_disabled_at, auto_disabled_reason, consecutive_failures, last_delivery_at, last_success_at, last_failure_at, last_response_status, last_error, created_by_id, created_at, updated_at |
WebhookEventTypesResponse¶
| Name | Type |
|---|---|
event_types |
Array<Properties: type, group, description, filters, sample> |
filters |
Array<Properties: key, description> |
groups |
Array<Properties: key, label> |
health_metrics |
Array<string> |
measurement_types |
Array<string> |
severities |
Array<string> |
WebhookIndexResponse¶
| Name | Type |
|---|---|
webhooks |
Array<Properties: id, name, description, url, payload_format, format_options, event_types, filters, enabled, active, headers, secret_hint, auto_disabled_at, auto_disabled_reason, consecutive_failures, last_delivery_at, last_success_at, last_failure_at, last_response_status, last_error, created_by_id, created_at, updated_at> |
WebhookRotateSecretResponse¶
| Name | Type |
|---|---|
webhook |
Properties: id, name, description, url, payload_format, format_options, event_types, filters, enabled, active, headers, secret_hint, auto_disabled_at, auto_disabled_reason, consecutive_failures, last_delivery_at, last_success_at, last_failure_at, last_response_status, last_error, created_by_id, created_at, updated_at, secret |
WebhookShowResponse¶
| Name | Type |
|---|---|
webhook |
Properties: id, name, description, url, payload_format, format_options, event_types, filters, enabled, active, headers, secret_hint, auto_disabled_at, auto_disabled_reason, consecutive_failures, last_delivery_at, last_success_at, last_failure_at, last_response_status, last_error, created_by_id, created_at, updated_at |
WebhookTestResponse¶
| Name | Type |
|---|---|
webhook_delivery |
Properties: id, webhook_endpoint_id, event_id, event_type, status, attempts, max_attempts, next_attempt_at, response_status, error_message, duration_ms, delivered_at, manual, created_at, updated_at, payload, response_body, rendered_body, payload_format, rendered_content_type |
WebhookUpdateData¶
| Name | Type |
|---|---|
description |
string| null |
enabled |
boolean |
event_types |
Array<string> |
filters |
Properties: client_tags, measurement_types, min_severity, health_metrics |
format_options |
Properties: mention_users, mention_groups, mention_channel |
headers |
|
name |
string |
payload_format |
string |
url |
string |
WebhookUpdateResponse¶
| Name | Type |
|---|---|
webhook |
Properties: id, name, description, url, payload_format, format_options, event_types, filters, enabled, active, headers, secret_hint, auto_disabled_at, auto_disabled_reason, consecutive_failures, last_delivery_at, last_success_at, last_failure_at, last_response_status, last_error, created_by_id, created_at, updated_at |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| ApiKeyAuth | apiKey | API key used on every request. Create keys in the Surfmeter Dashboard under Keys → Surfmeter API Keys. |