CreateUploadUrl - Amazon CodeGuru Security


Generates a pre-signed URL and request headers used to upload a code resource.

You can upload your code resource to the URL and add the request headers using any HTTP client.

Request Syntax

POST /uploadUrl HTTP/1.1 Content-type: application/json { "scanName": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.


The name of the scan that will use the uploaded resource. CodeGuru Security uses the unique scan name to track revisions across multiple scans of the same resource. Use this scanName when you call CreateScan on the code resource you upload to this URL.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 140.

Pattern: ^[a-zA-Z0-9-_$:.]*$

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "codeArtifactId": "string", "requestHeaders": { "string" : "string" }, "s3Url": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The identifier for the uploaded code resource.

Type: String

Pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$


A set of key-value pairs that contain the required headers when uploading your resource.

Type: String to string map

Key Length Constraints: Minimum length of 1.

Value Length Constraints: Minimum length of 1.


A pre-signed S3 URL. You can upload the code file you want to scan and add the required requestHeaders using any HTTP client.

Type: String

Length Constraints: Minimum length of 1.


For information about the errors that are common to all actions, see Common Errors.


You do not have sufficient access to perform this action.

HTTP Status Code: 403


The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500


The request was denied due to request throttling.

HTTP Status Code: 429


The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: