Groups API
The Groups API provides full management of user groups, including members, contact methods, topics, and attributes.
The Groups API provides full management of user groups, including members, contact methods, topics, and attributes.
| Base URL | https://api.alertops.com/api/v2 |
| Authentication | api-key request header |
| Endpoints | 20 |
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v2/groups | List groups |
| POST | /api/v2/groups | Create a group |
| GET | /api/v2/groups/{id} | Get a group |
| PUT | /api/v2/groups/{id} | Update a group |
| DELETE | /api/v2/groups/{id} | Delete a group |
| GET | /api/v2/groups/{id}/contact_methods | List a group's contact methods |
| POST | /api/v2/groups/{id}/contact_methods | Create a group's contact method |
| GET | /api/v2/groups/{id}/contact_methods/{contact_method_name} | Get a group's contact method |
| PUT | /api/v2/groups/{id}/contact_methods/{contact_method_name} | Update a group's contact method |
| DELETE | /api/v2/groups/{id}/contact_methods/{contact_method_name} | Delete a group's contact method |
| GET | /api/v2/groups/{id}/members | Get a group's members |
| POST | /api/v2/groups/{id}/members | Add members to a group |
| DELETE | /api/v2/groups/{id}/members | Delete members from a group |
| GET | /api/v2/groups/{id}/members/{member_type}/{member_id} | Get a group's member |
| PUT | /api/v2/groups/{id}/members/{member_type}/{member_id} | Update a member in a group |
| DELETE | /api/v2/groups/{id}/members/{member_type}/{member_id} | Delete a member from a group |
| GET | /api/v2/groups/{id}/topics | List a group's topics |
| POST | /api/v2/groups/{id}/topics | Add topics to a group |
| GET | /api/v2/groups/{id}/topics/{topic_id} | Get a group's topic |
| DELETE | /api/v2/groups/{id}/topics/{topic_id} | Delete a topic from a group |
List groups
GET /api/v2/groups
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
search | string | Optional | Default is Empty |
limit | integer | Optional | Page size. Default is 10. Max value for this parameter is 100. |
offset | integer | Optional | Default is 0. Offset to start pagination search results. |
sortBy | string | Optional | Default is GroupName. Eg. GroupName or Description |
sortDir | string | Optional | Default is asc. Eg. asc or desc |
include | string | Optional | Default is Empty. To include more information. Eg. topics |
Responses
200 OK
{
"limit": 10,
"offset": 0,
"groups": [
{
"group_id": 1000,
"group_name": "Group Name 1",
"description": [],
"dynamic": false
},
{
"group_id": 1001,
"group_name": "Group Name 2",
"description": [
"Tester",
"test"
],
"dynamic": false
}
]
}401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Create a group
POST /api/v2/groups
Request body
JSON object.
Example body
{
"group_name": "Group Name Sample 1",
"dynamic": false,
"description": [
"TEST",
"test1"
],
"members": [
{
"member_type": "User",
"member": "testuser1",
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "User",
"member": "testuser2",
"sequence": 2,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "Group",
"member": "Existing Group Name",
"sequence": 3,
"roles": null
}
],
"contact_methods": [
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Primary Email",
"enabled": false,
"sequence": 1
},
{
"country_code": "1",
"phone_number": "1234567890",
"extension": "2345",
"contact_method_name": "Primary Phone",
"enabled": false,
"sequence": 2
},
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Pager",
"enabled": false,
"sequence": 3
},
{
"country_code": "1",
"phone_number": "1234567890",
"contact_method_name": "Group SMS",
"enabled": false,
"sequence": 4
},
{
"url": "https://somedoamin.com",
"get_alert_update": false,
"contact_method_name": "SLACK GROUP",
"enabled": true,
"sequence": 5
}
],
"topics": [
"Valid Topic Name1",
"Valid Topic Name2"
],
"attributes": [
{
"attribute_name": "Attribute Name",
"attribute_value": "attribute value"
}
]
}Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X POST "https://api.alertops.com/api/v2/groups" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"group_name": "Group Name Sample 1",
"dynamic": false,
"description": [
"TEST",
"test1"
],
"members": [
{
"member_type": "User",
"member": "testuser1",
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "User",
"member": "testuser2",
"sequence": 2,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "Group",
"member": "Existing Group Name",
"sequence": 3,
"roles": null
}
],
"contact_methods": [
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Primary Email",
"enabled": false,
"sequence": 1
},
{
"country_code": "1",
"phone_number": "1234567890",
"extension": "2345",
"contact_method_name": "Primary Phone",
"enabled": false,
"sequence": 2
},
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Pager",
"enabled": false,
"sequence": 3
},
{
"country_code": "1",
"phone_number": "1234567890",
"contact_method_name": "Group SMS",
"enabled": false,
"sequence": 4
},
{
"url": "https://somedoamin.com",
"get_alert_update": false,
"contact_method_name": "SLACK GROUP",
"enabled": true,
"sequence": 5
}
],
"topics": [
"Valid Topic Name1",
"Valid Topic Name2"
],
"attributes": [
{
"attribute_name": "Attribute Name",
"attribute_value": "attribute value"
}
]
}'Get a group
GET /api/v2/groups/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Update a group
PUT /api/v2/groups/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Request body
JSON object.
Example body
{
"group_name": "Group Name Sample 1",
"description": [
"TEST",
"test1"
],
"members": [
{
"member_type": "User",
"member": "testuser1",
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "User",
"member": "testuser2",
"sequence": 2,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "Group",
"member": "Existing Group Name",
"sequence": 3,
"roles": null
}
],
"contact_methods": [
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Primary Email",
"enabled": false,
"sequence": 1
},
{
"country_code": "1",
"phone_number": "1234567890",
"extension": "2345",
"contact_method_name": "Primary Phone",
"enabled": false,
"sequence": 2
},
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Pager",
"enabled": false,
"sequence": 3
},
{
"country_code": "1",
"phone_number": "1234567890",
"contact_method_name": "Group SMS",
"enabled": false,
"sequence": 4
},
{
"url": "https://somedoamin.com",
"get_alert_update": false,
"contact_method_name": "SLACK GROUP",
"enabled": true,
"sequence": 6
}
],
"topics": [
"Valid Topic Name1",
"Valid Topic Name2"
],
"attributes": [
{
"attribute_name": "Attribute Name",
"attribute_value": "attribute value"
}
]
}Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X PUT "https://api.alertops.com/api/v2/groups/{id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"group_name": "Group Name Sample 1",
"description": [
"TEST",
"test1"
],
"members": [
{
"member_type": "User",
"member": "testuser1",
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "User",
"member": "testuser2",
"sequence": 2,
"roles": [
"Primary",
"Manager"
]
},
{
"member_type": "Group",
"member": "Existing Group Name",
"sequence": 3,
"roles": null
}
],
"contact_methods": [
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Primary Email",
"enabled": false,
"sequence": 1
},
{
"country_code": "1",
"phone_number": "1234567890",
"extension": "2345",
"contact_method_name": "Primary Phone",
"enabled": false,
"sequence": 2
},
{
"email_address": "someone@somedomain.com",
"contact_method_name": "Pager",
"enabled": false,
"sequence": 3
},
{
"country_code": "1",
"phone_number": "1234567890",
"contact_method_name": "Group SMS",
"enabled": false,
"sequence": 4
},
{
"url": "https://somedoamin.com",
"get_alert_update": false,
"contact_method_name": "SLACK GROUP",
"enabled": true,
"sequence": 6
}
],
"topics": [
"Valid Topic Name1",
"Valid Topic Name2"
],
"attributes": [
{
"attribute_name": "Attribute Name",
"attribute_value": "attribute value"
}
]
}'Delete a group
DELETE /api/v2/groups/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X DELETE "https://api.alertops.com/api/v2/groups/{id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"List a group's contact methods
GET /api/v2/groups/{id}/contact_methods
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}/contact_methods" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Create a group's contact method
POST /api/v2/groups/{id}/contact_methods
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
contactMethodCreateRequest | object | Required | Based on ContactMethodName, the payload is different. Refer Get All for all possible combinations |
Request body
JSON object.
Example body
{
"country_code": "1",
"phone_number": "1234567890",
"extension": "2345",
"contact_method_name": "Primary Phone",
"enabled": false,
"sequence": 1
}Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X POST "https://api.alertops.com/api/v2/groups/{id}/contact_methods?contactMethodCreateRequest={contactMethodCreateRequest}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"country_code":"1","phone_number":"1234567890","extension":"2345","contact_method_name":"Primary Phone","enabled":false,"sequence":1}'Get a group's contact method
GET /api/v2/groups/{id}/contact_methods/{contact_method_name}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
contact_method_name | string | Required | The contact method name. |
Responses
200 OK
{
"url": "https://somedoamin.com",
"get_alert_update": false,
"contact_method_name": "SLACK GROUP",
"enabled": true,
"sequence": 1
}401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}/contact_methods/{contact_method_name}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Update a group's contact method
PUT /api/v2/groups/{id}/contact_methods/{contact_method_name}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
contact_method_name | string | Required | The contact method name. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
contactMethodUpdateRequest | object | Required | Based on Contact Type, the payload is different. Refer Get All for all possible combinations |
Request body
JSON object.
Example body
{
"url": "https://somedomain.com",
"get_alert_update": false,
"enabled": true,
"sequence": 2
}Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X PUT "https://api.alertops.com/api/v2/groups/{id}/contact_methods/{contact_method_name}?contactMethodUpdateRequest={contactMethodUpdateRequest}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"url":"https://somedomain.com","get_alert_update":false,"enabled":true,"sequence":2}'Delete a group's contact method
DELETE /api/v2/groups/{id}/contact_methods/{contact_method_name}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
contact_method_name | string | Required | The contact method name. |
Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X DELETE "https://api.alertops.com/api/v2/groups/{id}/contact_methods/{contact_method_name}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Get a group's members
GET /api/v2/groups/{id}/members
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Responses
200 OK
{
"members": [
{
"member_id": 1001,
"member_type": "User",
"member": "testuser1",
"first_name": "firstname",
"last_name": "lastname",
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
},
{
"member_id": 1002,
"member_type": "User",
"member": "testuser2",
"first_name": "firstname",
"last_name": "lastname",
"sequence": 2,
"roles": [
"Primary",
"Manager"
]
},
{
"member_id": 2001,
"member_type": "Group",
"member": "Member Group Name",
"sequence": 3,
"roles": []
}
],
"role_in_shift": false
}401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}/members" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Add members to a group
POST /api/v2/groups/{id}/members
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Request body
JSON object (required).
Example body
[
{
"member_type": "string",
"member": "string",
"sequence": 0,
"roles": [
"string"
]
}
]Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X POST "https://api.alertops.com/api/v2/groups/{id}/members" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '[{"member_type":"string","member":"string","sequence":0,"roles":["string"]}]'Delete members from a group
DELETE /api/v2/groups/{id}/members
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Group ID or Group Name |
Request body
JSON object (required).
Example body
[
{
"member_id": "string",
"member_type": "string"
}
]Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X DELETE "https://api.alertops.com/api/v2/groups/{id}/members" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '[{"member_id":"string","member_type":"string"}]'Get a group's member
GET /api/v2/groups/{id}/members/{member_type}/{member_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
member_type | string | Required | User or Group |
member_id | string | Required | Username/ID or GroupName/ID |
Responses
200 OK
{
"member_id": 1001,
"member_type": "User",
"member": "testuser1",
"first_name": "firstname",
"last_name": "lastname",
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
}401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}/members/{member_type}/{member_id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Update a member in a group
PUT /api/v2/groups/{id}/members/{member_type}/{member_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
member_type | string | Required | User or Group |
member_id | string | Required | Username/ID or GroupName/ID |
Request body
JSON object.
Example body
{
"sequence": 1,
"roles": [
"Primary",
"Manager"
]
}Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X PUT "https://api.alertops.com/api/v2/groups/{id}/members/{member_type}/{member_id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"sequence":1,"roles":["Primary","Manager"]}'Delete a member from a group
DELETE /api/v2/groups/{id}/members/{member_type}/{member_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
member_type | string | Required | User or Group |
member_id | string | Required | Username/ID or GroupName/ID |
Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X DELETE "https://api.alertops.com/api/v2/groups/{id}/members/{member_type}/{member_id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"List a group's topics
GET /api/v2/groups/{id}/topics
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Responses
200 OK
[
"Sample Topic 1",
"Sample Topic 2",
"Sample Topic 3",
"Sample Topic 4"
]401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}/topics" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Add topics to a group
POST /api/v2/groups/{id}/topics
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
Request body
JSON object.
Example body
{
"topics": [
"Valid Topic Name1",
"Valid Topic Name2"
]
}Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X POST "https://api.alertops.com/api/v2/groups/{id}/topics" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"topics":["Valid Topic Name1","Valid Topic Name2"]}'Get a group's topic
GET /api/v2/groups/{id}/topics/{topic_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
topic_id | string | Required | The topic ID. |
Responses
200 OK
{
"topic": "Sample Topic 1"
}401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/groups/{id}/topics/{topic_id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Delete a topic from a group
DELETE /api/v2/groups/{id}/topics/{topic_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The group ID. |
topic_id | string | Required | The topic ID. |
Responses
204 No Content · The request was processed successfully. No response body is returned.
401 Unauthorized · missing or invalid api-key
Example request
curl -X DELETE "https://api.alertops.com/api/v2/groups/{id}/topics/{topic_id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"