Sanity Assets API

The Sanity Assets API handles uploading, retrieving, and managing file and image assets in Content Lake. Assets are stored as documents and referenced from content documents.

GitHub OpenAPI

Operations 1

POST /assets/images/{dataset} Upload Image Asset #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sanity:sanity-assets-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sanity-assets-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sanity HTTP Assets API
  description: The Sanity HTTP API provides access to the Sanity Content Lake platform, enabling querying, mutating, and managing structured content. The API supports GROQ queries, real-time event streaming, asset management, project management, webhooks, scheduling, and AI-powered content agents. Authentication uses Bearer tokens generated from Sanity project settings.
  version: v2024-01-01
  contact:
    name: Sanity Support
    url: https://www.sanity.io/docs
  license:
    name: Commercial
    url: https://www.sanity.io/legal/terms
servers:
- url: https://{projectId}.api.sanity.io/v{apiVersion}
  description: Sanity project-scoped API endpoint
  variables:
    projectId:
      description: Your Sanity project ID
      default: your-project-id
    apiVersion:
      description: API version date (YYYY-MM-DD)
      default: '2024-01-01'
- url: https://api.sanity.io/v{apiVersion}
  description: Sanity management API endpoint
  variables:
    apiVersion:
      description: API version date
      default: '2024-01-01'
security:
- BearerAuth: []
tags:
- name: Assets
  description: File and image asset management
paths:
  /assets/images/{dataset}:
    post:
      operationId: uploadImageAsset
      summary: Upload Image Asset
      description: Upload an image asset to the Sanity Content Lake. Supports common image formats (JPEG, PNG, WebP, GIF, SVG).
      tags:
      - Assets
      parameters:
      - name: dataset
        in: path
        required: true
        schema:
          type: string
      - name: filename
        in: query
        schema:
          type: string
        description: Original filename for the asset
      - name: label
        in: query
        schema:
          type: string
        description: Human-readable label for the asset
      requestBody:
        required: true
        content:
          image/*:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Asset uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetDocument'
components:
  schemas:
    AssetDocument:
      type: object
      properties:
        document:
          type: object
          properties:
            _id:
              type: string
            _type:
              type: string
              enum:
              - sanity.imageAsset
              - sanity.fileAsset
            url:
              type: string
            path:
              type: string
            mimeType:
              type: string
            size:
              type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sanity project API token