Skip to content

Upload Project Files.

Request

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"
Security
bearerAuth
Query
projectIdinteger, (int64)required

ID of the Project

Example:projectId=1
deleteExistingFileOnServerboolean

Delete existing files on server. By deleting exiting files on the server, all existing project codebase files will be permanently removed from the scan server. If you rescan the project without replacing these files via a new upload, the scan results for the removed files will be permanently deleted.

Default:false
expansionLevelinteger, (int64)

Codebase expansion level for the project. 1: None | 2: First level | 3: Recursive level . If the expansionLevel parameter is not provided, the codebase will get extracted as 'None' by default.

deleteArchiveAfterExpandboolean

Delete inner archives after expansion

Default:false
archiveDirSuffixstring

Suffix to be added to the expanded folder. Value cannot be more than 20 characters and cannot contain the following special characters \ / : * ? " < > | \0 (Example: _Expanded)

Bodyapplication/octet-streamrequired

Zipped codebase to scan

booleanread-only
curl -i -X POST \
  'https://codeinsightapi.redocly.app/_mock/swagger/project/uploadProjectCodebase?projectId=1&deleteExistingFileOnServer=false&expansionLevel=0&deleteArchiveAfterExpand=false&archiveDirSuffix=string' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/octet-stream' \
  -d true

Responses

OK