# Opsgenie

> Raise, acknowledge, assign and close Opsgenie alerts, open and resolve incidents, see who is on call, ping heartbeats, and follow new alerts, incidents and expired heartbeats.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/opsgenie

## Actions

### Acknowledge alert

Acknowledge an alert, so Opsgenie stops escalating it.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.
- Note (`note`, text): A note to add to the record's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Add note to alert

Add a note to an alert's activity log.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.
- Note (`note`, text, required): The note, up to 25,000 characters.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Add tags to alert

Add tags to an alert. Tags it already has are kept.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.
- Tags (`tags`, list, required): The tags to add.
- Note (`note`, text): A note to add to the record's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Assign alert

Make someone the owner of an alert.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.
- Owner (`owner_id`, text, required): The person who owns the alert from now on.
- Note (`note`, text): A note to add to the alert's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Close alert

Close an alert that has been dealt with.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.
- Note (`note`, text): A note to add to the record's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Close incident

Close an incident for good.

**Inputs**

- Incident (`incident`, text, required): The incident's ID, or its tiny ID when Find incident by says so.
- Find incident by (`find_by`, text): What the incident is looked up by. Leave empty for its ID. One of: `id`, `tiny` (Tiny ID). Default: `id`.
- Note (`note`, text): A note to add to the record's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Create alert

Raise an alert and notify the teams and people it is routed to. Returns the new alert's ID once Opsgenie has made it.

**Inputs**

- Message (`message`, text, required): What went wrong, up to 130 characters. It is the alert's title.
- Alias (`alias`, text): Your own ID for the alert, up to 512 characters. A second alert with the same alias while the first is open is counted as a repeat, not a new alert.
- Description (`description`, text): More detail about the alert, up to 15,000 characters.
- Priority (`priority`, text): How urgent it is. Leave empty for P3. One of: `P1` (P1 (critical)), `P2` (P2 (high)), `P3` (P3 (moderate)), `P4` (P4 (low)), `P5` (P5 (informational)).
- Teams (`team_ids`, list): Teams to route it to, who get notified.
- Users (`user_ids`, list): People to route it to, who get notified.
- Tags (`tags`, list): Tags to add, such as `database`.
- Extra properties (`details`, object): Extra properties to keep with it, as name and value pairs.
- Entity (`entity`, text): The part of your system the alert is about, such as a server's name.
- Source (`source`, text): Where the alert came from. Leave empty to let Opsgenie fill it in.
- Note (`note`, text): A note to add when the alert is made.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "alertId": "example",
    "alias": "example",
    "isSuccess": true,
    "requestId": "example",
    "status": "example"
  }
}
```

### Create heartbeat

Create a heartbeat: Opsgenie raises an alert when it isn't pinged within its interval.

**Inputs**

- Name (`name`, text, required): The heartbeat's name, up to 200 characters. Ping heartbeat uses it.
- Interval (`interval`, number, required): How long Opsgenie waits for a ping, in Interval unit. At least 1.
- Interval unit (`interval_unit`, text, required): The unit of Interval. One of: `minutes`, `hours`, `days`.
- Turned on (`enabled`, true/false): Start watching for pings straight away. Leave empty to turn it on.
- Description (`description`, text): What the heartbeat watches.
- Owner team (`owner_team_id`, text): The team that owns the heartbeat.
- Alert message (`alert_message`, text): The title of the alert raised when it expires, up to 130 characters.
- Alert priority (`alert_priority`, text): The priority of the alert raised when it expires. One of: `P1` (P1 (critical)), `P2` (P2 (high)), `P3` (P3 (moderate)), `P4` (P4 (low)), `P5` (P5 (informational)).
- Alert tags (`alert_tags`, list): Tags for the alert raised when it expires, up to 20.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": {
      "description": "example",
      "enabled": true,
      "expired": true,
      "interval": 1,
      "intervalUnit": "example",
      "lastPingTime": "example",
      "name": "example"
    }
  }
}
```

### Create incident

Open an incident on a service and notify its responders. Returns the new incident's ID once Opsgenie has made it.

**Inputs**

