Grist templates API

The templates API from Grist — 2 operation(s) for templates.

OpenAPI Specification

grist-templates-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: 'An API for manipulating Grist sites, workspaces, and documents.


    # Authentication

    <SecurityDefinitions />

    '
  version: 1.0.1
  title: Grist attachments templates API
servers:
- url: https://{gristhost}/api
  variables:
    subdomain:
      description: The team name, or `docs` for personal areas
      default: docs
security:
- ApiKey: []
tags:
- name: templates
paths:
  /templates:
    get:
      operationId: listTemplates
      tags:
      - templates
      summary: List available templates
      description: 'Get all available templates. Templates are organized by workspace within

        a template organization configured on the server.


        **Note:** Requires a template organization to be configured on the server.

        '
      responses:
        200:
          description: List of workspaces containing templates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkspaceWithDocsAndDomain'
  /templates/{templateId}:
    get:
      operationId: getTemplate
      tags:
      - templates
      summary: Get template details
      description: 'Get information about a specific template.


        **Note:** Requires a template organization to be configured on the server.

        '
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          type: string
        description: ID of the template
      responses:
        200:
          description: Template information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocWithWorkspace'
components:
  schemas:
    WorkspaceWithOrg:
      allOf:
      - $ref: '#/components/schemas/Workspace'
      - type: object
        required:
        - org
        properties:
          org:
            $ref: '#/components/schemas/Org'
    Access:
      type: string
      enum:
      - owners
      - editors
      - viewers
    Org:
      type: object
      required:
      - id
      - name
      - domain
      - owner
      - createdAt
      - updatedAt
      - access
      properties:
        id:
          type: integer
          format: int64
          example: 42
        name:
          type: string
          example: Grist Labs
        domain:
          type: string
          nullable: true
          example: gristlabs
        owner:
          type: object
          $ref: '#/components/schemas/User'
          nullable: true
        access:
          type: string
          $ref: '#/components/schemas/Access'
        createdAt:
          type: string
          example: '2019-09-13T15:42:35.000Z'
        updatedAt:
          type: string
          example: '2019-09-13T15:42:35.000Z'
    WorkspaceWithDocsAndDomain:
      allOf:
      - $ref: '#/components/schemas/WorkspaceWithDocs'
      - type: object
        properties:
          orgDomain:
            type: string
            example: gristlabs
    DocWithWorkspace:
      allOf:
      - $ref: '#/components/schemas/Doc'
      - type: object
        required:
        - workspace
        properties:
          workspace:
            $ref: '#/components/schemas/WorkspaceWithOrg'
    User:
      type: object
      required:
      - id
      - name
      - picture
      properties:
        id:
          type: integer
          format: int64
          example: 101
        name:
          type: string
          example: Helga Hufflepuff
        picture:
          type: string
          nullable: true
          example: null
    Doc:
      type: object
      required:
      - id
      - name
      - isPinned
      - urlId
      - access
      properties:
        id:
          type: string
          example: 145
        name:
          type: string
          example: Project Lollipop
        access:
          type: string
          $ref: '#/components/schemas/Access'
        isPinned:
          type: boolean
          example: true
        urlId:
          type: string
          nullable: true
          example: null
    Workspace:
      type: object
      required:
      - id
      - name
      - access
      properties:
        id:
          type: integer
          format: int64
          example: 97
        name:
          type: string
          example: Secret Plans
        access:
          type: string
          $ref: '#/components/schemas/Access'
    WorkspaceWithDocs:
      allOf:
      - $ref: '#/components/schemas/Workspace'
      - type: object
        required:
        - docs
        properties:
          docs:
            type: array
            items:
              $ref: '#/components/schemas/Doc'
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: 'Authorization: Bearer XXXXXXXXXXX'
      description: Access to the Grist API is controlled by an Authorization header, which should contain the word 'Bearer', followed by a space, followed by your API key.