Group API (Deprecated)

πŸ“˜

Create an API Integration and obtain your apiKey to make requests listed below. Please make sure that the integration is not restricted to access configurations.

Create Group Request

Create group request is used to create groups in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

Limit

apiKey

API key is used for authenticating API requests

name

Name of the group

100 chars

Optional Parameters

Parameter

users

The usernames of users which will be added to group

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/group' -d '
{
    "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
    "name" : "network",
    "users" : ["[email protected]", "[email protected]"]
}'

Response

{
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "status" : "successful",
    "code" : 200
}

Update Group Request

Update group request is used to update groups in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

apiKey

API key is used for authenticating API requests

id

ID of group to be updated

Optional Parameters

Parameter

Limit

name

Name of group

users

The usernames of users which will be added to group

512 chars

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/group' -d '
{
    "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "name" : "network_updated"
}'

Response

{
    "status" : "successful",
    "code" : 200
}

Group Add Member Request

Add member group request is used to add new users to group in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

apiKey

API key is used for authenticating API requests

id

ID of group which users will be added to

users

The usernames of users which will be added to group

Optional Parameters

Parameter

name

Name of group which users will be added to

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/group/member' -d '
{
    "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "users" : "[email protected]"
}'
curl -XPOST 'https://api.opsgenie.com/v1/json/group/member' -d '
{
    "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "users" : ["[email protected]", "[email protected]"]
}'
curl -XPOST 'https://api.opsgenie.com/v1/json/group/member' -d '
{
    "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "users" : "[email protected],[email protected]enie.com"
}'

Response

{
         "status" : "successful",
         "code" : 200
}

Group Remove Member Request

Remove member group request is used to remove users to group in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

apiKey

API key is used for authenticating API requests

id

ID of group which users will be removed from

name

Name of group which users will be removed from

users

The usernames of users which will be removed from group

🚧

One of id or name parameters should be specified with remove group member request

Sample Request

curl -XDELETE 'https://api.opsgenie.com/v1/json/group/member?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&id=ac463592-dbd2-4ca3-a651d-48fhf5j5c871&[email protected]'
curl -XDELETE 'https://api.opsgenie.com/v1/json/group/member?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&name=network&[email protected],[email protected]'

Response

{
         "status" : "successful",
         "code" : 200
}

Delete Group Request

Delete group request is used to delete groups in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

apiKey

API key is used for authenticating API requests

id

ID of group to be deleted

name

Name of group

🚧

One of id or name parameters should be specified with delete group request

Sample Request

curl -XDELETE 'https://api.opsgenie.com/v1/json/group?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&name=network'
curl -XDELETE 'https://api.opsgenie.com/v1/json/group?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&id=ac463592-dbd2-4ca3-a651d-48fhf5j5c871'

Response

{
    "status" : "successful",
    "code" : 200
}

Get Group Request

πŸ“˜

This is a read request. Therefore, even if the integration of the API key is configured as read-only, the request will be accepted.

Get group request is used to search and retrieve groups in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

apiKey

API key is used for authenticating API requests

id

ID of group to be retrieved

name

Name of the group

🚧

One of id or name parameters should be specified with get group request.

Sample Request

curl -XGET 'https://api.opsgenie.com/v1/json/group?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&name=network'
curl -XGET 'https://api.opsgenie.com/v1/json/group?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&id=ac463592-dbd2-4ca3-a651d-48fhf5j5c871'

Response

{
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "name" : "network",
    "users" : ["[email protected]", "[email protected]"]
}

List Groups Request

πŸ“˜

This is a read request. Therefore, even if the integration of the API key is configured as read-only, the request will be accepted.

List groups request is used to list groups in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter

apiKey

API key is used for authenticating API requests

Sample Request

curl -XGET 'https://api.opsgenie.com/v1/json/group?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&name=network'
curl -XGET 'https://api.opsgenie.com/v1/json/group?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&id=ac463592-dbd2-4ca3-a651d-48fhf5j5c871'

Response

{
    "groups":[
        {
             "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
             "name" : "network",
             "users" : ["[email protected]"]
        },
        {
             "id" : "fg463552-dvf2-4ca3-a4315-48fhf5j67875",
             "name" : "database",
             "users" : [[email protected]"]
        },
    ]
}

Updated about a year ago


Group API (Deprecated)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.