# Project API ## Generate Report (deprecated) - [GET /project/generateReport](https://codeinsightapi.redocly.app/swagger/deprecated-apis/generatereport.md): This API is deprecated please refer to /projects/{projectId}/reports/{reportId}/generate to Generate a report. Refer /projects/{projectId}/reports/{reportId}/download to Download a report. Generates Reports (PROJECT, AUDIT, NOTICES, CUSTOM_REPORT) for a given projectId. For CUSTOM_REPORT provide the name of the report. All project users including Observer, Reviewer and Analyst can generate reports for private projects. Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL. When calling this API from a REST client, you need to redirect output to a zip file as follows curl -X GET "http://HOST:PORT/codeinsight/api/project/generateReport?reportType=REPORT_TYPE&projectId=PROJECT_ID" -H "accept: application/octet-stream" -H "Authorization: Bearer JWT_TOKEN" > report.zip ## Create Project (deprecated) - [POST /project/createProject](https://codeinsightapi.redocly.app/swagger/deprecated-apis/createproject.md): Use the enhanced '/projects' api. ## Get Project Inventories Delta from latest scan - [GET /project/inventoryDeltaFromLastScan/{projectId}](https://codeinsightapi.redocly.app/swagger/project-api/getmodifiedprojectinventorybyproject.md): Returns a Delta list of inventory after latest scan and relevant details for a given project. All project users including Observer, Reviewer and Analyst can view project inventory of private/public projects. ## Get Project Id - [GET /project/id](https://codeinsightapi.redocly.app/swagger/project-api/getprojectid.md): Returns projectId for a given projectName. ## Get Project Inventory - [GET /project/inventory/{projectId}](https://codeinsightapi.redocly.app/swagger/project-api/getprojectinventory.md): Returns a list of inventory and inventory details for a given project; includes a flag for a short/long version. All project users including Observer, Reviewer and Analyst can view project inventory of private projects. ## Get Project Inventory by Date - [GET /project/inventoryLite/{projectId}](https://codeinsightapi.redocly.app/swagger/project-api/getprojectinventorybydate.md): Returns a list of inventory and relevant details for a given project within the given date and time. All project users including Observer, Reviewer and Analyst can view project inventory of private/public projects. ## Get Scan Status - [GET /project/scanStatus/{taskId}](https://codeinsightapi.redocly.app/swagger/project-api/getprojectscanstatus.md): Returns a scan status for a given taskId which is obtained from /projectScan/{projectId} ## Upload Project Files. - [POST /project/uploadProjectCodebase](https://codeinsightapi.redocly.app/swagger/project-api/uploadproject.md): Uploads and extracts a codebase zip file for a project. (* Maximum supported file size is 10GB.). Upload only files with extensions zip,tar,tar.gz and 7z. Do not upload any .gz files directly without archiving it in a tar file. The upload result may come wrong if any compressed files uploaded directly without archiving it. Only Project Admin and Analyst can upload project codebase to a project. Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL. When calling this API from a REST client, you need to run curl as follows curl -X POST "http://HOST:PORT/codeinsight/api/project/uploadProjectCodebase?projectId=PROJECT_ID&deleteExistingFileOnServer=true&expansionLevel=1" -H "accept: application/json" -H "Authorization: Bearer JWT_TOKEN" -H "content-type: application/octet-stream" --data-binary "@path/filename.zip" ## Export Project Data - [GET /project/exportProjectData](https://codeinsightapi.redocly.app/swagger/project-api/exportprojectdata.md): Exports project data for a given projectId. Only Project Admin and Analyst can Export Project Data from a project. Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL. When calling this API from a REST client, you need to redirect output to a zip file as follows curl -X GET "http://HOST:PORT/codeinsight/api/project/exportProjectData?projectId=PROJECT_ID" -H "accept: application/octet-stream" -H "Authorization: Bearer JWT_TOKEN" > export.zip ## Download Report - [GET /projects/{projectId}/reports/{reportId}/download](https://codeinsightapi.redocly.app/swagger/project-api/downloadreport.md): Download Reports (PROJECT, AUDIT, NOTICES, CUSTOM_REPORT) for a given projectId. For ALL Reports we need to provide the id of the report. All project users including Observer, Reviewer and Analyst can download reports for private projects. If a task is in progress the response will be 202 and the status will be provided in the header for e.g(ACTIVE, SCHEDULED). Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL. When calling this API from a REST client, you need to redirect output to a zip file as follows curl -X GET "http://HOST:PORT/codeinsight/api/projects/{projectId}/reports/{reportId}/download?taskId={taskId}" -H "accept: application/octet-stream" -H "Authorization: Bearer JWT_TOKEN" > report.zip ## Generate Report - [POST /projects/{projectId}/reports/{reportId}/generate](https://codeinsightapi.redocly.app/swagger/project-api/generatereport_1.md): Generates Reports (PROJECT, AUDIT, NOTICES, CUSTOM_REPORT) for a given projectId. For ALL Reports we need to provide the id of the report. All project users including Observer, Reviewer and Analyst can generate reports for private projects. ## Add child projects to parent project - [POST /projects/{projectId}/children](https://codeinsightapi.redocly.app/swagger/project-api/addchildprojects.md): Add child projects to parent project. ## Remove child Projects from parent project - [DELETE /projects/{projectId}/children](https://codeinsightapi.redocly.app/swagger/project-api/removechildprojects.md): Remove child project from parent project ## Users - [GET /projects/{projectId}/users](https://codeinsightapi.redocly.app/swagger/project-api/getprojectuserrole.md): Get Project Users with respect to Role ## Assign Role - [POST /projects/{projectId}/users](https://codeinsightapi.redocly.app/swagger/project-api/assignprojectrole.md): Assign a Users to a specific Project Role.Here "ownerId refers to the "contactId of the project. ## Unassign Project Role - [DELETE /projects/{projectId}/users](https://codeinsightapi.redocly.app/swagger/project-api/unassignprojectroles.md): Remove User(s) from a specific Project Role ## Get Projects - [GET /projects](https://codeinsightapi.redocly.app/swagger/project-api/getprojects.md): Get All The Projects ## Create Project - [POST /projects](https://codeinsightapi.redocly.app/swagger/project-api/createproject_1.md): Creates a project for the given input, updates project custom field values and returns projectId with success message. ## Get Project Information - [GET /projects/{projectId}](https://codeinsightapi.redocly.app/swagger/project-api/getprojectbyid.md): Get Project Information By Id ## Update Project - [PUT /projects/{projectId}](https://codeinsightapi.redocly.app/swagger/project-api/updateproject.md): Updates a project, custom field values for the given projectId.Here "owner" field refers to the "contact" of the project. ## Delete a project, deletion operation will be added to queue. To get status of project deletion use jobs/{jobId} API - [DELETE /projects/{projectId}](https://codeinsightapi.redocly.app/swagger/project-api/deleteproject.md): Deleting a project will delete all project inventory, custom field values, corresponding notes and all code base files permanently from the server. ## get all child projects - [GET /projects/{projectId}/childProjects](https://codeinsightapi.redocly.app/swagger/project-api/getallchildprojects.md): Get all child projects. parentProject property will not be shown in the response. ## get all parent projects - [GET /projects/{projectId}/parentProjects](https://codeinsightapi.redocly.app/swagger/project-api/getallparentprojects.md): Get all parent projects. childProject property will not be shown in the response. ## Fetch all scanned files for a project - [GET /projects/{projectId}/allscannedfiles](https://codeinsightapi.redocly.app/swagger/project-api/getallscannedfiles.md) ## Fetch Evidences for a project - [GET /projects/{projectId}/evidences](https://codeinsightapi.redocly.app/swagger/project-api/getevidences.md) ## Get Id of file or folder - [GET /projects/{projectId}/files](https://codeinsightapi.redocly.app/swagger/project-api/getfileorfolderid.md): Returns the ID of file and/or folder ## Get Project Contact - [GET /projects/{projectId}/contact](https://codeinsightapi.redocly.app/swagger/project-api/getprojectcontact.md): Get project contact for the given projectId. ## Update Project Contact - [PUT /projects/{projectId}/contact](https://codeinsightapi.redocly.app/swagger/project-api/updateprojectcontact.md): Updates project contact for the given projectId. ## Get project inventories for the given scan-agent or scan-server alias - [GET /projects/{projectId}/inventories/{alias}](https://codeinsightapi.redocly.app/swagger/project-api/getprojectinventoriesbyalias.md): Returns all inventories of the project associated with the given scan-agent or scan-server alias ## Get Inventory Summary of the project - [GET /projects/{projectId}/inventorySummary](https://codeinsightapi.redocly.app/swagger/project-api/getprojectinventorysummary.md): Get Project level inventory summary ## Fetch all scan nodes (alias) of a project - [GET /projects/{projectId}/scanNodes](https://codeinsightapi.redocly.app/swagger/project-api/getscannodes.md): Returns all the alias node information of a project ## project status - [PUT /projects/{projectId}/status](https://codeinsightapi.redocly.app/swagger/project-api/updateprojectstatus.md): Updates the status of a project. By default, a newly created project has the status "Not Started". After scanning begins, the status is automatically updated to "Analysis In Progress". Note: ProjectAction can be specified with below values: - Update Status Only: Only updates the status of the project, if project status is kept COMPLETED, it will lock the current project. - Lock Child Projects: Locks all child projects of the current project. (allowed only if project status is kept COMPLETED) - Unlock Child Projects: Unlocks all child projects of the current project. (allowed only if project status is not COMPLETED) Use projectAction to control the locking behavior in relation to the project's current status. ## Upload Report. - [POST /projects/uploadReport](https://codeinsightapi.redocly.app/swagger/project-api/uploadreport.md): Uploads and extracts a report zip file for a project.curl -H "Authorization: Bearer %jwt%" --form projectId=%projectId% --form reportId=%reportId% --form file=@"pdf_reports.zip" http://localhost:8888/codeinsight/api/projects/uploadReport ## Import Project Data - [POST /projects/{projectId}/import](https://codeinsightapi.redocly.app/swagger/project-api/importprojectdata_1.md): Imports project data for a given projectId. Only Project Owner and Analyst can Import Project Data into a private project. Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL When calling this API from a REST client, you need to run either of the curl commands. Save the required attributes in a json or a text file for project import and provide that file in the command. If you are using text file, don't give .txt extension. curl -H "Authorization:Bearer %jwt%" -F importFile=@"fileToImport.zip" -F projectImportModel=@"JsonFile.json Or textFile;type=application/json" http://localhost:8888/codeinsight/api/projects/%projectId%/import Or else, instead of providing file, you can directly define the attributes for projectImportModel inside curly braces. Provide 'FileMatchingCriteria' either of the below values: COMPLETE_FILEPATH|PARTIAL_FILEPATH|FILENAME|MD5|MD5_AND_FILENAME|MD5_AND_COMPLETE_FILEPATH|MD5_AND_PARTIAL_FILEPATH ## Import Sbom - [POST /projects/{projectId}/importSbom](https://codeinsightapi.redocly.app/swagger/project-api/importsbom.md): Imports Sbom for a given projectId. Only Project Owner and Analyst can Import Project Sbom into a private project. Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL. When calling this API from a REST client, you need to run either of the curl commands. curl -H "Authorization:Bearer %jwt%" -F sbomFile=@"fileToImport.json;type=application/json" http://localhost:8888/codeinsight/api/projects/%projectId%/importSbom ## Generate Report (deprecated) - [GET /project/generateReport](https://codeinsightapi.redocly.app/swagger/project-api/generatereport.md): This API is deprecated please refer to /projects/{projectId}/reports/{reportId}/generate to Generate a report. Refer /projects/{projectId}/reports/{reportId}/download to Download a report. Generates Reports (PROJECT, AUDIT, NOTICES, CUSTOM_REPORT) for a given projectId. For CUSTOM_REPORT provide the name of the report. All project users including Observer, Reviewer and Analyst can generate reports for private projects. Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL. When calling this API from a REST client, you need to redirect output to a zip file as follows curl -X GET "http://HOST:PORT/codeinsight/api/project/generateReport?reportType=REPORT_TYPE&projectId=PROJECT_ID" -H "accept: application/octet-stream" -H "Authorization: Bearer JWT_TOKEN" > report.zip ## Create Project (deprecated) - [POST /project/createProject](https://codeinsightapi.redocly.app/swagger/project-api/createproject.md): Use the enhanced '/projects' api.