CodeSandbox token API

API token management

Operations 2

POST /org/workspace/{team_id}/tokens Create an API Token #
PATCH /org/workspace/{team_id}/tokens/{token_id} Update an API 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/codesandbox-token-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-token-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: CodeSandbox meta Token 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: token
  description: API token management
paths:
  /org/workspace/{team_id}/tokens:
    post:
      operationId: token/create
      summary: Create an API Token
      description: 'Create a new API token for a workspace that is part of the current organization.

        '
      tags:
      - token
      parameters:
      - name: team_id
        in: path
        required: true
        description: ID of the workspace to create the token in
        example: ws_123abcdef
        schema:
          type: string
      requestBody:
        description: Token Create Request
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenCreateRequest'
      responses:
        '201':
          description: Token Create Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenCreateResponse'
      security:
      - authorization:
        - token:manage
  /org/workspace/{team_id}/tokens/{token_id}:
    patch:
      operationId: token/update
      summary: Update an API Token
      description: 'Update an API token for a workspace that is part of the current organization.

        '
      tags:
      - token
      parameters:
      - name: team_id
        in: path
        required: true
        description: ID of the workspace the token belongs to
        example: ws_123abcdef
        schema:
          type: string
      - name: token_id
        in: path
        required: true
        description: ID of token to update
        example: tok_123abcdef
        schema:
          type: string
      requestBody:
        description: Token Update Request
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenUpdateRequest'
      responses:
        '201':
          description: Token Update Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenUpdateResponse'
      security:
      - authorization:
        - token:manage
components:
  schemas:
    Response:
      title: Response
      type: object
      properties:
        success:
          type: boolean
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    TokenUpdateResponse:
      title: TokenUpdateResponse
      type: object
      allOf:
      - $ref: '#/components/schemas/Response'
      - type: object
        properties:
          data:
            type: object
            required:
            - description
            - scopes
            - team_id
            - token_id
            properties:
              token_id:
                type: string
              team_id:
                type: string
              description:
                type:
                - string
                - 'null'
              scopes:
                type: array
                items:
                  type: string
              expires_at:
                type:
                - string
                - 'null'
                format: date-time
    TokenCreateRequest:
      title: TokenCreateRequest
      type: object
      properties:
        description:
          type: string
          maxLength: 255
          description: Description of this token.
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
          description: UTC Timestamp until when this token is valid.
        scopes:
          type: array
          items:
            enum:
            - sandbox_create
            - sandbox_edit_code
            - sandbox_read
            - vm_manage
          description: Which scopes to grant this token.
        default_version:
          type:
          - string
          - 'null'
          format: date
          description: API Version to use, formatted as YYYY-MM-DD.
    TokenCreateResponse:
      title: TokenCreateResponse
      type: object
      allOf:
      - $ref: '#/components/schemas/Response'
      - type: object
        properties:
          data:
            type: object
            required:
            - description
            - expires_at
            - scopes
            - team_id
            - token
            - token_id
            properties:
              token_id:
                type: string
              team_id:
                type: string
              token:
                type: string
              description:
                type:
                - string
                - 'null'
              scopes:
                type: array
                items:
                  type: string
              expires_at:
                type:
                - string
                - 'null'
    TokenUpdateRequest:
      title: TokenUpdateRequest
      description: Updateable fields for API Tokens.
      type: object
      properties:
        description:
          type:
          - string
          - 'null'
          maxLength: 255
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
        scopes:
          type: array
          items:
            enum:
            - sandbox_create
            - sandbox_edit_code
            - sandbox_read
            - vm_manage
        default_version:
          type:
          - string
          - 'null'
          format: date
    Error:
      title: Error
      oneOf:
      - type: string
      - type: object
        additionalProperties: true
  securitySchemes:
    authorization:
      type: http
      scheme: bearer