REST API Create Alert : No Owner despite user field filled
Asked by Romain Bonnot:

Hi,

I'm testing the Create Alert api : POST <https://api.opsgenie.com/v2/alerts>  
Managed to create an alert but fail to provide a Request Owner.

![OpsGeniePostmanCreate.png](/t5/image/serverpage/image-id/202730i5D95CDA40260354B/image-dimensions/455x429?v=v2 "OpsGeniePostmanCreate.png")  

![OpsGenieAlertNoOwner.png](/t5/image/serverpage/image-id/202731i28A4EFC09EFAEC83/image-size/large?v=v2&px=999 "OpsGenieAlertNoOwner.png")  

User exists and is visible in the List User API, not blocked, verified.  

Tried with id, fullname, username in the json body, to no avail.  

How can I change the Request Owner of an alert I create via Create Alert API ?


Answers:
author: Nick H
body: Hi [@Romain Bonnot](/t5/user/viewprofilepage/user-id/4971090) ,

It's important to note that [Ownership](https://support.atlassian.com/opsgenie/docs/assign-an-owner-to-an-alert/) is only given to a user when the alert is assigned to the user, or if a user ack's the alert.

This can be done through our API with either the [Assign Alert API](https://docs.opsgenie.com/docs/alert-api#assign-alert), and somewhat through [Acknowledge alert API](https://docs.opsgenie.com/docs/alert-api#acknowledge-alert) - but realistically the user will want to ack the alert manually so users have better visibility. For example:

Assign Alert API:

![asapi1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202771i1A33447D4888B612/image-size/large?v=v2&px=999 "asapi1.jpg")![asapi2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202770i85472BE5C6B2EA44/image-size/large?v=v2&px=999 "asapi2.jpg")

Acknowledge Alert API:

![asapi3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202772iB3C142BBC3906DDE/image-size/large?v=v2&px=999 "asapi3.jpg")

\^ When an alert is ack'd through the Alert API, alert shows the Alert API as the Owner.

Acknowledging an alert manually:

![asapi4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202773i3FFCBCCEBD1A42F0/image-size/large?v=v2&px=999 "asapi4.jpg")

\^ Alert shows the user as the Owner.

comments: author: Romain Bonnot
body: Hi [@Nick H](/t5/user/viewprofilepage/user-id/2540930) ,  

Thanks for your detailed answer !  

It is indeed my actual process to use the Assign API but it forces me to await API result (well create alert requests are processed asynchronously so it wont really hurt performances) and make a secondary API call to Assign upon every alert creations.  

Problem is, I want to create already assigned alerts and from the [documentation](https://docs.opsgenie.com/docs/alert-api#create-alert) the user field seams to be exactly what I need.  

Can you confirm this field is ignored by the Create Alert API and there is no way to give ownership upon Create Alert call ?


author: Nick H
body: Hi [@Romain Bonnot](/t5/user/viewprofilepage/user-id/4971090) ,

It's **not** possible to assign an Owner at alert creation. Adding a user as a responder to alert via Create API will simply notify that user of the alert (/add them as a responder) - but the user still needs to acknowledge the alert to take Ownership:

![asapi5.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202789i4039DBBEB4C339CA/image-size/large?v=v2&px=999 "asapi5.jpg")![asapi6.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/202788iBEFF270D6F5CA2F5/image-size/large?v=v2&px=999 "asapi6.jpg")


Tags: cloud

integration

rest-api