Initialize a multipart upload

/upload/multipart

This call initializes a multipart file upload.

https://cgc-api.sbgenomics.com/v2/upload/multipart

Request

Example request

POST /v2/upload/multipart HTTP/1.1
Host: cgc-api.sbgenomics.com
Content-Type: application/json
X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74

{
  "project": "RFranklin/my-project",
  "name": "CanFam3.1.dna_rm.toplevel.fa.gz",
  "part_size": 5242880,
  "size": 433759572
}
curl --data '{"project": "RFranklin/my-project", "name": "CanFam3.1.dna_rm.toplevel.fa.gz", "part_size": 5242880, "size": 433759572}' -s -H "X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74" -H "content-type: application/json" -X POST "https://cgc-api.sbgenomics.com/v2/upload/multipart"

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your CGC authentication token.
Content-Type
required
application/json

Query parameters

NameDatatypeDescription
overwriteBoolean: true or falseIf overwrite is set to true and a file already exists under the name specified in the request, the existing file will be deleted and a new one created in its place.

Request body

In the body, you should enter a list of key-value pairs. The keys, and the values they take, are described in the following table.

KeyDatatype of valueDescription of value
project
Required
StringThe name of the project you want to upload a file to.
parentStringThe ID of the folder to which the item is being uploaded.

Should not be used together with project. If parent is used, the upload will take place into the specified folder, within the project to which the folder belongs. If project is used, the items will be imported to the root of the project's files.
name
Required
StringThe name of the file you are about to upload. This must be unique in the project, unless you are also enabling the overwrite query parameter.

Allowed characters in file names are all alphanumerics and special characters except slash (/). File names can’t be longer than 255 characters.
sizeIntegerThe size of the file that will be uploaded. This can be used to track progress of an ongoing upload, but is otherwise optional.
part_sizeIntegerThe preferred size for upload parts. If omitted or set to a value that is incompatible with the cloud storage provider (AWS), a default value will be used.
md5String32-byte hexadecimal MD5 checksum of the file. This value is currently only stored but is not used by the CGC.

Response

See a list of CGC-specific response codes that may be contained in the body of the response.

Example response body

{
  "project": "RFranklin/my-project",
  "name": "CanFam3.1.dna_rm.toplevel.fa.gz",
  "size": 433759572,
  "upload_id": "oSZ5e6jMQa34UykB4FiPdhkCalLVrcQjkjKPkAT69skWgOPlOvcvGaqEJ7SI1o4w",
  "part_size": 5242880,
  "parallel_uploads": true
}
Language