Rapid7 Files API
Files are used primarily to manage content that can be required to successfully scan an App. For example, many supported methods of configuring authentication in a Scan Config require a payload and similarly Scan crawl configuration can be enhanced by supplying pre-populated crawl results. In order to create a File you will need to perform 2 steps:Use the Create File API to provide the File's metadata and generate an id (can be derived from the Location header as described in 'Creating resources').Use the Upload File Content API with the id returned from the previous step in order to add content to this File.Once a File is created and both steps outlined above have been successfully completed, then the File's contentAvailable property will be true, the File will be considered 'usable', and it can be referenced in specific locations of a Scan Config using its id. A File's type can only be one of 6 options: File Type File Extensions MACRO rec SWAGGER json yaml yml SELENIUM htm html side RECORDED_TRAFFIC trec xml txt har saz WSDL wsdl CERTIFICATE pfx GRAPHQL qlsgraphqls Heuristic analysis is performed when file contents are uploaded to ensure that the content-type is appropriate for the file type specified; this is done for security reasons, and under no circumstances is the content sent to an external entity. A note on security: a File can be locked, implying that it can only be modified by its owner (the original API client that created the metadata) and by extension only the File's owner is capable of uploading its content. If a File is unlocked any other client that has access to the File's App can make modifications, including overwriting its content.