# Create upload URL
This endpoint creates a temporary upload URL. A temporary upload URL can be used to:
- upload a 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.
- upload a file with the details of a batch operation. After the upload URL has been generated, you need to send a PUT request to that URL to upload the file to temporary storage.
NOTE
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.
Method | Path | Operation* |
---|---|---|
POST | /cache | create_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.
# Request
No parameters.
# Response
Attribute | Type | Description |
---|---|---|
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 a Doc to a Twin and to store the Doc 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:
- A temporary upload URL (
"https://example_url.com/e544230b-cf65"
) held in the"url"
attribute. The upload URL is used to upload the Doc to temporary storage. - A URL handler (
"a7fbcd7c-50a7-4df5-a6e5-416559ae24ae"
) held in the"handler"
attribute. The handler is used in the attach_twin_doc endpoint to attach a Doc to a Twin. - A 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.
Was this article helpful?