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 the following:
- A general access REST API key.
- The email address of the user making the change.
- The path to your CSV file a command-line argument. The CSV file can have any name, however the path to the file must be correct.
Example
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
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 fields 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 users can adjust these settings later on their User Profile.
- The user's role can be
admin
,user
,limited_user
,observer
,restricted_access
,read_only_user
(Full Stakeholder), orread_only_limited_user
(Limited Stakeholder). If a role is not specified, the script defaults touser
. 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
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 would like 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.
Please create a spreadsheet with the following columns, in this order:
Name | Role | Title | Country Code | Phone Number | Teams | Team Role |
The following spreadsheet templates are available for your use:
After populating a spreadsheet in this format, export it as a spreadsheet file (e.g., .CSV
, .XLSX
, .NUMBERS
, etc.) and have your Account Owner contact our Support Team to request help importing the users.
Field Details
Field | Description |
---|---|
Name (Required) | First and last name. |
Email (Required) | Login email address; must be unique to this user. |
Role (Required) | A valid REST API user role (admin , user , limited_user, observer , restricted_access , read_only_user , read_only_limited_user ). Note: read_only_user and read_only_limited_user roles require Stakeholder user licenses. Read Billing, Invoices and Payments for more information about Stakeholder users. |
Title | Job title. |
Country Code | 1-3 digit country calling code. Please refer to Supported Countries for more information about valid country codes. |
Phone Number | The user’s phone number where they will receive SMS and phone call notifications. |
Teams | 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 | User role that will be applied to the given Teams. Must be a valid Team role (i.e., Responder, Observer, Manager). |
Updated about 1 month ago