Creating an incident through send events api to the user who is not current oncall.

I want to create an incident and assign it to an individual in my company who is neither the current on-call person nor part of any escalation policy.

As far as I know, the events API allows me to create an incident and assign it to the current on-call person, but it doesn’t provide a way to assign it to a specific person who may not be the current on-call person for any service in the company. However, I am aware of the create incidents API, which requires the email address of the user initiating the incident. Is it possible to create an incident and assign it to any person in the company without the need for an email address?

Thank you.

Hi @girija.manoj

You can assign an incident to an arbitrary responder when you create the incident via the API. You will need to add the assignments array to the incident payload and use the user’s ID, which you can find in the URL of their profile page in the PagerDuty account. You can also use the PagerDuty CLI which might be easier.

Here’s an example incident payload with a user assigned:

data = {
  "incident": {
    "type": "incident",
    "title": "The server is on fire",
    "assignments": [{
        "assignee": {
            "id": "USERIDHERE",
            "type": "user_reference"
        }
    }],
    "service": {
      "id": "SERVICEIDHERE",
      "summary": "",
      "type": "service_reference",
      "self": "",
      "html_url": ""
    }
  }
} 

The user you assign the incident to must have a full PagerDuty responder license; you can’t assign incidents to stakeholders.

Hi @mandi.walls,

Thank you for the reply, I am aware that we can create incidents and assign it to arbitrary responder using create incident API but for this API we need the from users email address, but I want a way where I can create and assign to an arbitrary user who is not current oncall without asking for an from user email address.
I also know that creating an incident through events api does not require any from email address but as far as I know we can not assign to arbitrary user using send Events api.

So my question is, Is there a way to assign the incident to arbitrary user through Events API?

Thank you.

Hi @girija.manoj. There is no way to assign an arbitrary user via the events API. Events are only associated with Incidents, not specifically with services or users.

1 Like