openapi: 3.0.1
info:
  title: KnowBe4 API Reference Guide
  x-logo:
    url: 'https://helpimg.s3.us-east-1.amazonaws.com/Status_Page/knowbe4-logo-black-orange-rgb.png'
    altText: KnowBe4 logo

security:
  - BearerAuth: []
servers:
  - url: "https://us.api.knowbe4.com"
    description: US Server
    variables:
      basePath:
        default: https://us.api.knowbe4.com
  - url: "https://eu.api.knowbe4.com"
    description: EU Server
    variables:
      basePath:
        default: https://eu.api.knowbe4.com
tags:
  - name: Introduction
    description:
      <p>KnowBe4’s APIs are <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">REST APIs</a> that allow you to pull phishing, training, user, and group data from the KnowBe4 console. Data is returned in a JSON structure by default--no additional parameter is needed.</p>
      <p>By using KnowBe4's APIs, you agree to our <a href="#tag/Terms-of-Use">Terms of Use</a>.</p>
      <p>Our APIs use resource-oriented URLs for requests and HTTP response codes for error handling. HTTP features, such as HTTP authentication and HTTP verbs, are built-in and understood by standard HTTP clients.</p>
      <p>Our APIs are available to customers with Platinum, Diamond, SAT Foundation, and SAT Advanced subscriptions. We offer limited support for our APIs.</p>
      <p style="background-color:#e9e7e6; color:#676768; border:0px solid; padding:12px; border-radius:0px;"><mark style="background-color:#e9e7e6;"><i class="fas fa-info-circle"></i>&nbsp;Anonymized KnowBe4 accounts (accounts that have elected to make their user data anonymous) will not be able to retrieve any anonymized data. See our <a href="https://support.knowbe4.com/hc/en-us/articles/115009509107" target="_blank">Anonymous Console</a> documentation to review what data will be available on anonymized accounts.</mark></p>
  - name: Base URL
    description:
      <p>When submitting API requests, you will need to use the correct base URL depending on where your KnowBe4 account is located. </p> <ul><li>Accounts on the US server (located at <a href="https://training.knowbe4.com/" target="_blank">training.knowbe4.com</a>) must use the Base URL of <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">https://us.api.knowbe4.com</mark>.</li> <li>Accounts on the EU server (located at <a href="https://eu.knowbe4.com/" target="_blank">eu.knowbe4.com</a>) must use <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">https://eu.api.knowbe4.com</mark>.</li> <li>Accounts on the CA server (located at <a href="https://ca.knowbe4.com/" target="_blank">ca.knowbe4.com</a>) must use <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">https://ca.api.knowbe4.com</mark>.</li> <li>Accounts on the UK server (located at <a href="https://uk.knowbe4.com/" target="_blank">uk.knowbe4.com</a>) must use <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">https://uk.api.knowbe4.com</mark>.</li> <li>Accounts on the DE server (located at <a href="https://de.knowbe4.com/" target="_blank">de.knowbe4.com</a>) must use <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">https://de.api.knowbe4.com</mark>.</li></ul> </p>
      <p style="background-color:#e9e7e6; color:#676768; border:0px solid; padding:12px; border-radius:0px;"><mark style="background-color:#e9e7e6;"><i class="fas fa-info-circle"></i>&nbsp;The shell and HTTP examples shown below use the <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">https://us.api.knowbe4.com</mark> base URL. Be sure to modify your request if your account is on the EU, CA, UK, or DE server.</mark></p>
  - name: Authentication
    description:
      <p>Authenticate your account by including your secret API key in the request. You can access your API key and generate a new key if needed in your <a href="https://training.knowbe4.com/app/api_tokens/reporting" target="_blank">Reporting API Management Console</a>. Your API keys provide access to the data within your KnowBe4 platform and should be kept private. Do not share your API key in publicly-accessible areas.</p>
      <p>The API key should be included in all API requests to the server. The header should look like the following:</p>
      <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">Authorization&#x3A; Bearer &lt;your_token&gt;</mark></br>
      <p style="background-color:#e9e7e6; color:#676768; border:0px solid; padding:12px; border-radius:0px;"><mark style="background-color:#e9e7e6;"><i class="fas fa-info-circle"></i>&nbsp;You must replace <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">	&lt;your_token&gt;</mark> with your account API key.</mark></p>
      <p>All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.</p>
      <p>Please note that Reporting APIs and User Event APIs do not share an API key. User Event API keys must be generated in the <a href="https://training.knowbe4.com/app/api_tokens/user_event/keys" target="_blank">User Event API Management Console</a>.</p>
  - name: Request IDs
    description:
      <p>Each API request has an associated request identifier. You can find this value in the response headers, under X-Request-Id. <b>If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution</b>.</p>
      <p>Example:&nbsp;<mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">X-Request-Id →1235678-39e4-4005-bad8-33ec22f78fc0</mark></p>
  - name: Response Format
    description:
      <p>The supported response format is JSON. The response will be returned in a JSON structure by default--no additional parameter is needed. All dates and times in the response will be in UTC (Coordinated Universal Time) despite your time zone. These dates and times will be indicated in the response code by the Z at the end of the datetime value.</p>
  - name: Pagination
    description:
      <p>Pagination is supported for all API endpoint requests that return multiple objects. These parameters are optional when making an HTTP request. The default pagination doesn't return all data, so pagination is required to obtain all available data endpoints that return multiple objects. The values used by default are indicated below.</p>
      <p style="background-color:#e9e7e6; color:#676768; border:0px solid; padding:12px; border-radius:0px;"><mark style="background-color:#e9e7e6;"><i class="fas fa-info-circle"></i>&nbsp;In July 2026, we’ll be deprecating the page parameter. From that date forward, you’ll need to use the per_page or cursor parameters for pagination requests.</mark></p>
      <table>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Default</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>page</td>
            <td>1</td>
            <td>The page number you want to retrieve.</td>
          </tr>
          <tr>
            <td>per_page</td>
            <td>100</td>
            <td>The maximum number of results returned in the response (Max = 500)</td>
          </tr>
           <tr>
            <td>cursor</td>
            <td>null</td>
            <td>The pointer of the current cursor that allows you to navigate through large result sets. Set cursor=0 in your first request to begin pagination. The <a href="https://developer.knowbe4.com/rest/reporting#tag/Users/paths/~1v1~1users~1%7Buser_id%7D~1risk_score_history/get">Get a Specific User's Risk Score History</a> endpoint is excluded from cursor pagination and returns up to 1000 records. 
            </td>
          </tr>
        </tbody>
      </table>
      <p>The returned results are listed in sequence with the request's response when the <mark style="background-color:#f2f2f2; color:#676768; font-family:courier; padding:2px 5px;">per_page</mark> parameters and page numbers remain the same as long as the reported data itself does not change.</p>
  - name: Account
    externalDocs:
      description: Find out more at KnowBe4.com
      url: http://knowbe4.com
  - name: Users
    externalDocs:
      description: Find out more at KnowBe4.com
      url: http://knowbe4.com
  - name: Groups
    externalDocs:
      description: Find out more at KnowBe4.com
      url: http://knowbe4.com
  - name: Phishing
    externalDocs:
      description: Find out more at KnowBe4.com
      url: http://knowbe4.com
  - name: Training
    externalDocs:
      description: Find out more at KnowBe4.com
      url: http://knowbe4.com
  - name: Rate Limiting
    description:
      <p>Usage of KnowBe4's Reporting APIs is limited to 2,000 requests per day plus the number of licensed users on your account. The APIs may only be accessed four times per second. The API burst limit is 50 requests per minute. Please note that the API bursts limits will start around five (5) minutes and the API daily limit starts around twenty-four (24) hours from the first API request.</p>
      <p>By using KnowBe4's APIs, you agree to our API <a href="#tag/Terms-of-Use">Terms of Use</a>.</p>
  - name: Terms of Use
    description:
      <h2>API Terms of Use</h2>
      <hr>
      <p>This agreement (“Terms”) between you and KnowBe4, Inc. applies to your use of KnowBe4’s Application  Programming Interface (“API”), alone or in combination with any services provided by KnowBe4 as     defined in KnowBe4’s Terms of Service and Privacy Policy (collectively “KnowBe4 Terms”). By using the APIs, you’re agreeing to these API Terms and the KnowBe4 Terms.</p>
      <h3>Section 1&#x3A; Account and Registration</h3>
      <ol type="a">
        <li><b>Accepting the Terms</b>&#x3A; You may not use the APIs and may not accept the API Terms if (a) you are not of legal age to form a binding contract with KnowBe4, or (b) you are a person barred from using or receiving the APIs under the applicable laws of the United States or other countries including the country in which you are a resident or from which you use the APIs.
        </li>
      </br>
        <li>
          <b>Entity Level Acceptance</b>&#x3A; If you are using the APIs on behalf of an entity, you represent and warrant that you have authority to bind that entity to the Terms and by accepting the Terms, you are doing so on behalf of that entity (and all references to "you" in the Terms refer to that entity).
        </li>
      </br>
        <li>
          <b>Registration</b>&#x3A; In order to access the APIs you will be required to provide certain information (such as an account-specific secret key provided to you through the KnowBe4 console) to authenticate the APIs, or as part of your continued use of the APIs.
        </li>
      </ol>
      <h3>Section 2&#x3A; Using Our APIs</h3>
      <ol type="a">
        <li>
          <b>Compliance with Law, Third Party Rights, and Other KnowBe4 Terms of Service</b>&#x3A; You will comply with all applicable law, regulation, and third party rights (including without limitation laws regarding the import or export of data or software, privacy, and local laws). You will not use the APIs to encourage or promote illegal activity or violation of third party rights. You will not violate any other terms of service with KnowBe4 (or its affiliates).
        </li>
      </br>
        <li>
          <b>Permitted Access</b>&#x3A; You will only access (or attempt to access) the APIs by the means described in the documentation. When KnowBe4 assigns you account-specific secret keys, you must use them with the applicable APIs. You will not misrepresent or mask your identity when using the APIs.
        </li>
      </br>
        <li>
          <b>API Limitations</b>&#x3A; KnowBe4 sets and enforces limits on your use of the APIs (e.g. limiting the number of API requests that you may make), in our sole discretion. API usage is designed for internal usage and as such the usage is limited to 2,000 requests per day plus the number of licensed users on your account. The APIs may only be accessed four times per second. You agree to, and will not attempt to circumvent, such limitations.
        </li>
      </br>
        <li>
          <b>Feedback</b>&#x3A; If you provide feedback or suggestions about our APIs, then we (and those we allow) may use such information without obligation to you.
        </li>
      </ol>
      <h3>Section 3&#x3A; Use</h3>
      <ol type="a">
        <li>
          <b>Monitoring</b>&#x3A; The APIs are designed to help you access and export data derived from your KnowBe4 platform. YOU AGREE THAT KNOWBE4 MAY MONITOR USE OF THE APIS TO ENSURE QUALITY, IMPROVE KNOWBE4 PRODUCTS AND SERVICES, AND VERIFY YOUR COMPLIANCE WITH THE TERMS. You will not interfere with this monitoring. KnowBe4 may use any technical means to overcome such interference. KnowBe4 may suspend access to the APIs by you without notice if we reasonably believe that you are in violation of the Terms.
        </li>
      </br>
        <li>
          <b>Security</b>&#x3A; You will use commercially reasonable efforts to protect user information from unauthorized access or use and will promptly report to your users any unauthorized access or use of such information to the extent required by applicable law.
        </li>
      </br>
        <li>
          <b>Ownership</b>&#x3A; KnowBe4 does not acquire ownership in your websites or applications, and by using our APIs, you do not acquire ownership of any rights in our APIs or the content that is accessed through our APIs.
        </li>
      </br>
        <li>
          <b>User Privacy</b>&#x3A; You will comply with all applicable privacy laws and regulations. You will provide and adhere to a privacy policy for your API use that clearly and accurately describes to users of your website or application what user information you collect and how you use and share such information (including for advertising) with KnowBe4 and third parties.
        </li>
      </ol>
      <h3>Section 4&#x3A; Prohibitions and Confidentiality</h3>
      <ol type="a">
        <li>
          <b>API Prohibitions</b>&#x3A; When using the APIs, you may not (or allow those acting on your behalf to)&#x3A;
          <ol>
            </br>
            <li>
              Sublicense an API for use by a third party. Consequently, you will not create a website, platform, or application that functions substantially the same as the APIs or the KnowBe4 platform and offer it for use by third parties.
            </li>
            <li>
              Perform an action with the intent of introducing to KnowBe4 products and services any viruses, worms, defects, Trojan horses, malware, or any items of a destructive nature.
            </li>
            <li>
              Defame, abuse, harass, stalk, or threaten others.
            </li>
            <li>
              Interfere with or disrupt the APIs or the servers or networks providing the APIs.
            </li>
            <li>
              Promote or facilitate unlawful online gambling or disruptive commercial messages or advertisements.
            </li>
            <li>
              Reverse engineer or attempt to extract the source code from any API or any related software, except to the extent that this restriction is expressly prohibited by applicable law.
            </li>
            <li>
              Use the APIs for any activities where the use or failure of the APIs could lead to death, personal injury, or environmental damage (such as the operation of nuclear facilities, air traffic control, or life support systems).
            </li>
            <li>
              Use the APIs to process or store any data that is subject to the International Traffic in Arms Regulations maintained by the U.S. Department of State.
            </li>
            <li>
              Remove, obscure, or alter any KnowBe4 terms of service or any links to or notices of those terms. Unless otherwise specified in writing by KnowBe4, KnowBe4 does not intend use of the APIs to create obligations under the Health Insurance Portability and Accountability Act, as amended ("HIPAA"), and makes no representations that the APIs satisfy HIPAA requirements. If you are (or become) a "covered entity" or "business associate" as defined in HIPAA, you will not use the APIs for any purpose or in any manner involving transmitting protected health information to KnowBe4 unless you have received prior written consent to such use from KnowBe4.
            </li>
          </br>
          </ol>
        </li>
        <li>
          <b>Confidential Matters</b>
          <ol>
            </br>
            <li>
              Credentials (such as passwords, account-specific secret keys, and client IDs) are intended to be used by you to authenticate the APIs. You will keep your credentials confidential and make reasonable efforts to prevent and discourage others from using your credentials. Credentials may not be embedded in open source projects.
            </li>
            <li>
              Our communications to you and our APIs may contain KnowBe4 confidential information. KnowBe4 confidential information includes any materials, communications, and information that are marked confidential or that would normally be considered confidential under the circumstances. If you receive any such information, then you will not disclose it to any third party without KnowBe4's prior written consent. KnowBe4 confidential information does not include information that you independently developed, that was rightfully given to you by a third party without confidentiality obligation, or that becomes public through no fault of your own. You may disclose KnowBe4 confidential information when compelled to do so by law if you provide us reasonable prior notice, unless a court orders that we not receive notice.
            </li>
          </br>
          </ol>
        </li>
      </ol>
      <h3>Section 5&#x3A; Brand Features; Attribution</h3>
      <ol type="a">
        <li>
          <b>Brand Features</b>&#x3A; "Brand Features" is defined as the trade names, trademarks, service marks, logos, domain names, and other distinctive brand features of each party. Except where expressly stated, the Terms do not grant either party any right, title, or interest in or to the other party's Brand Features. All use by you of KnowBe4's Brand Features (including any goodwill associated therewith) will inure to the benefit of KnowBe4.
        </li>
      </br>
        <li>
          <b>Attribution</b>&#x3A; You agree to display any attribution(s) required by KnowBe4 as described in the documentation for the APIs. KnowBe4 hereby grants to you a nontransferable, nonsublicenseable, nonexclusive license while the Terms are in effect to display KnowBe4's Brand Features for the purpose of promoting or advertising that you use the APIs. You must only use the KnowBe4 Brand Features in accordance with the Terms and for the purpose of fulfilling your obligations under this Section. You understand and agree that KnowBe4 has the sole discretion to determine whether your attribution(s) and use of KnowBe4's Brand Features are in accordance with this section.
        </li>
      </br>
        <li>
          <b>Publicity</b>&#x3A; You will not make any statement regarding your use of the APIs which suggests partnership with, sponsorship by, or endorsement by KnowBe4 without KnowBe4's prior written approval.
        </li>
      </br>
      </ol>
      <h3>Section 6&#x3A; Privacy</h3>
      <ol type="a">
        <li>
          By using our APIs, KnowBe4 may use submitted information in accordance with our Privacy Policy.
        </li>
      </br>
      </ol>
      <h3>Section 7&#x3A; Termination</h3>
      <ol type="a">
        <li>
          <b>Termination</b>&#x3A; You may stop using our APIs at any time with or without notice. Further, if you want to terminate the Terms, you must provide KnowBe4 with prior written notice and upon termination, cease your use of the applicable APIs. KnowBe4 reserves the right to terminate the Terms with you or discontinue the APIs or any portion or feature or your access thereto for any reason and at any time without liability or other obligation to you.
        </li>
      </br>
        <li>
          <b>Your Obligations Post-Termination</b>&#x3A; Upon any termination of the Terms or discontinuation of your access to an APIs, you will immediately stop using the APIs and cease all use of the KnowBe4 Brand Features.
        </li>
      </br>
        <li>
          <b>Surviving Provisions</b>&#x3A; When the Terms come to an end, those terms that by their nature are intended to continue indefinitely will continue to apply, including but not limited to&#x3A; Sections 4b, 7, 8, and 9.
        </li>
      </br>
      </ol>
      <h3>Section 8&#x3A; Liability for our APIs</h3>
      <ol>
        <li>
          <b>WARRANTIES</b>&#x3A; EXCEPT AS EXPRESSLY SET OUT IN THE TERMS, KNOWBE4 NOR ITS VENDORS OR LICENSORS MAKE ANY SPECIFIC PROMISES ABOUT THE APIS. FOR EXAMPLE, WE DON'T MAKE ANY COMMITMENTS ABOUT THE CONTENT ACCESSED THROUGH THE APIS, THE SPECIFIC FUNCTIONS OF THE APIS, OR THEIR RELIABILITY, AVAILABILITY, OR ABILITY TO MEET YOUR NEEDS. WE PROVIDE THE APIS "AS IS". SOME JURISDICTIONS PROVIDE FOR CERTAIN WARRANTIES, LIKE THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. EXCEPT AS EXPRESSLY PROVIDED FOR IN THE TERMS, TO THE EXTENT PERMITTED BY LAW, WE EXCLUDE ALL WARRANTIES, GUARANTEES, CONDITIONS, REPRESENTATIONS, AND UNDERTAKINGS.
        </li>
      </br>
        <li>
          <b>LIMITATION OF LIABILITY</b>&#x3A; WHEN PERMITTED BY LAW, KNOWBE4, AND KNOWBE4'S VENDORS AND LICENSORS, WILL NOT BE RESPONSIBLE FOR LOST PROFITS, REVENUES, OR DATA; FINANCIAL LOSSES; OR INDIRECT, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES. TO THE EXTENT PERMITTED BY LAW, THE TOTAL LIABILITY OF KNOWBE4, AND ITS SUPPLIERS AND DISTRIBUTORS, FOR ANY CLAIM UNDER THE TERMS, INCLUDING FOR ANY IMPLIED WARRANTIES, IS LIMITED TO THE AMOUNT YOU PAID US TO USE THE APPLICABLE APIS (OR, IF WE CHOOSE, TO SUPPLYING YOU THE APIS AGAIN) DURING THE SIX MONTHS PRIOR TO THE EVENT GIVING RISE TO THE LIABILITY. IN ALL CASES, KNOWBE4, AND ITS VENDORS AND LICENSORS, WILL NOT BE LIABLE FOR ANY EXPENSE, LOSS, OR DAMAGE THAT IS NOT REASONABLY FORESEEABLE.
        </li>
      </br>
        <li>
          <b>Indemnification</b>&#x3A; Unless prohibited by applicable law, you will defend and indemnify KnowBe4, and its affiliates, directors, officers, employees, and users, against all liabilities, damages, losses, costs, fees (including legal fees), and expenses relating to any allegation or third-party legal proceeding to the extent arising from&#x3A;
          <ol>
            </br>
            <li>
              your misuse or your end user's misuse of the APIs;
            </li>
            <li>
              your violation or your end user's violation of the Terms; or
            </li>
            <li>
              any content or data routed into or used with the APIs by you, those acting on your behalf, or your end users.
            </li>
            </br>
          </ol>
        </li>
      </ol>
      <h3>Section 9&#x3A; General Provisions</h3>
      <ol type="a">
        <li>
          <b>Modification</b>&#x3A; We may modify the Terms or any portion to, for example, reflect changes to the law or changes to our APIs. You should look at the Terms regularly. Our documentation will be updated in the event of material changes, depreciations, or removal of functionality from the APIs so that you may continue using the APIs with minimal interruption. Changes will not apply retroactively and will become effective no sooner than 30 days after they are posted. But changes addressing new functions for an APIs or changes made for legal reasons will be effective immediately. If you do not agree to the modified Terms for an API, you should discontinue your use of that API. Your continued use of the API constitutes your acceptance of the modified Terms.
        </li>
      </br>
        <li>
          <b>General Legal Terms</b>&#x3A; We each agree to contract in the English language. If we provide a translation of the Terms, we do so for your convenience only and the English Terms will solely govern our relationship. The Terms do not create any third party beneficiary rights or any agency, partnership, or joint venture. Nothing in the Terms will limit either party's ability to seek injunctive relief. We are not liable for failure or delay in performance to the extent caused by circumstances beyond our reasonable control. If you do not comply with the Terms, and KnowBe4 does not take action right away, this does not mean that KnowBe4 is giving up any rights that it may have (such as taking action in the future). If it turns out that a particular term is not enforceable, this will not affect any other terms. The Terms are the entire agreement between you and KnowBe4 relating to its subject and supersede any prior or contemporaneous agreements on that subject. The laws of Florida, U.S.A., excluding Florida’s conflict of laws rules, will apply to any disputes arising out of or related to the Terms or the API. ALL CLAIMS ARISING OUT OF OR RELATING TO THE TERMS OR THE APIS WILL BE LITIGATED EXCLUSIVELY IN THE FEDERAL OR STATE COURTS OF HILLSBOROUGH COUNTY OR PINELLAS COUNTY, FLORIDA, USA, AND YOU AND KNOWBE4 CONSENT TO PERSONAL JURISDICTION IN THOSE COURTS.
        </li>
      </br>
      </ol>
  - name: Errors
    description:
      <p>KnowBe4 uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a campaign wasn't found, etc.), and codes in the 5xx range indicate an error with KnowBe4's servers (these are rare).</p>
      <table>
        <thead>
          <tr>
            <th>Error Code</th>
            <th>Meaning</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>401</td>
            <td>Unauthorized -- Your API key is incorrect.</td>
          </tr>
          <tr>
            <td>403</td>
            <td>Forbidden -- The request is not allowed.</td>
          </tr>
          <tr>
            <td>404</td>
            <td>Not Found -- The specified resource could not be found.</td>
          </tr>
          <tr>
            <td>406</td>
            <td>Incorrect Response Format Requested -- The output must be in JSON format.</td>
          </tr>
          <tr>
            <td>429</td>
            <td>Too many requests -- Too many requests were submitted at once. See Rate Limiting section above.</td>
          </tr>
          <tr>
            <td>500</td>
            <td>Internal Server Error -- We had a problem with our server. Try again later.</td>
          </tr>
          <tr>
            <td>503</td>
            <td>Service Unavailable -- We're temporarily offline for maintenance. Please try again later.</td>
          </tr>
        </tbody>
      </table>

