Topics API
The Topics API allows you to create and manage alert topics, including their associated group subscriptions.
The Topics API allows you to create and manage alert topics, including their associated group subscriptions.
| Base URL | https://api.alertops.com/api/v2 |
| Authentication | api-key request header |
| Endpoints | 8 |
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v2/topics | List topics |
| POST | /api/v2/topics | Create a topic |
| GET | /api/v2/topics/{id} | Get a topic |
| PUT | /api/v2/topics/{id} | Update a Topic |
| DELETE | /api/v2/topics/{id} | Delete a Topic |
| GET | /api/v2/topics/{id}/groups | List a topic's groups |
| POST | /api/v2/topics/{id}/groups | Add groups to a topic |
| DELETE | /api/v2/topics/{id}/groups/{group_id} | Delete group from a topic |
List topics
GET /api/v2/topics
Responses
200 OK
[
{
"topic_id": 1790,
"topic_name": "Test Topic",
"priority": "Low",
"template": "template test"
}
]401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/topics" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Create a topic
POST /api/v2/topics
Request body
JSON object (required).
| Field | Type | Required |
|---|---|---|
topic_name | string | Optional |
priority | string | Optional |
template | string | Optional |
Example body
{
"topic_name": "string",
"priority": "string",
"template": "string"
}Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X POST "https://api.alertops.com/api/v2/topics" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"topic_name":"string","priority":"string","template":"string"}'Get a topic
GET /api/v2/topics/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Topic ID or Topic Name |
Responses
200 OK
{
"topic_id": 1790,
"topic_name": "Test Topic",
"priority": "Low",
"template": "template test"
}401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/topics/{id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Update a Topic
PUT /api/v2/topics/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Topic ID or Topic Name |
Request body
JSON object (required).
| Field | Type | Required |
|---|---|---|
topic_name | string | Optional |
priority | string | Optional |
template | string | Optional |
Example body
{
"topic_name": "string",
"priority": "string",
"template": "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 PUT "https://api.alertops.com/api/v2/topics/{id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"topic_name":"string","priority":"string","template":"string"}'Delete a Topic
DELETE /api/v2/topics/{id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | TopicID |
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/topics/{id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"List a topic's groups
GET /api/v2/topics/{id}/groups
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | TopicID |
Responses
200 OK
[
{
"group_id": 3451,
"group_name": "test"
}
]401 Unauthorized · missing or invalid api-key
Example request
curl -X GET "https://api.alertops.com/api/v2/topics/{id}/groups" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"Add groups to a topic
POST /api/v2/topics/{id}/groups
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | TopicID |
Request body
JSON object (required).
| Field | Type | Required |
|---|---|---|
groups | array of strings | Optional |
Example body
{
"groups": [
"string"
]
}Responses
200 OK
401 Unauthorized · missing or invalid api-key
Example request
curl -X POST "https://api.alertops.com/api/v2/topics/{id}/groups" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"groups":["string"]}'Delete group from a topic
DELETE /api/v2/topics/{id}/groups/{group_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | TopicID |
group_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/topics/{id}/groups/{group_id}" \
-H "api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json"