Skip to content

Commit db5718f

Browse files
authored
Merge pull request #49 from checkly/guolau/fix-check-group-api-docs
feat: restore missing check group API information
2 parents 476e30f + c03b184 commit db5718f

File tree

10 files changed

+48
-609
lines changed

10 files changed

+48
-609
lines changed

api-reference/check-groups/create-v1.mdx

Lines changed: 7 additions & 333 deletions
Original file line numberDiff line numberDiff line change
@@ -8,338 +8,12 @@ deprecated: true
88

99
## Overview
1010

11-
Create a new check group to organize related checks and apply shared settings. Check groups help you manage multiple checks efficiently by providing common configuration, environment variables, and alert channels.
12-
13-
## Request Example
14-
15-
```json
16-
{
17-
"name": "Production API Monitoring",
18-
"activated": true,
19-
"muted": false,
20-
"tags": ["production", "api", "critical"],
21-
"locations": ["us-east-1", "eu-west-1", "ap-southeast-1"],
22-
"frequency": 5,
23-
"environmentVariables": [
24-
{
25-
"key": "BASE_URL",
26-
"value": "https://api.production.com",
27-
"locked": false
28-
},
29-
{
30-
"key": "API_TOKEN",
31-
"value": "your-secret-token",
32-
"locked": true
33-
}
34-
],
35-
"localSetupScript": "// Global setup for all checks in this group\nconst setupData = {\n timestamp: Date.now(),\n environment: 'production'\n};\nconsole.log('Setup completed:', setupData);",
36-
"localTearDownScript": "// Global cleanup\nconsole.log('Teardown completed');",
37-
"alertSettings": {
38-
"escalationType": "RUN_BASED",
39-
"runBasedEscalation": {
40-
"failedRunThreshold": 1
41-
},
42-
"timeBasedEscalation": {
43-
"minutesFailingThreshold": 5
44-
},
45-
"reminders": {
46-
"amount": 2,
47-
"interval": 5
48-
},
49-
"sslCertificates": {
50-
"enabled": true,
51-
"alertThreshold": 30
52-
}
53-
},
54-
"useGlobalAlertSettings": false,
55-
"alertChannelSubscriptions": [
56-
{
57-
"channelId": 123,
58-
"activated": true
59-
},
60-
{
61-
"channelId": 456,
62-
"activated": true
63-
}
64-
]
65-
}
66-
```
67-
68-
## Response Example
69-
70-
```json
71-
{
72-
"id": "group_789123456",
73-
"name": "Production API Monitoring",
74-
"activated": true,
75-
"muted": false,
76-
"tags": ["production", "api", "critical"],
77-
"locations": ["us-east-1", "eu-west-1", "ap-southeast-1"],
78-
"frequency": 5,
79-
"environmentVariables": [
80-
{
81-
"key": "BASE_URL",
82-
"value": "https://api.production.com",
83-
"locked": false
84-
},
85-
{
86-
"key": "API_TOKEN",
87-
"value": "***masked***",
88-
"locked": true
89-
}
90-
],
91-
"localSetupScript": "// Global setup for all checks in this group\nconst setupData = {\n timestamp: Date.now(),\n environment: 'production'\n};\nconsole.log('Setup completed:', setupData);",
92-
"localTearDownScript": "// Global cleanup\nconsole.log('Teardown completed');",
93-
"alertSettings": {
94-
"escalationType": "RUN_BASED",
95-
"runBasedEscalation": {
96-
"failedRunThreshold": 1
97-
},
98-
"reminders": {
99-
"amount": 2,
100-
"interval": 5
101-
},
102-
"sslCertificates": {
103-
"enabled": true,
104-
"alertThreshold": 30
105-
}
106-
},
107-
"useGlobalAlertSettings": false,
108-
"alertChannelSubscriptions": [
109-
{
110-
"channelId": 123,
111-
"activated": true
112-
}
113-
],
114-
"checksCount": 0,
115-
"createdAt": "2024-01-25T10:30:00.000Z",
116-
"updatedAt": "2024-01-25T10:30:00.000Z"
117-
}
118-
```
119-
120-
## Configuration Options
121-
122-
<AccordionGroup>
123-
124-
<Accordion title="Basic Settings">
125-
**Required Fields:**
126-
- `name` (string): Display name for the check group
127-
128-
**Optional Fields:**
129-
- `activated` (boolean): Whether checks in this group are active (default: true)
130-
- `muted` (boolean): Whether alerts are muted (default: false)
131-
- `tags` (array): Tags for organization and filtering
132-
- `locations` (array): Default monitoring locations for checks
133-
- `frequency` (integer): Default check frequency in minutes
134-
</Accordion>
135-
136-
<Accordion title="Environment Variables">
137-
Define shared environment variables for all checks in the group:
138-
139-
```json
140-
{
141-
"environmentVariables": [
142-
{
143-
"key": "API_URL",
144-
"value": "https://api.example.com",
145-
"locked": false
146-
},
147-
{
148-
"key": "SECRET_KEY",
149-
"value": "sensitive-value",
150-
"locked": true
151-
}
152-
]
153-
}
154-
```
155-
156-
- `locked`: true means the value is encrypted and masked in responses
157-
</Accordion>
158-
159-
<Accordion title="Setup and Teardown Scripts">
160-
Define JavaScript code that runs before and after each check:
161-
162-
**Setup Script:**
163-
- Runs before each check execution
164-
- Can prepare test data or environment
165-
- Available to all checks in the group
166-
167-
**Teardown Script:**
168-
- Runs after each check execution
169-
- Can clean up resources or log results
170-
- Executes regardless of check success/failure
171-
</Accordion>
172-
173-
<Accordion title="Alert Settings">
174-
Configure how and when alerts are triggered:
175-
176-
**Escalation Types:**
177-
- `RUN_BASED`: Alert after N failed runs
178-
- `TIME_BASED`: Alert after failing for N minutes
179-
180-
**SSL Certificate Monitoring:**
181-
- Monitor SSL certificates in the group
182-
- Set days before expiration to alert
183-
184-
**Reminders:**
185-
- Send follow-up alerts if issues persist
186-
- Configure frequency and count
187-
</Accordion>
188-
189-
</AccordionGroup>
190-
191-
## Code Examples
192-
193-
<CodeGroup>
194-
195-
```bash cURL
196-
curl -X POST "https://api.checklyhq.com/v1/check-groups" \
197-
-H "Authorization: Bearer cu_1234567890abcdef" \
198-
-H "X-Checkly-Account: 550e8400-e29b-41d4-a716-446655440000" \
199-
-H "Content-Type: application/json" \
200-
-d '{
201-
"name": "E-commerce User Flows",
202-
"tags": ["ecommerce", "critical"],
203-
"locations": ["us-east-1", "eu-west-1"],
204-
"frequency": 10,
205-
"environmentVariables": [
206-
{
207-
"key": "SHOP_URL",
208-
"value": "https://shop.example.com",
209-
"locked": false
210-
}
211-
]
212-
}'
213-
```
214-
215-
```javascript Node.js
216-
const checkGroupData = {
217-
name: 'Production API Monitoring',
218-
tags: ['production', 'api'],
219-
locations: ['us-east-1', 'eu-west-1'],
220-
frequency: 5,
221-
environmentVariables: [
222-
{
223-
key: 'BASE_URL',
224-
value: 'https://api.production.com',
225-
locked: false
226-
},
227-
{
228-
key: 'API_KEY',
229-
value: 'secret-api-key',
230-
locked: true
231-
}
232-
],
233-
alertSettings: {
234-
escalationType: 'RUN_BASED',
235-
runBasedEscalation: {
236-
failedRunThreshold: 1
237-
}
238-
}
239-
};
240-
241-
const response = await fetch('https://api.checklyhq.com/v1/check-groups', {
242-
method: 'POST',
243-
headers: {
244-
'Authorization': 'Bearer cu_1234567890abcdef',
245-
'X-Checkly-Account': '550e8400-e29b-41d4-a716-446655440000',
246-
'Content-Type': 'application/json'
247-
},
248-
body: JSON.stringify(checkGroupData)
249-
});
250-
251-
const checkGroup = await response.json();
252-
console.log('Created check group:', checkGroup.id);
253-
```
254-
255-
```python Python
256-
import requests
257-
258-
data = {
259-
'name': 'Microservice Health Checks',
260-
'tags': ['microservices', 'health'],
261-
'locations': ['us-east-1', 'us-west-2'],
262-
'frequency': 2,
263-
'environmentVariables': [
264-
{
265-
'key': 'SERVICE_URL',
266-
'value': 'https://service.example.com',
267-
'locked': False
268-
}
269-
],
270-
'localSetupScript': '''
271-
// Setup script for health checks
272-
const timestamp = new Date().toISOString();
273-
console.log(`Health check started at ${timestamp}`);
274-
''',
275-
'alertChannelSubscriptions': [
276-
{
277-
'channelId': 123,
278-
'activated': True
279-
}
280-
]
281-
}
282-
283-
headers = {
284-
'Authorization': 'Bearer cu_1234567890abcdef',
285-
'X-Checkly-Account': '550e8400-e29b-41d4-a716-446655440000',
286-
'Content-Type': 'application/json'
287-
}
288-
289-
response = requests.post(
290-
'https://api.checklyhq.com/v1/check-groups',
291-
headers=headers,
292-
json=data
293-
)
294-
295-
if response.status_code == 201:
296-
check_group = response.json()
297-
print(f"Created check group: {check_group['name']} (ID: {check_group['id']})")
298-
else:
299-
print(f"Error: {response.status_code} - {response.text}")
300-
```
301-
302-
</CodeGroup>
303-
304-
## Best Practices
305-
306-
<AccordionGroup>
307-
308-
<Accordion title="Naming Convention">
309-
Use descriptive names that indicate:
310-
- The purpose or service being monitored
311-
- The environment (production, staging)
312-
- The type of checks (API, UI, health)
313-
314-
**Examples:**
315-
- "Production Payment API"
316-
- "Staging User Authentication"
317-
- "E-commerce Checkout Flow"
318-
</Accordion>
319-
320-
<Accordion title="Environment Variables">
321-
- Use environment variables for URLs, API keys, and configuration
322-
- Mark sensitive values as `locked: true`
323-
- Use consistent naming conventions across groups
324-
- Consider using different groups for different environments
325-
</Accordion>
326-
327-
<Accordion title="Alert Configuration">
328-
- Set appropriate escalation thresholds based on criticality
329-
- Use different alert channels for different severity levels
330-
- Configure reminders for persistent issues
331-
- Enable SSL certificate monitoring for HTTPS endpoints
332-
</Accordion>
333-
334-
<Accordion title="Setup and Teardown Scripts">
335-
- Keep scripts focused and lightweight
336-
- Use setup scripts for common test data preparation
337-
- Use teardown scripts for cleanup and logging
338-
- Test scripts thoroughly before deployment
339-
</Accordion>
340-
341-
</AccordionGroup>
11+
Create a new [check group](/platform/groups) to organize related checks and apply shared settings. Check groups help you manage multiple checks efficiently by providing common configuration, environment variables, and alert channels.
34212

