Import Users from a CSV

Import users to your PagerDuty account from a CSV

If you would like to add users in bulk, we offer the following methods using a comma-separated value (CSV) list:

Import Users with a Self-Serve Ruby Script

You can use the following Ruby script to import users on your own:

You will need a general access REST API key , the email address of the user making the change, and the path to your CSV file as command-line arguments.

Example Command:

ruby import_users.rb -a tKvs3QDNi84Nl326Krdz -e [email protected] -f ./users.csv

The usage instructions for the tool can be found by executing the script with a -h or --help flag:

import_users.rb -h
Usage: import_users.rb [options]
    -a, --access-token [String] Access Token
    -e, --requester-email [String] Requester Email
    -f, --csv-path [String] Path to CSV file

You can name the CSV file anything you like, however the path to the file must be correct.

Required CSV Format

The CSV file should be in the following format:

name,email,role,title,country code,phone number,team 1;team 2;team 3

  • There is no need to include a header in the file, and the title and Teams are optional. If the user is on multiple Teams, separate each Team with a semicolon.
  • The script will create SMS, phone call, and email notification rules using the email address and phone number provided. The notification rules will notify users immediately when they are assigned to an incident, however this can be adjusted later
  • The user's role can be admin, user, limited_user, observer, restricted_access, read_only_user (Full Stakeholder), or read_only_limited_user (Limited Stakeholder). If a role is not specified, the script defaults to user. To see how these values map to values on the webpage, please refer to our section on Roles in the REST API and SAML. You can find additional information on user roles and permissions in the following articles:

Example CSV:

Joe User,[email protected],user,Operations Engineer,1,5555555555,Engineering;Operations 
Bob Dobbs,[email protected],admin,Director of Engineering,86,15555555554,Engineering;Operations;Leadership

Request Help from PagerDuty Support

If you’re looking to add 25 or more users, the Account Owner of your PagerDuty account can request that PagerDuty Support creates a write-scoped API Key in your account to import the users for you.

You will first need to create a spreadsheet with the following columns, in this order:

NameEmailRoleTitleCountry CodePhone NumberTeamsTeam Role

Details about each field:

  • Name (Required): First and last name.
  • Email (Required): Login email address; must be unique to this user.
  • Role (Required): Must be a valid REST API user role (admin, user, limited_user, observer, restricted_access, read_only_user, read_only_limited_user). Note: read_only_userand read_only_limited_user roles require Stakeholder user licenses. Read Billing, Invoices and Payments for more information about Stakeholder users.
  • Title (Optional): Job title.
  • Country Code (Optional): 1-3 digit country calling code. Please refer to Supported Countries for more information about country codes we can accept.
  • Phone Number (Optional): The user’s phone number where they will receive SMS and phone call notifications.
  • Teams (Optional): Teams that the user should be added to. This can include multiple Teams separated by semicolons (;). If the Team does not exist, it will be created when the script runs.
  • Team Role (Optional): User role that will be applied to the given Teams. Must be a valid Team role (Responder, Observer, Manager)

Here are spreadsheet templates for your use:

After populating a spreadsheet in this format, export it as any spreadsheet file (.CSV, .XLSX, .NUMBERS, etc.) and have your Account Owner contact our Support Team to request help importing the users.