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

# Create template (v3)

> Create a new template



## OpenAPI

````yaml /openapi-public.yml post /v3/templates
openapi: 3.1.0
info:
  title: E2B API
  version: 0.1.0
  description: >-
    Complete E2B developer API. Platform endpoints are served on api.e2b.app.
    Sandbox endpoints (envd) are served on the shared sandbox host
    (sandbox.e2b.app); target a specific sandbox with the E2b-Sandbox-Id and
    E2b-Sandbox-Port headers.
servers:
  - url: https://api.e2b.app
    description: E2B Platform API
security: []
tags:
  - name: Sandboxes
  - name: Templates
  - name: Tags
  - name: Volumes
  - name: Envd
  - name: Filesystem
  - name: Process
  - name: Teams
paths:
  /v3/templates:
    servers:
      - url: https://api.e2b.app
        description: E2B Platform API
    post:
      tags:
        - Templates
      summary: Create template (v3)
      description: Create a new template
      operationId: postTemplatesV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildRequestV3'
      responses:
        '202':
          description: The build was requested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateRequestResponseV3'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TemplateBuildRequestV3:
      properties:
        name:
          description: >-
            Name of the template. Can include a tag with colon separator (e.g.
            "my-template" or "my-template:v1"). If tag is included, it will be
            treated as if the tag was provided in the tags array.
          type: string
        tags:
          type: array
          description: Tags to assign to the template build
          items:
            type: string
        alias:
          description: Alias of the template. Deprecated, use name instead.
          type: string
          deprecated: true
        teamID:
          deprecated: true
          type: string
          description: Identifier of the team
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
      type: object
    TemplateRequestResponseV3:
      required:
        - templateID
        - buildID
        - public
        - aliases
        - names
        - tags
      properties:
        templateID:
          type: string
          description: Identifier of the template
        buildID:
          type: string
          description: Identifier of the last successful build for given template
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
        names:
          type: array
          description: Names of the template
          items:
            type: string
        tags:
          type: array
          description: Tags assigned to the template build
          items:
            type: string
        aliases:
          type: array
          description: Aliases of the template
          deprecated: true
          items:
            type: string
      type: object
    CPUCount:
      type: integer
      format: int32
      minimum: 1
      description: CPU cores for the sandbox
    MemoryMB:
      type: integer
      format: int32
      minimum: 128
      description: Memory for the sandbox in MiB
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error
      type: object
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````