get:
  summary: List Collections
  description: Returns a list of the collections available in the project.
  operationId: getCollections
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Offset'

    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '../../openapi.yaml#/components/schemas/Collections'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
    '404':
      $ref: '../../openapi.yaml#/components/responses/NotFoundError'
  tags:
    - Collections

post:
  summary: Create a Collection
  description: Create a new collection in Directus.
  operationId: createCollection
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  requestBody:
    content:
      application/json:
        schema:
          type: object
          required: [collection, fields]
          properties:
            collection:
              type: string
              description: Unique name of the collection.
              example: my_collection
            fields:
              type: array
              description:
                The fields contained in this collection. See the fields reference for more information. Each individual
                field requires field, type, and interface to be provided.
              items:
                type: object
            icon:
              description: Name of a Google Material Design Icon that's assigned to this collection.
              type: string
              example: people
              nullable: true
            note:
              description: A note describing the collection.
              type: string
              example: null
              nullable: true
            display_template:
              description: Text representation of how items from this collection are shown across the system.
              type: string
              example: null
              nullable: true
            hidden:
              description: Whether or not the collection is hidden from the navigation in the admin app.
              type: boolean
              example: false
            singleton:
              description: Whether or not the collection is treated as a single object.
              type: boolean
              example: false
            translation:
              description:
                Key value pairs of how to show this collection's name in different languages in the admin app.
              type: string
              example: null
              nullable: true
            archive_field:
              description: What field holds the archive value.
              type: string
              example: null
              nullable: true
            archive_app_filter:
              description: What value to use for "archived" items.
              type: string
              example: null
              nullable: true
            archive_value:
              description: What value to use to "unarchive" items.
              type: string
              example: null
              nullable: true
            unarchive_value:
              description: Whether or not to show the "archived" filter.
              type: string
              example: null
              nullable: true
            sort_field:
              description: The sort field in the collection.
              type: string
              example: null
              nullable: true
  responses:
    '200':
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '../../openapi.yaml#/components/schemas/Collections'
      description: Successful request
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
    '404':
      $ref: '../../openapi.yaml#/components/responses/NotFoundError'
  tags:
    - Collections