- Message (`message`, text, required): What is happening, up to 130 characters. It is the incident's title.
- Service (`service_id`, text, required): The service the incident is on.
- Description (`description`, text): More detail about the incident, up to 15,000 characters.
- Priority (`priority`, text): How urgent it is. Leave empty for P3. One of: `P1` (P1 (critical)), `P2` (P2 (high)), `P3` (P3 (moderate)), `P4` (P4 (low)), `P5` (P5 (informational)).
- Teams (`team_ids`, list): Teams to route it to, who get notified.
- Users (`user_ids`, list): People to route it to, who get notified.
- Tags (`tags`, list): Tags to add, such as `database`.
- Extra properties (`details`, object): Extra properties to keep with it, as name and value pairs.
- Note (`note`, text): A note to add when the incident is made.
- Notify stakeholders (`notify_stakeholders`, true/false): Also tell the service's stakeholders. Leave empty to not tell them.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "incidentId": "example",
    "isSuccess": true,
    "requestId": "example",
    "status": "example"
  }
}
```

### Delete alert

Delete an alert for good.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Delete heartbeat

Delete a heartbeat.

**Inputs**

- Heartbeat (`name`, text, required): The heartbeat's name.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Delete incident

Delete an incident.

**Inputs**

- Incident (`incident`, text, required): The incident's ID, or its tiny ID when Find incident by says so.
- Find incident by (`find_by`, text): What the incident is looked up by. Leave empty for its ID. One of: `id`, `tiny` (Tiny ID). Default: `id`.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Get alert

Get an alert's message, status, priority, owner, tags, extra properties and who was notified.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": {
      "acknowledged": true,
      "actions": [
        "example"
      ],
      "alias": "example",
      "count": 1,
      "createdAt": "example",
      "description": "example",
      "details": {},
      "entity": "example",
      "id": "example",
      "integration": {
        "id": "example",
        "name": "example",
        "type": "example"
      },
      "isSeen": true,
      "lastOccurredAt": "example",
      "message": "example",
      "owner": "example",
      "priority": "example",
      "report": {
        "ackTime": 1,
        "acknowledgedBy": "example",
        "closeTime": 1,
        "closedBy": "example"
      },
      "responders": [
        {
          "id": "example",
          "type": "example"
        }
      ],
      "snoozed": true,
      "snoozedUntil": "example",
      "source": "example",
      "status": "example",
      "tags": [
        "example"
      ],
      "tinyId": "example",
      "updatedAt": "example"
    }
  }
}
```

### Get incident

Get an incident's message, status, priority, responders and tags.

**Inputs**

- Incident (`incident`, text, required): The incident's ID, or its tiny ID when Find incident by says so.
- Find incident by (`find_by`, text): What the incident is looked up by. Leave empty for its ID. One of: `id`, `tiny` (Tiny ID). Default: `id`.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "extraProperties": {},
      "id": "example",
      "isSeen": true,
      "message": "example",
      "owner": "example",
      "ownerTeam": "example",
      "priority": "example",
      "responders": [
        {
          "id": "example",
          "type": "example"
        }
      ],
      "source": "example",
      "status": "example",
      "tags": [
        "example"
      ],
      "tinyId": "example",
      "updatedAt": "example"
    }
  }
}
```

### Get who is on call

Get who is on call for a schedule now, or at a time you choose.

**Inputs**

- Schedule (`schedule_id`, text, required): The schedule.
- At (`date`, date and time): The time to check. Leave empty for now.
- Usernames only (`flat`, true/false): Return only the on-call people's usernames, without the rotations they come from.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": {
      "_parent": {
        "enabled": true,
        "id": "example",
        "name": "example"
      },
      "onCallParticipants": [
        {
          "id": "example",
          "name": "example",
          "type": "example"
        }
      ],
      "onCallRecipients": [
        "example"
      ]
    }
  }
}
```

### List alerts

List alerts, newest first, optionally only those matching an Opsgenie search such as `status: open`.

**Inputs**

- Search (`query`, text): An Opsgenie alert search, such as `status: open AND priority: P1`. Leave empty for every alert.
- Sort by (`sort`, text): What to sort by. Leave empty for when they were created. One of: `createdAt` (Created), `updatedAt` (Last updated), `lastOccurredAt` (Last occurred), `tinyId` (Tiny ID), `count` (Times it occurred), `status`, `message`.
- Order (`order`, text): Newest or oldest first. Leave empty for newest first. One of: `desc` (Newest first), `asc` (Oldest first).
- Results to return (`limit`, number): How many to return, up to 100. Leave empty for 20. From 1 to 100.
- Results to skip (`offset`, number): How many to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "acknowledged": true,
        "alias": "example",
        "count": 1,
        "createdAt": "example",
        "id": "example",
        "integration": {
          "id": "example",
          "name": "example",
          "type": "example"
        },
        "isSeen": true,
        "lastOccurredAt": "example",
        "message": "example",
        "owner": "example",
        "priority": "example",
        "report": {
          "ackTime": 1,
          "acknowledgedBy": "example",
          "closeTime": 1,
          "closedBy": "example"
        },
        "responders": [
          {
            "id": "example",
            "type": "example"
          }
        ],
        "snoozed": true,
        "snoozedUntil": "example",
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "tinyId": "example",
        "updatedAt": "example"
      }
    ],
    "paging": {
      "first": "example",
      "last": "example",
      "next": "example",
      "prev": "example"
    }
  }
}
```

### List heartbeats

List heartbeats, with when each was last pinged and whether it has expired.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": {
      "heartbeats": [
        {
          "description": "example",
          "enabled": true,
          "expired": true,
          "interval": 1,
          "intervalUnit": "example",
          "lastPingTime": "example",
          "name": "example"
        }
      ]
    }
  }
}
```

