CodeSandbox templates API

Sandbox template management

Operations 1

POST /templates Create a template #

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/codesandbox-templates-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

codesandbox-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: CodeSandbox meta Templates API
  version: '2023-07-01'
  description: The CodeSandbox API provides programmatic access to create, manage, and control sandboxes and virtual machines (devboxes) backed by Firecracker microVMs. Authenticated via Bearer token obtained from codesandbox.io/t/api.
  contact:
    url: https://codesandbox.io/docs/sdk
  x-source: https://raw.githubusercontent.com/codesandbox/codesandbox-sdk/main/openapi.json
servers:
- url: https://api.codesandbox.io
security: []
tags:
- name: templates
  description: Sandbox template management
paths:
  /templates:
    post:
      operationId: templates/create
      summary: Create a template
      description: 'Create a new template in the current workspace (creates 3 sandboxes and tags them)

        '
      tags:
      - templates
      parameters: []
      requestBody:
        description: Template Create Request
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateCreateRequest'
      responses:
        '201':
          description: Template Create Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateCreateResponse'
      security:
      - authorization:
        - template:create
components:
  schemas:
    Response:
      title: Response
      type: object
      properties:
        success:
          type: boolean
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    TemplateCreateResponse:
      title: TemplateCreateResponse
      type: object
      allOf:
      - $ref: '#/components/schemas/Response'
      - type: object
        properties:
          data:
            type: object
            required:
            - tag
            - sandboxes
            properties:
              tag:
                type: string
              sandboxes:
                type: array
                items:
                  type: object
                  required:
                  - id
                  - cluster
                  properties:
                    id:
                      type: string
                    cluster:
                      type: string
    TemplateCreateRequest:
      title: TemplateCreateRequest
      type: object
      required:
      - forkOf
      properties:
        forkOf:
          type: string
          example: pt_1234567890
          description: Short ID of the sandbox to fork.
        title:
          type: string
          maxLength: 255
          description: Template title. Maximum 255 characters.
        description:
          type: string
          maxLength: 255
          description: Template description. Maximum 255 characters.
        tags:
          type: array
          items:
            type: string
          default: []
          description: Tags to set on the new sandbox.
    Error:
      title: Error
      oneOf:
      - type: string
      - type: object
        additionalProperties: true
  securitySchemes:
    authorization:
      type: http
      scheme: bearer