younifyd
Menu

Upload Image Asset From Url

Upload an image asset from a URL

POST/images/{dataset}/from-url

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Upload Image Asset From Url action (under Assets).
  3. Fill in the fields below, then reference the result from later steps as {{uploadImageAssetFromUrl.response.data}}.

Request

Path parameters

datasetstringrequired

Query parameters

titlestring

Optional title for the asset

descriptionstring

Optional description for the asset

metaarray<string>

Image metadata to extract. Repeat the parameter for multiple values, such as meta=palette&meta=lqip.

Default ["palette","lqip","blurhash","thumbhash"]

labelstring

Optional freeform label for the asset.

tagstring

Optional request tag for the upload. Learn more in the [request tag documentation](https://www.sanity.io/docs/platform-management/reference-api-request-tags).

creditLinestring

The credit to people or organizations required by the supplier of the asset to be used when published.

sourceNamestring

The name of the source if the asset is from an external service. Requires `sourceId`.

sourceIdstring

The ID of the asset within the external source. Required when `sourceName` is set, and ignored without it.

sourceUrlstring

The URL of the asset within the external source. Ignored without `sourceName`.

Request body

Enter the body as JSON in the step's Body field.

urlstring (uri)required

Public or preauthorized HTTPS URL returning the asset bytes. URLs with embedded usernames or passwords are not supported.

filenamestring

Optional original filename, including the extension. Must not contain path separators or a null character.

json
{
  "url": "string",
  "filename": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{uploadImageAssetFromUrl.response.data.<field>}}.

documentobject
json
{
  "document": {}
}

Need more? See the Sanity guide for connection setup and behaviour shared by every action.