Sanity.upload_asset

You're seeing just the function upload_asset, go back to Sanity module for more information.
Link to this function

upload_asset(body, opts \\ [], query_params \\ [])

View Source

Specs

upload_asset(iodata(), keyword() | map(), keyword() | map()) ::
  Sanity.Request.t()

Generates a request for the asset endpoint.

Options

  • :asset_type - Either :image or :file. The default value is :image.

  • :content_type - Optional content-type header. It appears that Sanity is able to infer image types.

Query params

Sanity doesn't document the query params very well at this time, but the Sanity Javascript client lists several possible query params:

  • label - Label
  • title - Title
  • description - Description
  • filename - Original filename
  • meta - ???
  • creditLine - The credit to person(s) and/or organization(s) required by the supplier of the image to be used when published