### List incidents

List incidents, newest first, by status and optionally an Opsgenie search.

**Inputs**

- Statuses (`statuses`, list): Only incidents with these statuses. Leave empty for all of them. One or more of: `open`, `resolved`, `closed`.
- Search (`query`, text): An Opsgenie incident search to narrow the list, such as `priority: P1`.
- Sort by (`sort`, text): What to sort by. Leave empty for when they were created. One of: `createdAt` (Created), `tinyId` (Tiny ID), `message`, `status`.
- Order (`order`, text): Newest or oldest first. Leave empty for newest first. One of: `desc` (Newest first), `asc` (Oldest first).
- Results to return (`limit`, number): How many to return, up to 100. Leave empty for 20. From 1 to 100.
- Results to skip (`offset`, number): How many to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "createdAt": "example",
        "extraProperties": {},
        "id": "example",
        "isSeen": true,
        "message": "example",
        "owner": "example",
        "ownerTeam": "example",
        "priority": "example",
        "responders": [
          {
            "id": "example",
            "type": "example"
          }
        ],
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "tinyId": "example",
        "updatedAt": "example"
      }
    ],
    "paging": {
      "first": "example",
      "last": "example",
      "next": "example",
      "prev": "example"
    }
  }
}
```

### List schedules

List the on-call schedules with their time zone and owner team.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "description": "example",
        "enabled": true,
        "id": "example",
        "name": "example",
        "ownerTeam": {
          "id": "example",
          "name": "example"
        },
        "timezone": "example"
      }
    ]
  }
}
```

### List services

List the services incidents can be opened on.

**Inputs**

- Results to return (`limit`, number): How many to return, up to 100. Leave empty for 20. From 1 to 100.
- Results to skip (`offset`, number): How many to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "description": "example",
        "id": "example",
        "name": "example",
        "tags": [
          "example"
        ],
        "teamId": "example",
        "visibility": "example"
      }
    ],
    "paging": {
      "first": "example",
      "last": "example",
      "next": "example",
      "prev": "example"
    }
  }
}
```

### List teams

List the account's teams.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "description": "example",
        "id": "example",
        "members": [
          {
            "role": "example",
            "user": {
              "id": "example",
              "username": "example"
            }
          }
        ],
        "name": "example"
      }
    ]
  }
}
```

### List users

List the account's users with their role and time zone.

**Inputs**

- Search (`query`, text): A user search, such as `role: admin`. Leave empty for everyone.
- Results to return (`limit`, number): How many to return. Leave empty for 100. From 1 to 100.
- Results to skip (`offset`, number): How many to skip, to read the next page. At least 0.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "blocked": true,
        "createdAt": "example",
        "fullName": "example",
        "id": "example",
        "locale": "example",
        "role": {
          "id": "example",
          "name": "example"
        },
        "tags": [
          "example"
        ],
        "timeZone": "example",
        "username": "example",
        "verified": true
      }
    ],
    "paging": {
      "first": "example",
      "last": "example",
      "next": "example",
      "prev": "example"
    },
    "totalCount": 1
  }
}
```

### Ping heartbeat

Tell Opsgenie a job is still alive, so its heartbeat doesn't expire.

**Inputs**

- Heartbeat (`name`, text, required): The heartbeat's name.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Resolve incident

Mark an incident resolved once the problem is fixed.

**Inputs**

- Incident (`incident`, text, required): The incident's ID, or its tiny ID when Find incident by says so.
- Find incident by (`find_by`, text): What the incident is looked up by. Leave empty for its ID. One of: `id`, `tiny` (Tiny ID). Default: `id`.
- Note (`note`, text): A note to add to the record's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```

### Snooze alert

Stop an alert's notifications until a time.

**Inputs**

- Alert (`alert`, text, required): The alert's ID, or its alias or tiny ID when Find alert by says so.
- Find alert by (`find_by`, text): What the alert is looked up by. Leave empty for its ID. One of: `id`, `alias`, `tiny` (Tiny ID). Default: `id`.
- Snooze until (`end_time`, date and time, required): When the alert starts notifying again.
- Note (`note`, text): A note to add to the record's activity log.

**Outputs**

- `data` (object): The response from Opsgenie.

**Example output**

```json
{
  "data": {
    "requestId": "example",
    "result": "example",
    "took": 1
  }
}
```
