> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fermion.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new playground snippet 

> Create a new snippet to use as sandbox

Authentication with the "FERMION-API-KEY" header is required to use this endpoint.

Rate limit: Maximum 60 requests in a window of 1m.



## OpenAPI

````yaml https://backend.codedamn.com/webhook/fermion-backend-openapi.yaml post /public/create-new-playground-snippet
openapi: 3.0.0
info:
  version: 1.0.0
  title: Fermion Backend API
  description: Documentation for interacting with the Fermion API
  contact:
    name: Fermion Support
    email: support@codedamn.com
servers:
  - url: https://backend.codedamn.com/api
    description: Fermion primary backend server
security: []
externalDocs:
  description: Fermion Docs
  url: https://docs.fermion.app
paths:
  /public/create-new-playground-snippet:
    post:
      tags:
        - Sandbox
      summary: 'Create a new playground snippet '
      description: >-
        Create a new snippet to use as sandbox


        Authentication with the "FERMION-API-KEY" header is required to use this
        endpoint.


        Rate limit: Maximum 60 requests in a window of 1m.
      requestBody:
        description: API Request Body
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          bootParams:
                            anyOf:
                              - type: object
                                properties:
                                  source:
                                    type: string
                                    enum:
                                      - git-repo
                                    description: >-
                                      Source type for creating playground
                                      snippet from a Git repository
                                  gitRepoUrl:
                                    type: string
                                    format: uri
                                    description: >-
                                      URL of the Git repository to clone for the
                                      playground snippet
                                  gitBranch:
                                    type: string
                                    description: >-
                                      Git branch to checkout from the repository
                                      (defaults to main/master)
                                required:
                                  - source
                                  - gitRepoUrl
                              - type: object
                                properties:
                                  source:
                                    type: string
                                    enum:
                                      - empty
                                    description: >-
                                      Source type for creating an empty
                                      playground snippet
                                  shouldBackupFilesystem:
                                    type: boolean
                                    description: >-
                                      Whether to backup the filesystem state for
                                      future sessions. If passed true, and you
                                      resume the playground with its snippetId,
                                      you will get the same files back
                                required:
                                  - source
                                  - shouldBackupFilesystem
                        required:
                          - bootParams
                    required:
                      - data
              required:
                - data
      responses:
        '200':
          description: API Response Body
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    output:
                      anyOf:
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - ok
                            data:
                              type: object
                              properties:
                                playgroundSnippetId:
                                  type: string
                                  description: >-
                                    Unique identifier for the created playground
                                    snippet. Use this to attach to the sandbox
                                    now and in future
                              required:
                                - playgroundSnippetId
                          required:
                            - status
                            - data
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - error
                            errorMessage:
                              type: string
                          required:
                            - status
                            - errorMessage
                  required:
                    - output
      security:
        - FERMION-API-KEY: []
components:
  securitySchemes:
    FERMION-API-KEY:
      name: FERMION-API-KEY
      type: apiKey
      in: header

````