# PagerDuty Source

<p><a href="https://www.PagerDuty.com/" >PagerDuty</a> is a SaaS platform that helps you prevent and resolve business-impacting incidents, thereby improving the customer experience.</p>
<p>This guide will help you set up PagerDuty as a source in RudderStack.</p>

    <div>
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/WO0P4X9Rans?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" title="YouTube video"></iframe>
    </div>

<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="get-started">Get started</h2><ol>
<li>Go to your <a href="https://app.rudderstack.com/" >RudderStack dashboard</a> and click <strong>Add Source</strong>. From the list of <strong>Event Streams</strong> sources, select <strong>PagerDuty</strong>.</li>
<li>Assign a name to your source and click <strong>Continue</strong>.</li>
<li>Your PagerDuty source is now configured. Go to the <strong>Settings</strong> tab of the source and note the <strong>Webhook URL</strong>:</li>
</ol>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-sources/source-webhook-url.webp"
        
        >
        <img src="/docs/images/event-stream-sources/source-webhook-url.webp" 
         alt="PagerDuty source webhook URL"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ol start="4">
<li>Log in to your <a href="https://app.pagerduty.com/">PagerDuty account</a>.</li>
<li>Go to <strong>Integrations</strong> &gt; <strong>Generic Webhooks (v3)</strong> and click <strong>New Webhook</strong>.</li>
<li>Enter the webhook URL obtained in <strong>Step 3</strong>, and other required details:</li>
</ol>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-sources/pagerduty-source-webhook.webp"
        
        >
        <img src="/docs/images/event-stream-sources/pagerduty-source-webhook.webp" 
         alt="PagerDuty source webhook URL"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ol start="6">
<li>Click <strong>Add Webhook</strong>.</li>
</ol>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="event-transformation">Event transformation</h2><p>RudderStack ingests all events mentioned in the <a href="https://developer.pagerduty.com/docs/ZG9jOjQ1MTg4ODQ0-overview#event-types" >PagerDuty documentation</a> after converting them into the RudderStack event format. It also maps the following properties from the PagerDuty event payload to the RudderStack properties:</p>
<table>
  <thead>
      <tr>
          <th>PagerDuty property</th>
          <th>RudderStack property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>event_type</code></td>
          <td><code>event</code></td>
      </tr>
      <tr>
          <td><code>id</code></td>
          <td><code>messageId</code></td>
      </tr>
      <tr>
          <td><code>occurred_at</code></td>
          <td><code>OriginalTimeStamp</code></td>
      </tr>
      <tr>
          <td><code>resource_type</code></td>
          <td><code>properties.resourceType</code></td>
      </tr>
      <tr>
          <td><code>data</code></td>
          <td><code>properties.data</code></td>
      </tr>
      <tr>
          <td><code>client</code></td>
          <td><code>properties.client</code></td>
      </tr>
      <tr>
          <td><code>agent</code></td>
          <td><code>context.traits</code></td>
      </tr>
      <tr>
          <td><code>userId</code></td>
          <td><code>agent.id</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="how-rudderstack-creates-the-event-payload">How RudderStack creates the event payload</h2><p>This section details how RudderStack receives the data from PagerDuty source and creates the resulting payload.</p>