paths:
  /v1/account:
    get:
      tags:
      - Account
      summary: Get Account and Subscription Data
      description: This endpoint retrieves account data from you Knowbe4 account, including your subscription level, number of seats, risk score history, and more.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'

  /v1/account/risk_score_history:
     get:
        tags:
        - Account
        summary: Get Account Risk Score History
        description: This endpoint retrieves your Knowbe4 account risk score history.
        parameters:
        - name: full=true
          description: Include the entire risk score history of your organization. If this parameter isn't used, six months of data will show by default.
          in: query
          schema:
            type: string
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/AccountRisk'

  /v1/users:
    get:
      tags:
      - Users
      summary: Get a List of All Users
      description: This endpoint retrieves a list of all users in your KnowBe4 account.
      parameters:
      - name: status=active
        description: Returns a list of all active users in your account.
        in: query
        schema:
          type: string
      - name: status=archived
        description: Returns a list of all archived users in your account.
        in: query
        schema:
          type: string
      - name: group_id=[group_id]
        description: Returns a list of all users who are members of the group indicated by the [group_id].
        in: query
        schema:
          type: string
      - name: expand=group
        description: Expands groups to provide additional details.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'

  /v1/users/{user_id}:
    get:
      tags:
      - Users
      summary: Get a Specific User
      description: This endpoint retrieves a specific user based on the provided user identifier (user_id).
      parameters:
      - name: user_id
        description: User ID
        in: path
        required: true
        schema:
          type: integer
      responses:
         '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'



  /v1/groups/{group_id}/members:
    get:
      tags:
      - Users
      summary: Get a List of Users in a Specific Group
      description: This endpoint retrieves a list of all users who are members of a specific group.
      parameters:
      - name: group_id
        description: Group ID
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'


  /v1/users/{user_id}/risk_score_history:
    get:
      tags:
      - Users
      summary: Get a Specific User's Risk Score History
      description: This endpoint retrieves risk score history for a specific user based on the provided user identifier (user_id).
      parameters:
      - name: full=true
        description: Include the entire risk score history of a specifc user. If this parameter isn't used, six months of data will show by default.
        in: query
        schema:
          type: array
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersRisk'


  /v1/groups:
    get:
      tags:
      - Groups
      summary: Get a List of All Groups
      description: This endpoint retrieves a list of all groups in your KnowBe4 account.
      parameters:
      - name: status=active
        description: Returns a list of all active groups in your account.
        in: query
        schema:
          type: string
      - name: status=archived
        description: Returns a list of all archived groups in your account.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Groups'


  /v1/groups/{group_id}:
    get:
      tags:
      - Groups
      summary: Get a Specific Group
      description: This endpoint retrieves a specific group in your KnowBe4 account, based on the provided group identifier (group_id).
      parameters:
      - name: group_id
        description: Group ID
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Groups'


  /v1/groups/{group_id}/risk_score_history:
    get:
      tags:
      - Groups
      summary: Get a Specific Group's Risk Score History
      description: This endpoint retrieves risk score history for a specific group in your KnowBe4 account, based on the provided group identifier (group_id).
      parameters:
      - name: full=true
        description: Include the entire risk score history for a specific group. If this parameter isn't used, six months of data will show by default.
        in: query
        schema:
          type: array
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupsRisk'


  /v1/phishing/campaigns:
      get:
        tags:
        - Phishing
        summary: Get All Phishing Campaigns
        description: This endpoint retrieves data from all the phishing campaigns in your account.
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Phishing'

  /v1/phishing/campaigns/{campaign_id}:
    get:
      tags:
      - Phishing
      summary: Get a Specific Phishing Campaign
      description: This endpoint retrieves data from a specific phishing campaign, based on the provided campaign identifier (campaign_id).
      parameters:
      - name: campaign_id
        in: path
        description: Campaign ID
        required: true
        schema:
          type: integer
      - name: campaign_type=callback
        description: Returns information related to callback phishing campaigns.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phishing'


  /v1/phishing/security_tests:
    get:
      tags:
      - Phishing
      summary: Get All Phishing Security Tests (PSTs)
      description: This endpoint retrieves a list of all phishing security tests in your account.
      parameters:
      - name: campaign_type=callback
        description: Returns information related to callback phishing campaigns.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PST'


  /v1/phishing/campaigns/{campaign_id}/security_tests:
    get:
      tags:
      - Phishing
      summary: Get All PSTs From a Specific Campaign
      description: This endpoint retrieves a list of all phishing security tests from a specific phishing campaign, based on the provided phishing campaign identifier (campaign_id).
      parameters:
      - name: campaign_id
        description: Campaign ID
        in: path
        required: true
        schema:
          type: integer
      - name: campaign_type=callback
        description: Returns information related to callback phishing campaigns.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PST'


  /v1/phishing/security_tests/{pst_id}:
    get:
      tags:
      - Phishing
      summary: Get a Specific PST
      description: This endpoint retrieves data from a specific phishing security test, based on the provided phishing security test identifier (pst_id).
      parameters:
      - name: pst_id
        description: PST ID
        in: path
        required: true
        schema:
          type: integer
      - name: campaign_type=callback
        description: Returns information related to callback phishing campaigns.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PST'


  /v1/phishing/security_tests/{pst_id}/recipients:
    get:
      tags:
      - Phishing
      summary: Get All Recipient Results
      description: This endpoint retrieves a list of all the recipients (users) that were part of a specific phishing security test, based on the provided phishing security test identifier (pst_id).
      parameters:
      - name: pst_id
        description: PST ID
        in: path
        required: true
        schema:
          type: integer
      - name: campaign_type=callback
        description: Returns information related to callback phishing campaigns.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Recipient'


  /v1/phishing/security_tests/{pst_id}/recipients/{recipient_id}:
    get:
      tags:
      - Phishing
      summary: Get a Specific Recipient's Results
      description: This endpoint retrieves details about a specific user's phishing security test results, based on the provided phishing security test identifier (pst_id) and recipient identifier (recipient_id).
      parameters:
      - name: pst_id
        description: PST ID
        in: path
        required: true
        schema:
          type: integer
      - name: recipient_id
        description: Recipient ID
        in: path
        required: true
        schema:
          type: integer
      - name: campaign_type=callback
        description: Returns information related to callback phishing campaigns.
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Recipient'


  /v1/training/store_purchases:
    get:
      tags:
      - Training
      summary: Get all Store Purchases
      description: This endpoint retrieves a list of all Store Purchases in your KnowBe4 account.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Training'


  /v1/training/store_purchases/{store_purchase_id}:
    get:
      tags:
      - Training
      summary: Get a Specific Store Purchase
      description: This endpoint retrieves a specific Store Purchase from your KnowBe4 account.
      parameters:
      - name: store_purchase_id
        description: Store Purchase ID
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Training'


  /v1/training/policies:
    get:
      tags:
      - Training
      summary: Get all Policies
      description: This endpoint retrieves a list of all uploaded policies in your KnowBe4 account.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'


  /v1/training/policies/{policy_id}:
    get:
      tags:
      - Training
      summary: Get a Specific Policy
      description: This endpoint retrieves a specific uploaded policy from your KnowBe4 account.
      parameters:
      - name: policy_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'


  /v1/training/campaigns:
    get:
      tags:
      - Training
      summary: Get all Training Campaigns
      description: Retrieves a list of all training campaigns in your account.
      responses:
        '200':
          description: Success 
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
      parameters:
        - name: exclude_percentages=false
          description: Excludes the `completion_percentage` field from the response to greatly speed up response time. If this parameter is set to anything other than `true`, the response limit will be set to 10.
          in: query
          schema:
            type: boolean


  /v1/training/campaigns/{campaign_id}:
    get:
      tags:
      - Training
      summary: Get a Specific Training Campaign
      description: This endpoint retrieves a specific Training Campaign from your KnowBe4 account.
      parameters:
      - name: campaign_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'


  /v1/training/enrollments:
    get:
      tags:
      - Training
      summary: Get all Training Enrollments
      description: This endpoint retrieves a list of all Training Enrollments in your KnowBe4 account.
      parameters:
      - name: store_purchase_id=[store_purchase_id]
        description: Returns a list of all training enrollments filtered by module, as indicated by the [store_purchase_id].
        in: query
        schema:
          type: integer
      - name: campaign_id=[campaign_id]
        description: Returns a list of all training enrollments filtered by a campaign, as indicated by the [campaign_id]. If the Show Scores option is enabled for a training campaign, the scores will also be displayed in the API.
        in: query
        schema:
          type: integer
      - name: user_id=[user_id]
        description: Returns a list of all training enrollments filtered by a user, as indicated by the [user_id]
        in: query
        schema:
          type: integer
      - name: exclude_archived_users=true
        description: Excludes archived users when returning a list of training enrollments
        in: query
        schema:
          type: boolean
      - name: include_campaign_id=true
        description: Returns the campaign ID for each training enrollment. 
        in: query
        schema:
          type: boolean
      - name: include_store_purchase_id=true
        description: Returns the store purchase ID for each training enrollment. 
        in: query
        schema:
          type: boolean
      - name: include_employee_number=true
        description: Returns the employee number for each training enrollment.
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollment'


  /v1/training/enrollments/{enrollment_id}:
    get:
      tags:
      - Training
      summary: Get a Specific Training Enrollment
      description: This endpoint retrieves a specific Training Enrollment from your KnowBe4 account.
      parameters:
      - name: enrollment_id
        description: Enrollment ID
        in: path
        required: true
        schema:
          type: integer
      - name: include_campaign_id=true
        description: Returns the campaign ID for each training enrollment. 
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollment'

