<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Accessing API Key Stored in External Vault (CyberArk/CCP) from Script Include in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/accessing-api-key-stored-in-external-vault-cyberark-ccp-from/m-p/3601769#M7944</link>
    <description>&lt;DIV&gt;&lt;P&gt;I have a requirement where an API key is stored in an external CCP vault (for example, CyberArk), and ServiceNow has a corresponding credential record in the &lt;STRONG&gt;discovery_credential&lt;/STRONG&gt; table.&lt;/P&gt;&lt;P&gt;The actual API key is not stored in ServiceNow. Instead, the credential record contains the credential reference/ID, and during execution the MID Server resolves the secret from the vault and injects it into the REST request (Authorization header).&lt;/P&gt;&lt;P&gt;This setup works successfully in &lt;STRONG&gt;Flow Designer&lt;/STRONG&gt;, where the credential is resolved automatically.&lt;/P&gt;&lt;P&gt;However, I now need to call the same API from a &lt;STRONG&gt;Script Include&lt;/STRONG&gt; as part of a custom integration and I'm not sure what the recommended approach is.&lt;/P&gt;&lt;P&gt;If the credential were stored directly in ServiceNow, I could use credential provider APIs such as sn_cc.StandardCredentialsProvider. But since the secret resides in the external vault and only the credential reference exists in ServiceNow, I'm unsure how to retrieve or use it in script.&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How can I use a vault-backed credential from a Script Include?&lt;/LI&gt;&lt;LI&gt;Is there a supported API to resolve the secret at runtime from the credential record?&lt;/LI&gt;&lt;LI&gt;Should I be using a Connection &amp;amp; Credential Alias instead of directly accessing the credential?&lt;/LI&gt;&lt;LI&gt;Does anyone have an example of making a REST call from script using a credential whose secret is stored in CyberArk/CCP?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any guidance or best practices would be greatly appreciated.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 24 Sep 2026 10:21:35 GMT</pubDate>
    <dc:creator>bandarunave</dc:creator>
    <dc:date>2026-09-24T10:21:35Z</dc:date>
    <item>
      <title>Accessing API Key Stored in External Vault (CyberArk/CCP) from Script Include</title>
      <link>https://www.servicenow.com/community/community-central-forum/accessing-api-key-stored-in-external-vault-cyberark-ccp-from/m-p/3601769#M7944</link>
      <description>&lt;DIV&gt;&lt;P&gt;I have a requirement where an API key is stored in an external CCP vault (for example, CyberArk), and ServiceNow has a corresponding credential record in the &lt;STRONG&gt;discovery_credential&lt;/STRONG&gt; table.&lt;/P&gt;&lt;P&gt;The actual API key is not stored in ServiceNow. Instead, the credential record contains the credential reference/ID, and during execution the MID Server resolves the secret from the vault and injects it into the REST request (Authorization header).&lt;/P&gt;&lt;P&gt;This setup works successfully in &lt;STRONG&gt;Flow Designer&lt;/STRONG&gt;, where the credential is resolved automatically.&lt;/P&gt;&lt;P&gt;However, I now need to call the same API from a &lt;STRONG&gt;Script Include&lt;/STRONG&gt; as part of a custom integration and I'm not sure what the recommended approach is.&lt;/P&gt;&lt;P&gt;If the credential were stored directly in ServiceNow, I could use credential provider APIs such as sn_cc.StandardCredentialsProvider. But since the secret resides in the external vault and only the credential reference exists in ServiceNow, I'm unsure how to retrieve or use it in script.&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How can I use a vault-backed credential from a Script Include?&lt;/LI&gt;&lt;LI&gt;Is there a supported API to resolve the secret at runtime from the credential record?&lt;/LI&gt;&lt;LI&gt;Should I be using a Connection &amp;amp; Credential Alias instead of directly accessing the credential?&lt;/LI&gt;&lt;LI&gt;Does anyone have an example of making a REST call from script using a credential whose secret is stored in CyberArk/CCP?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any guidance or best practices would be greatly appreciated.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Sep 2026 10:21:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/accessing-api-key-stored-in-external-vault-cyberark-ccp-from/m-p/3601769#M7944</guid>
      <dc:creator>bandarunave</dc:creator>
      <dc:date>2026-09-24T10:21:35Z</dc:date>
    </item>
  </channel>
</rss>