<p>A sample payload sent by PagerDuty is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">json<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-json" data-lang="json">{
  &#34;event&#34;: {
    &#34;id&#34;: &#34;01DEN0V2VIFEN5871PQGX72URP&#34;,
    &#34;event_type&#34;: &#34;incident.triggered&#34;,
    &#34;resource_type&#34;: &#34;incident&#34;,
    &#34;occurred_at&#34;: &#34;2022-12-07T10:56:52.337Z&#34;,
    &#34;agent&#34;: {
      &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/users/PXZZD2E&#34;,
      &#34;id&#34;: &#34;PXZZD2E&#34;,
      &#34;self&#34;: &#34;https://api.pagerduty.com/users/PXZZD2E&#34;,
      &#34;summary&#34;: &#34;mihir patel&#34;,
      &#34;type&#34;: &#34;user_reference&#34;
    },
    &#34;client&#34;: {
      &#34;name&#34;: &#34;Monitoring Service&#34;,
      &#34;url&#34;: &#34;https://monitoring.service.com&#34;
    },
    &#34;data&#34;: {
      &#34;id&#34;: &#34;Q3S7IX2U5KTCOY&#34;,
      &#34;type&#34;: &#34;incident&#34;,
      &#34;self&#34;: &#34;https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY&#34;,
      &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY&#34;,
      &#34;number&#34;: 2,
      &#34;status&#34;: &#34;triggered&#34;,
      &#34;incident_key&#34;: &#34;faaecfc0aca04b6ea07154188b5d3c6c&#34;,
      &#34;created_at&#34;: &#34;2022-12-07T10:56:52Z&#34;,
      &#34;title&#34;: &#34;Server Crashed&#34;,
      &#34;service&#34;: {
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/services/PAJBUTT&#34;,
        &#34;id&#34;: &#34;PAJBUTT&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/services/PAJBUTT&#34;,
        &#34;summary&#34;: &#34;Database&#34;,
        &#34;type&#34;: &#34;service_reference&#34;
      },
      &#34;assignees&#34;: [{
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/users/PXZZD2E&#34;,
        &#34;id&#34;: &#34;PXZZD2E&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/users/PXZZD2E&#34;,
        &#34;summary&#34;: &#34;mihir patel&#34;,
        &#34;type&#34;: &#34;user_reference&#34;
      }],
      &#34;escalation_policy&#34;: {
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4&#34;,
        &#34;id&#34;: &#34;PB7HKU4&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/escalation_policies/PB7HKU4&#34;,
        &#34;summary&#34;: &#34;Default&#34;,
        &#34;type&#34;: &#34;escalation_policy_reference&#34;
      },
      &#34;teams&#34;: [],
      &#34;priority&#34;: {
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/account/incident_priorities&#34;,
        &#34;id&#34;: &#34;PPMNDVQ&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/priorities/PPMNDVQ&#34;,
        &#34;summary&#34;: &#34;P1&#34;,
        &#34;type&#34;: &#34;priority_reference&#34;
      },
      &#34;urgency&#34;: &#34;high&#34;,
      &#34;conference_bridge&#34;: null,
      &#34;resolve_reason&#34;: null
    }
  }
}</code></pre></div>
</div>
<p>RudderStack transforms the above payload into the following <a href="https://www.rudderstack.com/docs/event-spec/standard-events/track/" ><code>track</code></a> payload:</p>
<div class="rs-code">
  <div class="rs-code__head">json<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-json" data-lang="json">{
  &#34;type&#34;: &#34;track&#34;,
  &#34;event&#34;: &#34;Incident Triggered&#34;,
  &#34;userId&#34;: &#34;PXZZD2E&#34;,
  &#34;context&#34;: {
    &#34;traits&#34;: {
      &#34;id&#34;: &#34;PXZZD2E&#34;,
      &#34;self&#34;: &#34;https://api.pagerduty.com/users/PXZZD2E&#34;,
      &#34;type&#34;: &#34;user_reference&#34;,
      &#34;summary&#34;: &#34;mihir patel&#34;,
      &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/users/PXZZD2E&#34;
    },
    &#34;library&#34;: {
      &#34;name&#34;: &#34;unknown&#34;,
      &#34;version&#34;: &#34;unknown&#34;
    },
    &#34;integration&#34;: {
      &#34;name&#34;: &#34;PagerDuty&#34;
    }
  },
  &#34;rudderId&#34;: &#34;a44e6807-d09c-4613-93f8-83ccd8b55901&#34;,
  &#34;messageId&#34;: &#34;01DEN0V2VIFEN5871PQGX72URP&#34;,
  &#34;properties&#34;: {
    &#34;data&#34;: {
      &#34;id&#34;: &#34;Q3S7IX2U5KTCOY&#34;,
      &#34;self&#34;: &#34;https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY&#34;,
      &#34;type&#34;: &#34;incident&#34;,
      &#34;teams&#34;: [],
      &#34;title&#34;: &#34;Server Crashed&#34;,
      &#34;number&#34;: 2,
      &#34;status&#34;: &#34;triggered&#34;,
      &#34;service&#34;: {
        &#34;id&#34;: &#34;PAJBUTT&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/services/PAJBUTT&#34;,
        &#34;type&#34;: &#34;service_reference&#34;,
        &#34;summary&#34;: &#34;Database&#34;,
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/services/PAJBUTT&#34;
      },
      &#34;urgency&#34;: &#34;high&#34;,
      &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY&#34;,
      &#34;priority&#34;: {
        &#34;id&#34;: &#34;PPMNDVQ&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/priorities/PPMNDVQ&#34;,
        &#34;type&#34;: &#34;priority_reference&#34;,
        &#34;summary&#34;: &#34;P1&#34;,
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/account/incident_priorities&#34;
      },
      &#34;assignees&#34;: [{
        &#34;id&#34;: &#34;PXZZD2E&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/users/PXZZD2E&#34;,
        &#34;type&#34;: &#34;user_reference&#34;,
        &#34;summary&#34;: &#34;mihir patel&#34;,
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/users/PXZZD2E&#34;
      }],
      &#34;created_at&#34;: &#34;2022-12-07T10:56:52Z&#34;,
      &#34;incident_key&#34;: &#34;faaecfc0aca04b6ea07154188b5d3c6c&#34;,
      &#34;resolve_reason&#34;: null,
      &#34;conference_bridge&#34;: null,
      &#34;escalation_policy&#34;: {
        &#34;id&#34;: &#34;PB7HKU4&#34;,
        &#34;self&#34;: &#34;https://api.pagerduty.com/escalation_policies/PB7HKU4&#34;,
        &#34;type&#34;: &#34;escalation_policy_reference&#34;,
        &#34;summary&#34;: &#34;Default&#34;,
        &#34;html_url&#34;: &#34;https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4&#34;
      }
    },
    &#34;client&#34;: {
      &#34;url&#34;: &#34;https://monitoring.service.com&#34;,
      &#34;name&#34;: &#34;Monitoring Service&#34;
    },
    &#34;resourceType&#34;: &#34;incident&#34;
  },
  &#34;integrations&#34;: {
    &#34;PagerDuty&#34;: false
  },
  &#34;originalTimestamp&#34;: &#34;2022-12-07T10:56:52.000Z&#34;
}</code></pre></div>
</div>

