# Create an upload URL
This endpoint creates a temporary upload URL. You will use the upload URL to upload the Doc to temporary storage. After the upload URL has been generated, you need to send a PUT request to that URL to upload the Doc to temporary storage.
The upload URL is temporary and expires after 60 minutes. After the upload URL has expired, you will need to generate a new upload URL.
In order for a user to perform the "create_upload_url" operation, the "create_upload_url" permission must be included in the list of allowed actions in the statement of the user's role.
|url||string||Temporary upload URL used to upload the Doc to temporary storage through sending a PUT request to that URL.|
|handler||string||URL handler used in the attach_twin_doc endpoint to attach the Doc to a Twin and to store it in the Twin's directory.|
|validity_ts||timestamp||Time at which the upload URL expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch (opens new window). The upload URL expires 60 minutes after its creation.|
The response returns:
- The temporary upload URL
"https://example_url.com/e544230b-cf65"held in the
"url"attribute which you will use to upload the Doc to temporary storage.
- The URL handler
"a7fbcd7c-50a7-4df5-a6e5-416559ae24ae"held in the
"handler"attribute which you will use in the attach_twin_doc endpoint to attach the Doc to a Twin.
- The Unix timestamp (opens new window) stating when the upload URL expires held in the
"validity_ts"attribute. The upload URL expires 60 minutes after it has been generated.
# PUT request
In order to upload the Doc to temporary storage, you need to send a PUT request to the upload URL.
# Status codes
Requests to this endpoint result in generic status codes. For a comprehensive list of status codes, please consult the Status Codes section.