34313
<Note>
344-
After creating a check group, you can add checks to it and they will inherit the group's default settings. You can always override group settings at the individual check level when needed.
345-
</Note>
14+
You can add checks to a group by setting the "groupId" property of individual checks.
15+
</Note>
16+
17+
<Warning>
18+
Groups created with this endpoint will always override its member check settings (i.e. location, alerting, etc.). We recommend using the [V2 endpoint](/api-reference/check-groups/create/) instead for more flexibility.
19+
</Warning>

api-reference/check-groups/create.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ sidebarTitle: 'Create'
77

88
## Overview
99

10-
Create a new check group to organize related checks and apply shared settings. Check groups help you manage multiple checks efficiently by providing common configuration, environment variables, and alert channels.
10+
Create a new [check group](/platform/groups) to organize related checks and apply shared settings. Check groups help you manage multiple checks efficiently by providing common configuration, environment variables, and alert channels.
1111

12+
<Note>
13+
You can add checks to a group by setting the `groupId` property of individual checks.
14+
</Note>

api-reference/check-groups/delete-v1.mdx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,8 @@ sidebarTitle: 'Delete'
77

88
## Overview
99

10-
The Delete Check Group endpoint permanently removes a check group from your account. This action deletes the group but preserves individual checks, which become ungrouped.
10+
The Delete Check Group endpoint permanently removes a [check group](/platform/groups).
1111

12-
**Common Use Cases**:
13-
- Group Cleanup
14-
- Organization Restructuring
15-
- Resource Management
16-
- Group Decommissioning
17-
18-
<Warning>
19-
Deleting check groups is permanent. Member checks will become ungrouped but remain active. Group-specific settings and configurations will be lost.
20-
</Warning>
21-
22-
<Note>
23-
Individual checks are preserved when deleting groups. Consider reassigning checks to other groups before deletion if group organization is important.
24-
</Note>
12+
<Danger>
13+
All checks within the group will also be deleted. This action is permanent and irreversible.
14+
</Danger>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: 'Get Specific Checks in a Check Group'
3+
openapi: 'GET /v1/check-groups/{groupId}/checks/{checkId}'
4+
description: 'Retrieve one check in a specific group with group settings applied'
5+
sidebarTitle: 'Get Check'
6+
---
7+
8+
## Overview
9+
10+
Show details of one check in a specific [check group](/platform/groups) with the group settings applied.

0 commit comments

Comments
 (0)