younifyd
Menu

Upload File Asset

Upload a file asset

POST/files/{dataset}

Use it in a workflow

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

Request

Path parameters

datasetstringrequired

Query parameters

filenamestring

Filename for this file (optional)

titlestring

Optional title for the asset

descriptionstring

Optional description for the asset

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`.

Response

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

documentobject
json
{
  "document": {}
}

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

Upload File Asset — Sanity — Documentation