POST/image/sources/{image_source_id}

Update image source settings

Updates settings on an existing image source without creating a source or purging cached images. Select the source with image_source_id and provide the settings to change, such as origin configuration, cache durations, or whether the source is active. The response contains the updated source details.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 23 body fields
image_source_idstringrequired

The identifier of the existing image source whose settings you want to update.

Image source settings to update. Include the configuration fields required for any source type you provide.

awsobjectoptional

This is a required field if source type is aws.

azureobjectoptional

This is a required field if source type is azure.

backblazeobjectoptional

This is a required field if source type is backblaze.

browser_cache_timeintegeroptional

Browser cache time in seconds. For example setting this to 3600 caches the image in browser for 3600 seconds (1 hour)

cdn_cache_timeintegeroptional

CDN cache time in seconds.

cloudflareobjectoptional

This is a required field if source type is cloudflare.

cloudinaryobjectoptional

This is a required field if source type is cloudinary.

cnamearray<string>optional

List of verified CNAMEs

default_paramsobjectoptional

Default image transformation parameters.

dostorageobjectoptional

This is a required field if source type is dostorage.

error_imagestringoptional

URL for error image to display when we get broken image from your origin.

fallback_originsarray<object>optional

List of fallback origins

gcsobjectoptional

This is a required field if source type is gcs.

is_activebooleanoptional

Enable / disable source.

linodeobjectoptional

This is a required field if source type is linode.

proxyobjectoptional

This is a required field if source type is proxy.

request_headersarray<object>optional
response_headersarray<object>optional
secure_urlsbooleanoptional

Whether the URL signing is enabled

temp_cnamearray<string>optional
typestringoptional
Allowed:proxydirect-uploadwebfolderawsgcsdostoragewasabicloudinaryazurelinodebackblazecloudflare
wasabiobjectoptional

This is a required field if source type is wasabi.

webfolderobjectoptional

This is a required field if source type is webfolder.

5 status codes
200Returns the updated image source object, including its identifier, type, origin configuration, cache settings, and source details.
awsobjectoptional

This is a required field if source type is aws.

azureobjectoptional

This is a required field if source type is azure.

backblazeobjectoptional

This is a required field if source type is backblaze.

browser_cache_timeintegeroptional

Browser cache time in seconds

canonical_urlbooleanoptional
cdn_cache_timeintegeroptional

CDN cache time in seconds

cloudflareobjectoptional

This is a required field if source type is cloudflare.

cloudinaryobjectoptional

This is a required field if source type is cloudinary.

created_atstringoptional
default_paramsobjectoptional
dostorageobjectoptional

This is a required field if source type is dostorage.

fallback_originsarray<object>optional
gcsobjectoptional

This is a required field if source type is gcs.

idstringoptional

Image source ID

imgixobjectoptional
is_activebooleanoptional
is_cloudfrontbooleanoptional
linodeobjectoptional

This is a required field if source type is linode.

namespacestringoptional

Source namespace

proxyobjectoptional

This is a required field if source type is proxy.

request_headersarray<object>optional
response_headersarray<object>optional
secure_tokenstringoptional
secure_urlsbooleanoptional
subdomainstringoptional
temp_cnamearray<string>optional
typestringrequired
Allowed:dostorageawswasabihetznerbackblazewebfoldergcsazurecloudflareimgixcloudinaryproxy
updated_atstringoptional
wasabiobjectoptional

This is a required field if source type is wasabi.

webfolderobjectoptional

This is a required field if source type is webfolder.

400Returned when the request is malformed.

One documented failure

  • parameter_missing

    One or more required values are missing.

errorobjectrequired
401Returned when the API key or bearer token is missing or invalid.

One documented failure

  • invalid_api_key

    API key supplied with request is invalid

errorobjectrequired
403Returned when the account is unpaid or the authenticated user lacks the required role permissions.

One documented failure

  • unauthorized

    You don't have access to this feature. Please contact your organization owner.

errorobjectrequired
404Returned when the image source is not found.

One documented failure

  • source_not_found

    Could not find any image source with the specified source_id.

errorobjectrequired

Error handling

A 400 is returned for a bad request, a 401 when the API key or bearer token is missing or invalid, a 403 when the account is unpaid or lacks the required role permissions, and a 404 when the source is not found. If you provide a source configuration object, include the fields required for its source type; for example, AWS settings require bucket_name, bucket_region, access_key, and secret. The image_source_id path parameter must identify the source to update.