Skip to content

pagerduty update-user

Update user to your PagerDuty account.

Description

Update a user from your PagerDuty account.

Synopsis

pagerduty update-user
    --site <site>
    --user_id <user_id>
    --name <name>
    --email <email>
    [--role <role>]
    [--title <title>]
    [--license_id <license_id>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: required

user_id - (string)

     The ID of the user.
     Example: --user_id "PAGNO81"
     Default: _None_      Attributes: required

name - (string)

     The name of the user.
     Example: --name "FirstName LastName"
     Default: _None_      Attributes: required

email - (string)

     The user's email address.
     Example: --email "test@maira.io"
     Default: _None_      Attributes: required

role - (string)

     The user role.
     Example: --role "user"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: admin, limited_user, observer, owner, read_only_user, restricted_access, read_only_limited_user, user

title - (string)

     The job title for the user.
     Example: --title "Director of Marketing"
     Default: _None_      Attributes: optional

     Validation:
         max length: 100

license_id - (string)

     License id assigned to the User
     Example: --license_id "license_id-1"
     Default: _None_      Attributes: optional

Examples

Input:

!pagerduty update-user --user_id "PAGNO81" --name "AB" --email "testMail@email.com"
Output:
ID      NAME    EMAIL               ROLE    TEAMS   CONTACT-METHOD  NOTIFICATION-RULE 
PAGNO81 AB      testmail@email.com  user    PPGILFO P4JILQW         PIIJ9MO, PMV7NBB 
Input:
x= !pagerduty update-user --user_id "PAGNO81" --name "AB" --email "testMail@email.com"
Output:
{
  "user":
    {
      "name": "AB",
      "email": "testmail@email.com",
      "time_zone": "Asia/Kolkata",
      "color": "green",
      "avatar_url": "https://secure.gravatar.com/avatar/f9fe3f51da72943c9a45c423ba2c25aa.png?d=mm&r=PG",
      "billed": true,
      "role": "user",
      "description": null,
      "invitation_sent": false,
      "job_title": null,
      "teams":
        [
          {
            "id": "PPGILFO",
            "type": "team_reference",
            "summary": "Team13",
            "self": "https://api.pagerduty.com/teams/PPGILFO",
            "html_url": "https://maira.pagerduty.com/teams/PPGILFO",
          },
        ],
      "contact_methods":
        [
          {
            "id": "P4JILQW",
            "type": "email_contact_method_reference",
            "summary": "Default",
            "self": "https://api.pagerduty.com/users/PAGNO81/contact_methods/P4JILQW",
            "html_url": null,
          },
        ],
      "notification_rules":
        [
          {
            "id": "PIIJ9MO",
            "type": "assignment_notification_rule_reference",
            "summary": "0 minutes: channel P4JILQW",
            "self": "https://api.pagerduty.com/users/PAGNO81/notification_rules/PIIJ9MO",
            "html_url": null,
          },
          {
            "id": "PMV7NBB",
            "type": "assignment_notification_rule_reference",
            "summary": "0 minutes: channel P4JILQW",
            "self": "https://api.pagerduty.com/users/PAGNO81/notification_rules/PMV7NBB",
            "html_url": null,
          },
        ],
      "coordinated_incidents": [],
      "id": "PAGNO81",
      "type": "user",
      "summary": "AB",
      "self": "https://api.pagerduty.com/users/PAGNO81",
      "html_url": "https://maira.pagerduty.com/users/PAGNO81",
    },
}

Access Control

To use this command, you need access to the following:

Field Value
Action "update"
Service Type "pagerduty"
Service Instance
Namespace
Object Type "users"
Object ID

Please see Access Control for details.