components:
  schemas:
    Account:
      type: object
      properties:
        name:
          type: string
          format: varchar
          description: Organization's name. If the name is unavailable, the domain will be displayed.
          example: KB4-Demo
        type:
          type: string
          format: varchar
          description: Indicates whether the account is paid, trial, or free.
          example: paid
        domains:
          type: array
          description: An array of the allowed domains on the account.
          items:
            type: string
            format: varchar
            example: kb4-demo.com
        admins:
          type: array
          description: An array of admins on the account, along with each admin's basic user information.
          items:
            type: object
            properties:
              id:
                type: integer
                example: 974278
              first_name:
                type: string
                format: varchar
                example: Grace
              last_name:
                type: string
                format: varchar
                example: O'Malley
              email:
                type: string
                format: varchar
                example: grace.o@kb4-demo.com
        subscription_level:
          type: string
          format: varchar
          description: The account's subscription level. (Only appears with paid KnowBe4 subscription)
          example: Diamond
        subscription_end_date:
          type: string
          format: datetime
          description: The account's subscription end date. (Only appears with paid KnowBe4 subscription)
          example: "2021-03-06"
        number_of_seats:
          type: integer
          description: The number of seats available on the account. (Only appears with paid KnowBe4 subscription)
          example: 25
        current_risk_score:
          type: integer
          format: float
          description: Organization's current risk score(Example&colon; 13.7847).
          example: 45.742

    AccountRisk:
      type: object
      properties:
        risk_score:
          type: integer
          example: 37.3
        date:
          type: string
          format: varchar
          example: "2021-02-07"

    User:
      type: object
      properties:
        id:
          type: integer
          description: User ID.
          example: 667542
        employee_number:
          type: string
          format: varchar
          description: Employee Number.
          example: "19425"
        first_name:
          type: string
          format: varchar
          description: First name.
          example: William
        last_name:
          type: string
          format: varchar
          description: Last name.
          example: Marcoux
        job_title:
          type: string
          format: varchar
          description: Job title.
          example: VP of Sales
        email:
          type: string
          format: varchar
          description: Email.
          example: wmarcoux@kb4-demo.com
        phish_prone_percentage:
          type: integer
          format: float
          description: Phish-prone percentage.
          example: 14.235
        phone_number:
          type: string
          format: varchar
          description: Phone number.
          example: "555-554-2222"
        extension:
          type: string
          format: varchar
          description: Phone extension.
          example: "42"
        mobile_phone_number:
          type: string
          format: varchar
          description: Mobile phone number.
          example: "555-553-4422"
        location:
          type: string
          format: varchar
          description: Location.
          example: Office A
        division:
          type: string
          format: varchar
          description: Division.
          example: Sales
        manager_name:
          type: string
          format: varchar
          description: Manager's name.
          example: Michael Scott
        manager_email:
          type: string
          format: varchar
          description: Manager's email.
          example: mscott@kb4-demo.com
        provisioning_managed:
          type: boolean
          description: Indicates whether a user would be managed by AD, if enabled. Default is "true".
          example: false
        provisioning_guid:
          type: string
          format: varchar
          description: User provisioning GUID.
          example: null
        groups:
          type: array
          description: An array of group IDs (active or archived) that the user is a member of.
          items:
            type: integer
            example: 3264
        current_risk_score:
          type: integer
          format: float
          description: Organization's current risk score (Example&colon; 13.7847).
          example: 45.742
        aliases:
          type: array
          description: An array of alias email addresses for the user (imported from AD).
          items:
            type: string
            format: varchar
            example: alias_email@kb4-demo.com
        joined_on:
          type: string
          format: datetime
          description: Date the user was added to the KnowBe4 account.
          example: "2019-04-02T15:02:38.000Z"
        last_sign_in:
          type: string
          format: datetime
          description: Date the user last signed in to their KnowBe4 account.
          example: "2019-04-02T15:02:38.000Z"
        status:
          type: string
          format: varchar
          description: Status of user (active or archived).
          example: active
        organization:
          type: string
          format: varchar
          description: Organization.
          example: KB4-Demo
        department:
          type: string
          format: varchar
          description: Department.
          example: Sales
        language:
          type: string
          format: varchar
          description: User's language.
          example: English - United States
        comment:
          type: string
          format: varchar
          description: Comment as indicated in user profile.
          example: Low PPP
        employee_start_date:
          type: string
          format: datetime
          description: Employee start date.
          example: "2019-04-02T15:02:38.000Z"
        archived_at:
          type: string
          format: datetime
          description: Date the user was archived in KnowBe4 console, if applicable.
          example: null
        custom_field_1:
          type: string
          format: varchar
          description: Custom field 1
          example: Building C, 4th Floor
        custom_field_2:
          type: string
          format: varchar
          description: Custom field 2
          example: null
        custom_field_3:
          type: string
          format: varchar
          description: Custom field 3
          example: null
        custom_field_4:
          type: string
          format: varchar
          description: Custom field 4
          example: null
        custom_date_1:
          type: string
          format: date
          description: Custom date 1
          example: "1986-11-26"
        custom_date_2:
          type: string
          format: date
          description: Custom date 2
          example: null

    UsersRisk:
      type: object
      properties:
        risk_score:
          type: integer
          example: 37.3
        date:
          type: string
          format: varchar
          example: "2021-02-07"
          
    Groups:
      type: object
      properties:
        id:
          type: integer
          description: Group ID.
          example: 3142
        name:
          type: string
          format: varchar
          description: Group name.
          example: Customer Service
        group_type:
          type: string
          format: varchar
          description: Indicates the group type (console_group, smart_group, provisioning_managed_group).
          example: console_group
        provisioning_guid:
          type: string
          format: varchar
          description: User provisioning GUID (if applicable).
          example: abc12345-6789-abc-1234-456789abc123
        member_count:
          type: integer
          description: Number of members in the group.
          example: 42
        current_risk_score:
          type: integer
          format: float
          description: Organization's current risk score (Example&colon; 13.7847).
          example: 45.742
        status:
          type: string
          format: varchar
          description: Status of group (active or archived).
          example: active

    GroupsRisk:
      type: object
      properties:
        risk_score:
          type: integer
          example: 37.3
        date:
          type: string
          format: varchar
          example: "2021-02-07"

    Phishing:
      type: array
      items:
        type: object
        properties:
          campaign_id:
            type: integer
            description: Unique ID of the phishing campaign.
            example: 242333
          name:
            type: string
            format: varchar
            description: Name of the phishing campaign.
            example: One Time Phishing Security Test
          groups:
            type: array
            description: An array of groups targeted by the phishing campaign, including group name and id.
            items:
              type: object
              properties:
                group_id:
                  type: integer
                  example: 0
                name:
                  type: string
                  format: varchar
                  example: All Users
          last_phish_prone_percentage:
            type: integer
            description: Last phish-prone percentage on the campaign, shown in decimal format (Example&colon; 0.2 = 20%).
            example: 0.3
          last_run:
            type: string
            format: datetime
            description: Date and time of the last phishing security test in the campaign.
            example: "2019-04-02T15:02:38.000Z"
          status:
            type: string
            format: varchar
            description: Status of the campaign.
            example: Closed
          hidden:
            type: boolean
            description: Indicates if the campaign has been hidden from reports (True = Hidden)
            example: false
          send_duration:
            type: string
            format: varchar
            description: Duration of time the campaign will send phishing emails.
            example: 3 Business Days
          track_duration:
            type: string
            format: varchar
            description: Duration of time the campaign will track phishing security test failures after the final phishing email is sent.
            example: 3 Days
          frequency:
            type: string
            format: varchar
            description: How often the phishing campaign is configured to run.
            example: One Time
          difficulty_filter:
            type: array
            description: An array indicating what difficulty level(s) of phishing templates were chosen on the campaign, from 1 - 5
            items:
              type: integer
              minimum: 1
              maximum: 5
            example: [1, 2 ,3 ,4 ,5]
          create_date:
            type: string
            format: datetime
            description: Date and time the campaign was created.
            example: "2019-04-02T15:02:38.000Z"
          psts_count:
            type: integer
            description: Number of phishing security tests in the campaign.
            example: 1
          psts:
            type: array
            description: An array of all phishing security tests in the campaign, includes basic data about each phishing security test.
            items:
              type: object
              properties:
                pst_id:
                  type: integer
                  example: 1
                status:
                  type: string
                  format: varchar
                  example: Closed
                start_date:
                  type: string
                  format: datetime
                  example: "2019-04-02T15:02:38.000Z"
                users_count:
                  type: integer
                  example: 123
                phish_prone_percentage:
                  type: integer
                  example: 0.3
    PST:
      type: array
      items:
        type: object
        properties:
          campaign_id:
            type: integer
            description: Unique ID of the phishing campaign the test was a part of.
            example: 3423
          pst_id:
            type: integer
            description: Unique ID of the phishing security test.
            example: 16142
          status:
            type: string
            format: varchar
            description: Status of the phishing security test.
            example: Closed
          name:
            type: string
            format: varchar
            description: Name of phishing security test.
            example: Corporate Test
          groups:
            type: array
            description: An array of groups targeted by the phishing security test, including group name and id.
            items:
              type: object
              properties:
                group_id:
                  type: integer
                  example: 16342
                name:
                  type: string
                  format: varchar
                  example: Corporate Employees
          phish_prone_percentage:
            type: integer
            description: Phish-prone percentage on the test, shown in decimal format (Example&colon; 0.2 = 20%)
            example: 0.5
          started_at:
            type: string
            format: datetime
            description: Date and time the phishing security test started.
            example: "2019-04-02T15:02:38.000Z"
          duration:
            type: integer
            description: Duration of the phishing security test in calendar days (send_duration + track_duration).
            example: 1
          categories:
            type: array
            description: An array of the template categories included in this phishing security test, including the category name and id.
            items:
              type: object
              properties:
                category_id:
                  type: integer
                  example: 4237
                name:
                  type: string
                  format: varchar
                  example: Current Events
          template:
            type: object
            description: Template name, ID, difficulty, and type if a specific template was selected or if the chosen setting was "Random". Returns "null" if nothing was selected.
            properties:
              id:
                type: integer
                example: 11428
              name:
                type: string
                format: varchar
                example: CNN Breaking News
              difficulty:
                type: integer
                example: 3
              type:
                type: string
                format: varchar
                example: User
          landing-page:
            type: object
            description: An array including the name and ID of the landing page used as part of the campaign.
            properties:
              id:
                type: integer
                example: 1842
              name:
                type: string
                format: varchar
                example: SEI Landing Page
          scheduled_count:
            type: integer
            description: Number of users who were scheduled to receive phishing emails.
            example: 42
          delivered_count:
            type: integer
            description: Number of users who received phishing emails.
            example: 4
          opened_count:
            type: integer
            description: Number of users who opened the email.
            example: 24
          clicked_count:
            type: integer
            description: Number of users who clicked.
            example: 20
          replied_count:
            type: integer
            description: Number of users who replied.
            example: 0
          attachment_open_count:
            type: integer
            description: Number of users who opened an attachment.
            example: 3
          macro_enabled_count:
            type: integer
            description: Number of users who enabled a macro on an attachment they opened.
            example: 0
          data_entered_count:
            type: integer
            description: Number of users who entered data on a landing page.
            example: 0
          qr_code_scanned_count:
            type: integer
            description: Number of users who scanned a QR code.
            example: 0
          reported_count:
            type: integer
            description: Number of users who reported the email using the Phish Alert Button.
            example: 0
          bounced_count:
            type: integer
            description: Number of users whose phishing email bounced.
            example: 0
    Recipient:
      type: array
      items:
        type: object
        properties:
          recipient_id:
            type: integer
            description: Unique ID of the recipient (user).
            example: 3077742
          pst_id:
            type: integer
            description: Unique ID of the phishing security test.
            example: 14240
          user:
            type: object
            description: An array of phishing security test recipient information, including id, User provisioning GUID (if applicable), first and last name, and email.
            properties:
              id:
                type: integer
                example: 264215
              provisioning_guid:
                type: integer
                example: null
              first_name:
                type: string
                format: varchar
                example: Bob
              last_name:
                type: string
                format: varchar
                example: Ross
              email:
                type: string
                format: varchar
                example: bob.r@kb4-demo.com
          template:
            type: object
            description: An array displaying the template the user received, including the template name and id.
            properties:
              id:
                type: integer
                example: 2
              name:
                type: string
                format: varchar
                example: "Your Amazon Order"
              difficulty:
                type: integer
                example: 3
              type:
                type: string
                format: varchar
          scheduled_at:
            type: string
            format: datetime
            description: Date and time the user was scheduled to receive the phishing security test.
            example: "2019-04-02T15:02:38.000Z"
          delivered_at:
            type: string
            format: datetime
            description: Date and time the user received the phishing security test.
            example: "2019-04-02T15:02:38.000Z"
          opened_at:
            type: string
            format: datetime
            description: Date and time the user opened the phishing security test.
            example: "2019-04-02T15:02:38.000Z"
          clicked_at:
            type: string
            format: datetime
            description: Date and time the user clicked.
            example: "2019-04-02T15:02:38.000Z"
          replied_at:
            type: string
            format: datetime
            description: Date and time the user replied.
            example: null
          attachment_opened_at:
            type: string
            format: datetime
            description: Date and time the user opened at attachment.
            example: null
          macro_enabled_at:
            type: string
            format: datetime
            description: Date and time the user enabled a macro on an attachment they opened.
            example: null
          data_entered_at:
            type: string
            format: datetime
            description: Date and time the user entered data on a landing page.
            example: "2019-04-02T15:02:38.000Z"
          qr_code_scanned:
            type: string
            format: datetime
            description: Date and time the user scanned a QR code.
            example: "2022-05-12T15:29:54.000Z"
          reported_at:
            type: string
            format: datetime
            description: Date and time the user reported the email as phishing using the Phish Alert Button.
            example: null
          bounced_at:
            type: string
            format: datetime
            description: Date and time the phishing email designated for this user bounced.
            example: null
          ip:
            type: string
            format: varchar
            description: User's IP address.
            example: XX.XX.XXX.XXX
          ip_location:
            type: string
            format: varchar
            description: User's geolocation.
            example: St.Petersburg, FL
          browser:
            type: string
            format: varchar
            description: User's browser.
            example: Chrome
          browser_version:
            type: string
            format: varchar
            description: User's browser version.
            example: "48.0"
          os:
            type: string
            format: varchar
            description: User's operating system.
            example: MacOSX
    Training:
      type: object
      properties:
        store_purchased_id:
          type: integer
          description: ID.
          example: 6420
        content_type:
          type: string
          format: varchar
          description: Indicates that the item is a Store Purchase.
          example: Store Purchase
        name:
          type: string
          format: varchar
          description: Name.
          example: FFIEC (Financial Compliance)
        description:
          type: string
          format: varchar
          description: Description. (Up to 100 characters)
          example: This module covers specific IT...
        type:
          type: string
          format: varchar
          description: Type. (Training Module, Video Module, Video, Game, Poster/Artwork, Newsletter/Security Doc)
          example: Training Module
        duration:
          type: integer
          description: Duration, in minutes.
          example: 40
        retired:
          type: boolean
          description: Indicates if the Store Purchase item is retired. (True = Retired)
          example: false
        retirement_date:
          type: string
          format: datetime
          description: Retirement date.
          example: null
        publish_date:
          type: string
          format: datetime
          description: Published date.
          example: "2019-04-02T15:02:38.000Z"
        publisher:
          type: string
          format: varchar
          description: Publisher.
          example: Security Awareness Company
        purchase_date:
          type: string
          format: datetime
          description: Purchase date.
          example: "2019-04-02T15:02:38.000Z"
        policy_url:
          type: string
          format: varchar
          description: Policy URL location. (Null = No policy URL provided)
          example: null
    Policy:
      type: object
      properties:
        policy_id:
          type: integer
          description: Policy ID
          example: 2420
        content_type:
          type: string
          format: varchar
          description: Indicates that the item is an uploaded policy.
          example: Uploaded Policy
        name:
          type: string
          format: varchar
          description: Title of policy.
          example: Physical Security Policy
        minimum_time:
          type: integer
          description: Minimum number of minutes that the user is required to review the policy. (Null = No minimum time required)
          example: 3
        default_language:
          type: string
          format: varchar
          description: Default language of the policy
          example: en-us
        status:
          type: integer
          description: Indicates if the policy is currently Drafted, Published, or Archived.<br><br>
                      0 = Draft<br>
                      1 = Published<br>
                      2 = Archived
          example: 1
    Campaign:
      type: object
      properties:
        campaign_id:
          type: integer
          description: Campaign ID
          example: 4261
        name:
          type: string
          format: varchar
          description: Campaign name.
          example: Annual Training
        groups:
          type: array
          description: An array that displays the groups targeted by the campaign, including group name and id
          items:
            type: object
            properties:
              group_id:
                type: integer
                example: 0
              name:
                type: string
                format: varchar
                example: All Users
        status:
          type: string
          format: varchar
          description: Campaign status. (Created, Enrolling, In Progress, Completed, Cancelled)
          example: Completed
        content:
          type: array
          description: An array that displays both the Store Purchases and uploaded policies included in the campaign, as well as data about each item.
          items:
            type: object
            properties:
              store_purchase_id:
                type: integer
              content_type:
                type: string
                format: varchar
              name:
                type: string
                format: varchar
              description:
                type: string
                format: varchar
              type:
                type: string
                format: varchar
              duration:
                type: integer
              retired:
                type: boolean
              retirement_date:
                type: string
                format: datetime
              publish_date:
                type: string
                format: datetime
              publisher:
                type: string
                format: varchar
              purchase_date:
                type: string
                format: datetime
              policy_url:
                type: string
                format: varchar
            example:
              - store_purchase_id: 7
                content_type: Store Purchase
                name: 2019 Security Awareness Training
                description: A comprehensive overview of best practices...
                type: Training Module
                duration: 42
                retired: false
                retirement_date: null
                publish_date: "2019-04-02T15:02:38.000Z"
                publisher: KnowBe4
                purchase_date: "2019-04-02T15:02:38.000Z"
                policy_url: https://www.yourcompany.com/employees/acceptableusepolicy.html
              - policy_id: 142
                content_type: Uploaded Policy
                name: Security Awareness Policy
                minimum_time: 3
                default_language: en-us
                published: true
        duration_type:
          type: string
          format: varchar
          description: Duration type> (Specific End Date, Relative End Date, No End Date)
          example: Specific End Date
        start_date:
          type: string
          format: datetime
          description: Start date/time.
          example: "2019-04-02T15:02:38.000Z"
        end_date:
          type: string
          format: varchar
          description: End date/time. (Null = No specific end date).
          example: "2019-04-02T15:02:38.000Z"
        relative_duration:
          type: string
          format: varchar
          description: If relative duration was selected, this field will indicate how long each enrolled user has to complete their training assignments. (Null = no relative duration)
        auto_enroll:
          type: boolean
          description: Indicates if the "Automatically enroll users that are added to the above groups in the future" function was selected for this campaign. (True = Yes)
          example: true
        allow_multiple_enrollments:
          type: boolean
          description: Indicates if the "Enable courses to be done multiple times" function was selected for this campaign. (True = Yes)
          example: false
        completion_percentage:
          type: integer
          description: Indicates the percentage of completed campaigns. A percentage of -1 indicates that the campaign is too large to calculate the completion percentage (only for 'Get all Training Campaigns' endpoint).
          example: 0
    Enrollment:
      type: object
      properties:
        enrollment_id:
          type: integer
          description: Enrollment ID
          example: 1425526
        content_type:
          type: string
          format: varchar
          description: Indicates if the enrollment includes a Store Purchase or Uploaded Policy.
          example: Uploaded Policy
        module_name:
          type: string
          format: varchar
          description: Name of Module of title of Uploaded Policy.
          example: Acceptable Use Policy
        user:
          type: object
          description: ID, email, first and lat name of enrolled user.
          properties:
            id:
              type: integer
              example: 796742
            first_name:
              type: string
              format: varchar
              example: Sarah
            last_name:
              type: string
              format: varchar
              example: Thomas
            email:
              type: string
              format: varchar
              example: s_thomas@kb4-demo.com
            employee_number:
              type: string
              format: varchar
              example: 123456
        campaign_name:
          type: string
          format: varchar
          description: Campaign name.
          example: New Employee Policies
        enrollment_date:
          type: string
          format: datetime
          description: Enrollment date.
          example: "2019-04-02T15:02:38.000Z"
        start_date:
          type: string
          format: datetime
          description: Assignment start date.
          example: "2019-04-02T15:02:38.000Z"
        completion_date:
          type: string
          format: datetime
          description: Assignment completion date.
          example: "2019-04-02T15:02:38.000Z"
        status:
          type: string
          format: varchar
          description: Completion status. (Not Started, In Progress, Completed, Passed, Past Due)
          example: Passed
        time_spent:
          type: integer
          description: Indicates the time spent on the assignment, in seconds.
          example: 2340
        policy_acknowledged:
          type: boolean
          description: Indicates if the course-attached URL policy was acknowledged (if applicable).
          example: false
