Team Onboarding Scan Upload
Upload a Team Onboarding scan result
This endpoint allows users to upload scan results generated by the SARA script for a project.
POST /api/v2/team-onboarding/scan/upload/
Payload
Fields | Required | Description |
---|---|---|
file | Yes | The JSON file containing the scan results |
project_id | Yes | The ID of the project to which the scan results belong |
Notes:
- This endpoint will lock the related project when the scan is created, only users with edit survey permission on the related project can create a scan.
- The file must be a JSON file.
- The file size must not exceed 5 MB.
- The
project_id
must correspond to an existing project that the user has permission to edit.
POST /api/v2/team-onboarding/scan/upload/ HTTP/1.1
Accept: application/json
Content-Type: multipart/form-data
Authorization: Token "YOUR SDE ACCESS TOKEN"
------Boundary
Content-Disposition: form-data; name="file"; filename="scan_results.json"
Content-Type: application/json
<content of scan_results.json>
------Boundary
Content-Disposition: form-data; name="project_id"
1
------Boundary--
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"id": 1,
"status": "REPO_DELETE_SUCCESS",
"message": null,
"user": 1
}
Error Responses
- 400 Bad Request: Invalid file format.
{ "file": ["File must be a JSON file."] }
400 Bad Request: File size exceeds limit.
{ "file": ["File must be within 5242880 bytes."] }
422 Unprocessable Entity: The project is locked.
"Cannot upload scan data to a locked project"
- 403 Forbidden: The user does not have permission to edit the survey.
{ "User does not have permission to edit the survey" }
- 404 Not Found: The specified project does not exist.
"Project matching query does not exist."