POST/image/sources

Create an image source

Creates an image source that connects image delivery to a configured origin or proxy. Provide namespace and type, then include the configuration object required for that source type. The response includes the new source identifier and its image delivery settings.

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

13 body fields

Image source configuration. Provide namespace and type, along with the configuration object required for the selected source type.

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.

cloudflareobjectoptional

This is a required field if source type is cloudflare.

cloudinaryobjectoptional

This is a required field if source type is cloudinary.

dostorageobjectoptional

This is a required field if source type is dostorage.

gcsobjectoptional

This is a required field if source type is gcs.

linodeobjectoptional

This is a required field if source type is linode.

namespacestringrequired

unique subdomain associated with the image source

proxyobjectoptional

This is a required field if source type is proxy.

typestringrequired

Image source type: proxy, webfolder, aws, gcs, dostorage, wasabi, cloudinary, azure, linode, backblaze, cloudflare, or zoom.

Allowed:proxywebfolderawsgcsdostoragewasabicloudinaryazurelinodebackblazecloudflarezoom
wasabiobjectoptional

This is a required field if source type is wasabi.

webfolderobjectoptional

Web folder settings, including the base_url for the folder.

5 status codes
200Returns the created image source, including its ID, namespace, type, active status, cache settings, and timestamps.
browser_cache_timeintegeroptional

Browser cache time in seconds

canonical_urlbooleanoptional
cdn_cache_timeintegeroptional

CDN cache time in seconds

created_atstringoptional

Source created timestamp in ISO 8601

default_paramsobjectoptional
idstringoptional

Image source ID

is_activebooleanoptional

Boolean flag indicating if source is active

is_cloudfrontbooleanoptional
namespacestringoptional

Souce namespace

subdomainstringoptional
typestringoptional

Source type

updated_atstringoptional

Source updated timestamp in ISO 8601

webfolderobjectoptional
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 feature is not included in the account plan.

One documented failure

  • unauthorised_feature_access

    Your plan doesn't have this feature or you have reached the plan limit. Please upgrade your current plan to access this feature.

errorobjectrequired
422Returned when request validation fails, such as when required source settings are missing.

One documented failure

  • invalid_parameter

    body must have required property '<field>'

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 feature is not included in the plan, and a 422 when request validation fails. namespace and type are required, and type must be one of the supported values. Include the configuration object for the selected type and its required fields, such as bucket_name, access_key, and secret for AWS.