Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change Site Theme
Sanity logo

Documentation

    • Overview
    • Platform introduction
    • Next.js quickstart
    • Nuxt.js quickstart
    • Astro quickstart
    • React Router quickstart
    • Studio quickstart
    • Build with AI
    • Content Lake
    • Functions
    • APIs and SDKs
    • Visual Editing
    • Blueprints
    • Platform management
    • Dashboard
    • Studio
    • Canvas
    • Media Library
    • App SDK
    • Content Agent
    • HTTP API
    • CLI
    • Libraries
    • Specifications
    • Changelog
    • User guides
    • Developer guides
    • Courses and certifications
    • Join the community
    • Templates
CLI reference
Overview

  • Configuration
  • Commands

    Backup CLI command reference
    Blueprints
    Build
    Codemod
    CORS
    Dataset
    Debug
    Deploy
    Dev
    Docs
    Documents
    Exec
    Functions
    GraphQL
    Help
    Hook
    Init
    Install
    Login
    Logout
    Manage
    Manifest
    Media
    Migration
    Preview
    Projects
    Schema
    Start
    Telemetry
    TypeGen
    Undeploy
    Users
    Versions
    Tokens

On this page

Previous

Codemod

Next

Dataset

Was this page helpful?

On this page

  • Commands
  • Add
  • Delete
  • List
CLI referenceLast updated January 9, 2026

CORS

Interact with CORS-entries for your project

usage: sanity cors [-v|--version] [-d|--debug] [-h|--help] <command> [<args>]

Commands:
   add     Allow a new origin to use your project API through CORS
   delete  Delete an existing CORS-origin from your project
   list    List all origins allowed to access the API for this project

See 'sanity help cors <command>' for specific information on a subcommand.

Commands

Add

usage: sanity cors add [ORIGIN]

   Allow a new origin to use your project API through CORS

Options
  --credentials Allow credentials (token/cookie) to be sent from this origin
  --no-credentials Disallow credentials (token/cookie) to be sent from this origin

Examples
  sanity cors add
  sanity cors add http://localhost:3000 --no-credentials

Delete

usage: sanity cors delete [ORIGIN]

   Delete an existing CORS-origin from your project

Examples
  sanity cors delete
  sanity cors delete http://localhost:3000

List

usage: sanity cors list

   List all origins allowed to access the API for this project

Examples
  sanity cors list
usage: sanity cors add [ORIGIN]

   Allow a new origin to use your project API through CORS

Options
  --credentials Allow credentials (token/cookie) to be sent from this origin
  --no-credentials Disallow credentials (token/cookie) to be sent from this origin

Examples
  sanity cors add
  sanity cors add http://localhost:3000 --no-credentials
usage: sanity cors list

   List all origins allowed to access the API for this project

Examples
  sanity cors list