POST
/
streaming
/
uploads
/
v1

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
project_id
string
required

The ID of the project to create the upload session for. It must be a valid project ID. The final destination of the file will be determined by the project's region.

region
enum<string>
required

The region to create the upload session for. It's recommended to use the region closest to the who will be reading the file. The final destination of the file will be determined by the project's region and will be stored in the region specified here.

Available options:
REGION_UNSPECIFIED,
REGION_AF,
REGION_AS,
REGION_EU,
REGION_NA,
REGION_OC,
REGION_SA
object_name
string
required

The name of the object to create the upload session for. It's recommended to use the name of the file being uploaded.

content_type
string
required

The content type of the file being uploaded. For example, "image/png".

ttl
string
required

The duration of the upload session. The upload session will expire after this duration. It's recommended to keep this duration as short as possible and no longer than 24 hours. It's useful when the session signed URL is shared with the client.

size_bytes
string
required

The size of the file being uploaded. It's useful when the session signed URL is shared with the client, so the client won't be able to upload a file larger than the size specified here.

access_control_mode
enum<string>
required

The access control mode of the file being uploaded. It's useful when the session signed URL is shared with the client, so the client won't be able to download the file after it's uploaded.

Available options:
ACCESS_CONTROL_MODE_UNSPECIFIED,
ACCESS_CONTROL_MODE_PUBLICREAD,
ACCESS_CONTROL_MODE_SIGNEDREAD
resumable
boolean

Whether the upload session is resumable. If set to true, the client can resume the upload session if it's interrupted. It's useful when the client is uploading a large file and the upload session is interrupted.

Response

200 - application/json
upload_session
object

Provides information about the upload session.

signed_url
string

The signed URL to upload the file to.

The client should use this URL to upload the file via PUT request. Content-Type header should be set to the value specified when creating the upload session. The being uploaded Content-Length should be equal or less than the size specified when creating the upload session.

The client should use Blob or Binary payload type for the request body and only send the file content. For example, formData is not supported because it will add additional metadata to the request body and increase the size of the request body which will cause the upload to fail because the size of the body will be larger than the size specified when creating the upload session.

Chunked uploads are supported for large files.