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

# Create org template

> **Token scope:** `account` · `org` — read-only tokens refused (not a GET).

Create a blank community template draft, with no project behind it. Services are added with PATCH.



## OpenAPI

````yaml /openapi/org.json post /orgs/{orgId}/templates
openapi: 3.1.0
info:
  title: InstaCloud API — Organization level
  version: 0.1.0
  description: >-
    Endpoints under `/orgs/{orgId}`: members, projects, billing, domains.
    Callable with an account-wide token or a token bound to that organization.


    Generated from the platform's own OpenAPI document
    (https://api.instacloud.com/openapi.json); see the [API
    overview](/reference/api/overview) for authentication and token scopes.
servers:
  - url: https://api.instacloud.com
    description: InstaCloud
security:
  - bearerAuth: []
tags:
  - name: Organization
    description: 'The organization itself: name, members, invitations.'
  - name: Projects
    description: Projects inside an organization.
  - name: Audit
    description: The project's event timeline, including agent-ingested events.
  - name: Domains
    description: >-
      Domains bought through InstaCloud, bring-your-own zones and their DNS
      records.
  - name: Billing
    description: Usage, cycles, invoices and credits.
  - name: Templates
    description: Deploy a template into a project.
paths:
  /orgs/{orgId}/templates:
    post:
      tags:
        - Templates
      summary: Create org template
      description: >-
        **Token scope:** `account` · `org` — read-only tokens refused (not a
        GET).


        Create a blank community template draft, with no project behind it.
        Services are added with PATCH.
      operationId: createOrgTemplate
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: orgId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  description: >-
                    The draft's name, trimmed, 1 to 80 characters. The template
                    code is derived from it. Omitted: New template, with a
                    random suffix on its code.
                  type: string
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  template:
                    $ref: '#/components/schemas/CommunityTemplate'
                required:
                  - template
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The organization is billing-suspended, or the caller holds a
            project-scoped token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CommunityTemplate:
      type: object
      properties:
        id:
          format: uuid
          description: >-
            The draft's stable id. A rename of its code keeps it, and a new
            draft gets a new one, even under a code a deleted draft had. Routes
            and editor links address a draft by its code.
          type: string
        code:
          type: string
        orgId:
          format: uuid
          type: string
        sourceProjectId:
          format: uuid
          type:
            - string
            - 'null'
        blank:
          description: >-
            Created with POST /orgs/{orgId}/templates, with no project behind
            it: every service is one the author added, and Regenerate From
            Project answers 400. A generated draft whose project was deleted is
            not blank.
          type: boolean
        status:
          type: string
          enum:
            - draft
            - published
            - unpublished
        publishedVersion:
          type:
            - string
            - 'null'
        hasUnpublishedChanges:
          type: boolean
        name:
          type: string
        tagline:
          type:
            - string
            - 'null'
        category:
          type:
            - string
            - 'null'
        readme:
          type:
            - string
            - 'null'
        defaultReadme:
          description: >-
            A README skeleton built from the draft as it is now: service names
            and required variable names only, never a value. The console offers
            it behind a button; it is not stored.
          type: string
        logoUrl:
          type:
            - string
            - 'null'
        services:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                description: >-
                  web with a port, worker without one, or the managed type
                  (postgres, redis, mysql, mongodb or storage). It and the
                  fields below are the values after the author's settings.
                type: string
              image:
                type:
                  - string
                  - 'null'
              port:
                type:
                  - integer
                  - 'null'
              healthcheck:
                type:
                  - string
                  - 'null'
              volume:
                type: boolean
              mountPath:
                description: >-
                  null with volume true: the volume mounts at the default /data.
                  null with volume false: no volume.
                type:
                  - string
                  - 'null'
              command:
                type:
                  - string
                  - 'null'
              alwaysOn:
                type:
                  - boolean
                  - 'null'
              public:
                description: >-
                  Storage only, always present on a bucket: anonymous
                  public-read, after the author's setting.
                type: boolean
              pgVersion:
                description: >-
                  Postgres only: the major a deploy creates the database on,
                  after the author's setting. Absent when the project's database
                  recorded none.
                type: integer
              added:
                description: >-
                  Present, and true, only on a service the author added: a PATCH
                  deletes it for good. One from the project is removed instead.
                type: boolean
              removed:
                description: >-
                  The author left this service out of the template. It stays
                  listed so it can be restored.
                type: boolean
              variables:
                description: >-
                  Sorted by the generator's name (originalName when renamed).
                  Empty for a managed database. A removed service lists what
                  restoring it brings back.
                type: array
                items:
                  $ref: '#/components/schemas/TemplateVariableView'
            required:
              - name
              - type
              - image
              - port
              - healthcheck
              - volume
              - mountPath
              - command
              - alwaysOn
              - removed
              - variables
        referenceOptions:
          description: >-
            What a variable may reference in the template as it is now. A
            removed service offers nothing.
          type: array
          items:
            $ref: '#/components/schemas/TemplateReferenceOption'
        editableFields:
          $ref: '#/components/schemas/TemplateEditableFields'
        referenceKeys:
          $ref: '#/components/schemas/TemplateReferenceKeys'
        publishRequirements:
          description: >-
            Always seven, in this order: has_service, no_blocked, no_conflicts,
            has_tagline, has_category, has_readme, required_descriptions.
          type: array
          items:
            $ref: '#/components/schemas/TemplatePublishRequirement'
        report:
          $ref: '#/components/schemas/TemplateGenerationReport'
        updatedAt:
          type: string
        takenDown:
          description: Staff took this template down. It cannot be republished.
          type: boolean
        deployCount:
          description: Succeeded deployments of this template.
          type: integer
        totalProjects:
          description: >-
            Distinct projects that deployed this template since its first
            publish, any outcome: the number the gallery card shows (the
            catalog's totalProjects).
          type: integer
      required:
        - id
        - code
        - orgId
        - sourceProjectId
        - blank
        - status
        - publishedVersion
        - hasUnpublishedChanges
        - name
        - tagline
        - category
        - readme
        - defaultReadme
        - logoUrl
        - services
        - referenceOptions
        - editableFields
        - referenceKeys
        - publishRequirements
        - report
        - updatedAt
        - takenDown
        - deployCount
        - totalProjects
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    TemplateVariableView:
      description: One variable of a template service as its author sees it.
      type: object
      properties:
        name:
          type: string
        kind:
          type: string
          enum:
            - required
            - optional
            - default
            - reference
            - generated
            - fixed
            - removed
        value:
          description: >-
            default: the default text. reference: the token. fixed: the literal
            or the address reference.
          type: string
        description:
          description: >-
            What whoever deploys reads. Omitted while it is the default
            sentence, which the console shows as an empty box.
          type: string
        brokenReference:
          description: >-
            The token this variable referenced before its service was removed
            from the template or left the project. The variable is then
            required.
          type: string
        originalName:
          description: >-
            Present only when the author renamed the variable: the generator's
            name, which a PATCH variables entry sends as name. name is then the
            new one.
          type: string
        added:
          description: >-
            Present, and true, only on a variable the author added: a PATCH
            deletes it for good. One from the project is removed with choice
            removed instead.
          type: boolean
      required:
        - name
        - kind
    TemplateReferenceOption:
      description: >-
        What a variable may reference: a database connection key, a bucket key,
        or a web service address including the service itself.
      type: object
      properties:
        token:
          description: Exactly what a reference choice sends and the manifest stores.
          type: string
        service:
          type: string
        key:
          description: >-
            A credential key of a managed database or a storage bucket, or url
            or host of a web service.
          type: string
      required:
        - token
        - service
        - key
    TemplateEditableFields:
      description: >-
        Per service type, the TemplateServiceSettings keys a template service of
        that type takes. A PATCH answers 400 for any other.
      type: object
      properties:
        web:
          type: array
          items:
            type: string
            enum:
              - image
              - port
              - healthcheck
              - command
              - mountPath
              - alwaysOn
        worker:
          type: array
          items:
            type: string
            enum:
              - image
              - port
              - healthcheck
              - command
              - mountPath
              - alwaysOn
        postgres:
          type: array
          items:
            type: string
            enum:
              - pgVersion
        redis:
          maxItems: 0
          type: array
          items:
            type: string
        mysql:
          maxItems: 0
          type: array
          items:
            type: string
        mongodb:
          maxItems: 0
          type: array
          items:
            type: string
        storage:
          type: array
          items:
            type: string
            enum:
              - public
      required:
        - web
        - worker
        - postgres
        - redis
        - mysql
        - mongodb
        - storage
    TemplateReferenceKeys:
      description: >-
        Per managed service type, the credential keys a variable may reference
        on a service of that type, one the author has not applied yet included
        (secretNames.ts CANONICAL_KEYS). A web service's url and host are not
        listed.
      type: object
      properties:
        postgres:
          type: array
          items:
            type: string
        redis:
          type: array
          items:
            type: string
        mysql:
          type: array
          items:
            type: string
        mongodb:
          type: array
          items:
            type: string
        storage:
          type: array
          items:
            type: string
      required:
        - postgres
        - redis
        - mysql
        - mongodb
        - storage
    TemplatePublishRequirement:
      description: >-
        One condition publish checks. Publish answers 400 template_not_ready
        while any is not ok.
      type: object
      properties:
        code:
          type: string
          enum:
            - has_service
            - no_blocked
            - no_conflicts
            - has_tagline
            - has_category
            - has_readme
            - required_descriptions
        ok:
          type: boolean
        items:
          description: >-
            no_blocked: each blocked reason. no_conflicts: one sentence with its
            fix for each name the author added that the project now has too,
            services first. required_descriptions: each <service>.<VAR> still
            without a description. Otherwise empty.
          type: array
          items:
            type: string
      required:
        - code
        - ok
        - items
    TemplateGenerationReport:
      description: >-
        What generation skipped, what blocks publishing (each with a fix), and
        notices.
      type: object
      properties:
        skipped:
          type: array
          items:
            type: object
            properties:
              service:
                type: string
              variable:
                type: string
              reason:
                type: string
              fix:
                type: string
            required:
              - reason
        blocked:
          type: array
          items:
            type: object
            properties:
              service:
                type: string
              variable:
                type: string
              reason:
                type: string
              fix:
                type: string
            required:
              - reason
        notices:
          type: array
          items:
            type: object
            properties:
              service:
                type: string
              variable:
                type: string
              reason:
                type: string
              fix:
                type: string
            required:
              - reason
      required:
        - skipped
        - blocked
        - notices
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````