Plasmic Items API

Query and count items in a CMS model.

OpenAPI Specification

plasmic-items-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Plasmic CMS Items API
  description: 'Plasmic CMS is the headless content API for structured data managed

    inside Plasmic. Read and write rows in models defined in Studio. All

    requests are authenticated with the

    `x-plasmic-api-cms-tokens: CMS_ID:TOKEN` header. Use the public token

    for read operations and the secret token for write operations.

    '
  version: 1.0.0
  contact:
    name: API Evangelist
    email: kin@apievangelist.com
  license:
    name: Proprietary
servers:
- url: https://data.plasmic.app/api/v1
  description: Plasmic CMS production
security:
- cmsTokens: []
tags:
- name: Items
  description: Query and count items in a CMS model.
paths:
  /cms/databases/{CMS_ID}/tables/{CMS_MODEL_ID}/query:
    parameters:
    - $ref: '#/components/parameters/CMSID'
    - $ref: '#/components/parameters/CMSModelID'
    - name: q
      in: query
      required: false
      schema:
        type: string
      description: JSON filter object (typically supplied as JSON string).
    - name: q.limit
      in: query
      required: false
      schema:
        type: integer
        default: 100
    - name: q.offset
      in: query
      required: false
      schema:
        type: integer
        default: 0
    - name: draft
      in: query
      required: false
      schema:
        type: integer
        enum:
        - 1
      description: Pass `1` to include draft/unpublished rows (requires secret token).
    - name: locale
      in: query
      required: false
      schema:
        type: string
      description: Locale tag, for example `ar-JO`.
    get:
      tags:
      - Items
      summary: Query items
      responses:
        '200':
          description: Items collection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RowsResponse'
  /cms/databases/{CMS_ID}/tables/{CMS_MODEL_ID}/count:
    parameters:
    - $ref: '#/components/parameters/CMSID'
    - $ref: '#/components/parameters/CMSModelID'
    - name: q
      in: query
      required: false
      schema:
        type: string
    - name: locale
      in: query
      required: false
      schema:
        type: string
    get:
      tags:
      - Items
      summary: Count items
      responses:
        '200':
          description: Item count.
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
components:
  parameters:
    CMSID:
      name: CMS_ID
      in: path
      required: true
      schema:
        type: string
      description: Plasmic CMS database identifier.
    CMSModelID:
      name: CMS_MODEL_ID
      in: path
      required: true
      schema:
        type: string
      description: Plasmic CMS model (table) identifier.
  schemas:
    RowsResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/Row'
    Row:
      type: object
      properties:
        id:
          type: string
        identifier:
          type: string
        data:
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    cmsTokens:
      type: apiKey
      in: header
      name: x-plasmic-api-cms-tokens
      description: 'Plasmic CMS authentication header in the form `CMS_ID:TOKEN`. Use the

        public token for read operations and the secret token for write

        operations.

        '