Import Users from a CSV
Import users to your PagerDuty account from a CSV
Import users to your PagerDuty account via CSV with the following methods:
Import Users with a Self-Serve Ruby Script
We have a Ruby script available that you can use to import users on your own:
You will want to pass a full-access API v2 access token, the requester email 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
The CSV file can be named anything, you just need to ensure the path is 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, they should be separated by a semicolon.
- The email address and phone number will be set up as an immediate notification rule for the user (for both phone calls and SMS).
- The user's role can be
admin
,user
,limited_user
,observer
,restricted_access
,read_only_user
(Full Stakeholder), orread_only_limited_user
(Limited Stakeholder) and defaults touser
if not specified. 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 here.
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
Have the PagerDuty Support Team Import Users for You
Create a spreadsheet with the following columns, in this order:
Name | Role | Title | Country Code | Phone Number | Teams | Team 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_user
andread_only_limited_user
roles require stakeholder licenses. - Title (Optional): Job title.
- Country Code (Optional): 1-3 digit country calling code.
- Phone Number (Optional): Phone number.
- 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 upon script execution.
- 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 send the file to our Support Team.
Updated about 1 year ago