Generate a signed S3 upload URL

Creates a temporary signed URL that can be used to upload a file directly to the configured S3 bucket.

POST
/v1/uploads/sign-url
contentTypestring

MIME type of the file to upload.

Length1 <= length <= 256
websiteIdstring
scope|||

Defines how uploaded files should be grouped inside the S3 bucket.

path?string

Optional relative path used to group uploads inside the bucket. Nested paths are supported.

Lengthlength <= 512
fileName?string

Optional file name to use for the object. Invalid characters will be sanitized on the server side.

Match^[^\\/]+$
Length1 <= length <= 128
fileExtension?string

Optional file extension without the leading dot. Use this when providing a custom file name without an extension.

Match^[a-zA-Z0-9]+$
Length1 <= length <= 16
useCdn?boolean

Set to true to place the file under the /cdn prefix so it is cached by the CDN.

expiresInSeconds?integer

Number of seconds before the signed URL expires. Defaults to 900 seconds (15 minutes).

Range60 <= value <= 3600

Response Body

application/json

application/json

curl -X POST "https://api.cossistant.com/v1/v1/uploads/sign-url" \  -H "Content-Type: application/json" \  -d '{    "contentType": "image/png",    "websiteId": "string",    "scope": {      "organizationId": "org_01HZYFG9W5V6YB5R6T6V7N9M2Q",      "websiteId": "site_01HZYFH3KJ3MYHJJ3JJ6Y2RNAV",      "type": "conversation",      "conversationId": "conv_01HZYFJ5P7DQ0VE8F68G5VYBAQ"    }  }'
{
  "uploadUrl": "https://example-bucket.s3.amazonaws.com/org-id/file.png?X-Amz-Signature=...",
  "key": "01JG000000000000000000000/assets/file.png",
  "bucket": "cossistant-uploads",
  "expiresAt": "2024-01-01T12:00:00.000Z",
  "contentType": "image/png",
  "publicUrl": "https://cdn.example.com/org-id/file.png"
}
{
  "error": "string"
}