Sanity Projects API

The Sanity Projects API enables programmatic management of Sanity projects including creating projects, managing datasets, configuring CORS origins, managing access tokens, and checking user permissions. Authentication uses Bearer tokens.

Operations 8

GET /projects List Projects #
POST /projects Create Project #
GET /projects/{projectId} Get Project #
PATCH /projects/{projectId} Update Project #
GET /projects/{projectId}/datasets List Datasets #
PUT /projects/{projectId}/datasets Create Dataset #
GET /projects/{projectId}/tokens List Tokens #
POST /projects/{projectId}/tokens Create Token #

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-projects-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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-projects-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sanity HTTP Projects 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: Projects
  description: Project and dataset management
paths:
  /projects:
    get:
      operationId: listProjects
      summary: List Projects
      description: List all Sanity projects accessible to the authenticated user, ordered by creation date.
      tags:
      - Projects
      responses:
        '200':
          description: List of projects
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Project'
    post:
      operationId: createProject
      summary: Create Project
      description: Create a new Sanity project.
      tags:
      - Projects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - displayName
              properties:
                displayName:
                  type: string
                  description: Human-readable project name
                organizationId:
                  type: string
                  description: Organization to associate project with
      responses:
        '200':
          description: Project created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /projects/{projectId}:
    get:
      operationId: getProject
      summary: Get Project
      description: Retrieve details for a specific Sanity project.
      tags:
      - Projects
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Project details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
    patch:
      operationId: updateProject
      summary: Update Project
      description: Update a Sanity project's settings.
      tags:
      - Projects
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                displayName:
                  type: string
                metadata:
                  type: object
      responses:
        '200':
          description: Project updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /projects/{projectId}/datasets:
    get:
      operationId: listDatasets
      summary: List Datasets
      description: List all datasets for a project.
      tags:
      - Projects
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of datasets
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Dataset'
    put:
      operationId: createDataset
      summary: Create Dataset
      description: Create a new dataset in a project.
      tags:
      - Projects
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - datasetName
              properties:
                datasetName:
                  type: string
                aclMode:
                  type: string
                  enum:
                  - public
                  - private
      responses:
        '200':
          description: Dataset created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dataset'
  /projects/{projectId}/tokens:
    get:
      operationId: listTokens
      summary: List Tokens
      description: List all API tokens for a project.
      tags:
      - Projects
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Token'
    post:
      operationId: createToken
      summary: Create Token
      description: Create a new API token for a project. The token key is only returned at creation time and cannot be retrieved again.
      tags:
      - Projects
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - label
              - roleName
              properties:
                label:
                  type: string
                roleName:
                  type: string
                  description: Role to assign to the token
      responses:
        '200':
          description: Token created with key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenWithKey'
components:
  schemas:
    Token:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        roleName:
          type: string
        createdAt:
          type: string
          format: date-time
    TokenWithKey:
      allOf:
      - $ref: '#/components/schemas/Token'
      - type: object
        properties:
          key:
            type: string
            description: The API token key (only returned at creation)
    Project:
      type: object
      properties:
        id:
          type: string
          description: Unique project ID
        displayName:
          type: string
        organizationId:
          type: string
        isBlocked:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Dataset:
      type: object
      properties:
        name:
          type: string
        aclMode:
          type: string
          enum:
          - public
          - private
        tags:
          type: array
          items:
            type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sanity project API token