Opsgenie
Create, close, get, and list Opsgenie alerts directly from InTouch using the official Alert API.
- Base URL:
https://api.opsgenie.com(seteu: trueforhttps://api.eu.opsgenie.com) - Auth:
Authorization: GenieKey <apiKey>(handled for you) - Library: Python standard library only — no external dependencies
Operations
| operation | What it does | HTTP call |
|---|---|---|
create |
Raise a new alert | POST /v2/alerts |
close |
Close an existing alert | POST /v2/alerts/{identifier}/close |
get |
Fetch one alert's full details | GET /v2/alerts/{identifier} |
list |
Search / list alerts | GET /v2/alerts |
Inputs
| Input | Used by | Notes |
|---|---|---|
apiKey |
all | Required. Opsgenie API integration key. |
operation |
all | Required. create, close, get, or list. |
eu |
all | true to target the EU region base URL. |
message |
create | Alert title (required, truncated to 130 chars). |
alias |
create | De-duplication alias. |
priority |
create | P1–P5. |
tags |
create | Comma-separated tags. |
identifier |
close, get | Alert id / tiny id / alias. |
identifierType |
close, get | id (default), tiny, or alias. |
note |
close | Optional note recorded on close. |
query |
list | Opsgenie search query, e.g. status: open. |
limit |
list | 1–100, default 20. |
Outputs
result— the raw JSON response body from Opsgenie (as a string).status— the HTTP status code (202for create/close,200for get/list).
Getting an API key
- In Opsgenie go to Settings → Integrations.
- Add an API integration (or open an existing one).
- Copy its API Key. That value is the
apiKeyinput.
The key is sent as Authorization: GenieKey <apiKey>.
Examples
Create a P2 alert
operation: create
apiKey: <your-api-key>
message: Database connection pool exhausted
priority: P2
tags: database,prod
alias: db-pool-exhausted
Returns HTTP 202 and a request-id payload in result.
Close that alert by its alias, with a note
operation: close
apiKey: <your-api-key>
identifier: db-pool-exhausted
identifierType: alias
note: Pool size increased; recovered.
List the open alerts
operation: list
apiKey: <your-api-key>
query: status: open
limit: 10