Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
assets
Create Asset
curl --request POST \
  --url https://api.example.com/v1/businesses/{businessId}/assets \
  --header 'Content-Type: application/json' \
  --data '
{
  "uri": "<string>",
  "id": "<string>",
  "metadata": {
    "metadata.accessControlType": "<string>"
  }
}
'
{
  "asset": {
    "asset.id": "<string>",
    "asset.ownerId": "<string>",
    "asset.uri": "<string>",
    "asset.source.uri": "<string>",
    "asset.metadata.accessControlType": "<string>"
  }
}
Upload a media file to Connectly’s CDN by providing a publicly accessible source URL. Connectly fetches the file from your URL and stores it, returning a stable CDN URL you can reference in templates, campaigns, and messages.

Endpoint

POST https://api.connectly.ai/v1/businesses/{businessId}/assets
Rate limit: 100 requests/second. Exceeding this returns 429 Too Many Requests.

Request body

uri
string
required
Publicly accessible source URL of the file to upload. Must be reachable from Connectly’s servers — private or authenticated URLs will fail with a 400 error.
id
string
Optional custom identifier for the asset. If omitted, Connectly generates a UUID automatically. Useful for associating assets with your own records (e.g. a product SKU or internal asset key).
metadata
object
Optional metadata to attach to the asset.

Response

asset
object

Examples

curl -X POST "https://api.connectly.ai/v1/businesses/{businessId}/assets" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "uri": "https://example.com/images/product-photo.png" }'
{
  "asset": {
    "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "ownerId": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "https://cdn.connectly.ai/assets/6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "source": { "uri": "https://example.com/images/product-photo.png" },
    "metadata": { "accessControlType": "ASSET_ACCESS_CONTROL_TYPE_PUBLIC" }
  }
}
curl -X POST "https://api.connectly.ai/v1/businesses/{businessId}/assets" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "uri": "https://example.com/images/product-photo.png",
    "id": "product-sku-12345-main-image"
  }'
curl -X POST "https://api.connectly.ai/v1/businesses/{businessId}/assets" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "uri": "https://example.com/documents/invoice.pdf",
    "metadata": { "accessControlType": "ASSET_ACCESS_CONTROL_TYPE_CDN_PRIVATE" }
  }'

Error responses

StatusMeaning
400Missing or invalid uri, or source URL unreachable by Connectly’s servers.
401Missing or invalid X-API-Key.
429Rate limit exceeded (100 req/s).