/portalAPI/ApplicationFile/*

6 min. readlast update: 09.23.2025

This article will encompass all portalAPI calls that are related to /portalAPI/ApplicationFile/* endpoints

 

Be sure to input the instance your organization exists on for each call. This is indicated with the "INSTANCE" text in each endpoint. Linked here is a KB to find your instance:

Locating Your Organization's Instance | ThreatLocker Help Center

 

ApplicationFileDeleteById

https://portalapi.INSTANCE.threatlocker.com/portalapi/ApplicationFile/ApplicationFileDeleteById

  • Method: POST
  • Description: This API is used when navigating to the Application Control page of the ThreatLocker Portal, locating and selecting the application you would like to remove an application file entry from, navigating to the "Application Files" tab, selecting the trash can icon, and selecting "Yes" to confirm the deletion of the application rule. This API is responsible for deleting the application file rule from your custom application in your organization. Multiple file rules cannot be deleted in one call to this API; One file rule is deleted for each call to this API. To delete a file rule from an application in a different organization than the currently logged in/managed organization, use the managedOrganizationId header as described below.

 

For accurate System Audit logging of the removal of the application file rule, please review the Optional Body/Parameters section below.

 

  • Required Body/Parameters
    • Valid APIKey/Authorization Token in header
    • Fields
      • applicationFileId: This field determines which file rule will be removed from the selected application.
        • Expects: An Integer value
      • applicationId: This field determines which application will have the file rule removed.
        • Expects: <GUID> in format "00000000-0000-0000-0000-000000000000"
    • Required body
{
    "applicationFileId": <Integer>,
    "applicationId": "00000000-0000-0000-0000-000000000000"
}
  • Optional Body/Parameters
    • In header: "managedOrganizationId": <GUID> in format "00000000-0000-0000-0000-000000000000"
    • Fields
      • applicationName: This field determines the name that will be logged in the System Audit. This field should match the name of the application from which the file rule is being removed.
        • Expects: Text of the application's name
      • For the application rule itself, the rule's conditions should also be entered.  For instance, when deleting a file path, certificate, and created by process path rule, the full text of each condition (file path, certificate, and created by process path) should be entered with their respective fields. Only the file rule fields directly related to the rule being deleted need to be included. The following application file rule fields can be used and are all shown in the Optional body section below:
        • fullPath
        • processPath
        • installedBy (Created By Process)
        • cert
        • hash (TL and SHA256)
    • Optional body
{
    "applicationFileId": <Integer>,
    "applicationId": "00000000-0000-0000-0000-000000000000",
    "applicationName": "<String>",
    "cert": "<String>",
    "fullPath": "<String>",
    "hash": "<String>",
    "installedBy": "<String>",
    "processPath": "<String>"
}
  • Permissions Needed for User
    • Edit Application Control Applications

 

ApplicationFileInsert

https://portalapi.INSTANCE.threatlocker.com/portalapi/ApplicationFile/ApplicationFileInsert

  • Method: POST
  • Description: This API is used when navigating to the Application Control page of the ThreatLocker Portal, locating and selecting the application you would like to add an application file entry to, navigating to the "Application Files" tab, entering your file rule conditions, and selecting "Add Rule". This API is responsible for inserting the new application file rule into your custom application in your organization. Multiple file rules cannot be created in one call to this API; One file rule is created for each call to this API based on what is entered into the body. Listed below in the Required body section are all the fields (file rule options) available for use with this API; However, they are limited per the terms listed below.
  • Required Body/Parameters
    • Valid APIKey/Authorization Token in header

Note: The hash field below is used when creating a ThreatLocker hash-only rule or a SHA256 hash-only rule and should not be used in combination with any other file rule fields. When creating a file rule that specifies a type of file path (fullPathprocessPathinstalledBy), use \\ for the existing slashes (\) in the path you enter. Wildcards can be used when using the fullPathprocessPath, and installedBy fields. When using the cert field, use \" for any existing quotation marks (") in the certificate path you enter. The processPath or installedBy fields cannot be used alone without specifying at least one additional application file rule field. For more information on creating custom rules, see the KB article below:

Creating Custom Rules | ThreatLocker Help Center

    • The following application file rule fields can be used:
      • fullPath
      • processPath
      • installedBy (Created By Process)
      • cert
      • hash (TL and SHA256)
    • Fields
      • applicationId: This field determines which application will have the new file rule added.
        • Expects: <GUID> in format "00000000-0000-0000-0000-000000000000"
      • isHashOnly: This field is used when creating a hash only rule. When creating a hash only rule, this field must be set to true. Otherwise, this field can be set to false or omitted completely.
        • Expects: true or false
      • notes: This field is designed to provide information on when the definition was added, what rule was added, who added/edited it, and any further details explaining it. While nothing can be entered into this field using a pair of quotation marks (""), it is recommended to include the above information to assist you and your users in identifying the context of why the application file rule may have been added.
        • Expects: Any text input
      • osType: The same OS Type as the application that will have the file rule added is expected. This field expects the Integer associated with the OSType:
        • Windows = 1
        • MAC = 2
        • Linux = 3
        • Windows XP = 5
    • Required body
{
    "applicationId": "00000000-0000-0000-0000-000000000000",
    "cert": "<String>",
    "fullPath": "<String>",
    "hash": "<String>",
    "installedBy": "<String>",
    "notes": "<String>",
    "osType": <Integer>,
    "processPath": "<String>"
}
  • Optional Body/Parameters
    • N/A
  • Permissions Needed for User
    • Edit Application Control Applications
Was this article helpful?