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

# Create CMS Item

> Insert a new item, or upsert when an `id` is supplied.

The `data` object is validated against the collection's schema before the
row is stored. Required fields must be present; unknown fields are dropped.

## Example

```bash theme={null}
curl -X POST https://api.kardow.com/cms/sponsors \
  -H "x-api-key: $KARDOW_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "data": {
      "name": "Globex",
      "logo": "https://cdn.example.com/globex.png",
      "url": "https://globex.com"
    },
    "status": "published"
  }'
```

Pass `expires_at` to make the item disappear from public lists after a
specific moment, or `starts_at` to schedule it.


## OpenAPI

````yaml POST /cms/{slug}
openapi: 3.1.0
info:
  title: Kardow Public API
  description: Public API for jobs and member automation on Kardow.
  version: 1.0.0
  contact:
    name: Kardow Support
    email: support@kardow.com
    url: https://kardow.com
servers:
  - url: https://api.kardow.com
    description: Production API
security:
  - ApiKeyAuth: []
paths:
  /cms/{slug}:
    post:
      tags:
        - CMS
      summary: Create CMS Item
      description: >-
        Inserts (or upserts when `id` is provided) an item in a CMS collection.
        The `data` object is validated against the collection's schema.
      operationId: createCmsItem
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CmsItemInput'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  item:
                    $ref: '#/components/schemas/CmsItem'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CmsItemInput:
      type: object
      required:
        - data
      properties:
        id:
          type: string
          format: uuid
          description: Provide to update an existing item.
        data:
          type: object
          additionalProperties: true
          description: Validated against the collection's schema.
        status:
          type: string
          enum:
            - draft
            - pending_review
            - published
            - expired
            - archived
          default: published
        starts_at:
          type: string
          format: date-time
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
        owner_user_id:
          type: string
          format: uuid
          nullable: true
    CmsItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        data:
          type: object
          additionalProperties: true
        status:
          type: string
        source:
          type: string
          enum:
            - manual
            - payment
            - api
            - import
        starts_at:
          type: string
          format: date-time
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
        position:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details: {}
            url:
              type: string
          required:
            - message
            - code
      required:
        - error
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFoundError:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours from Settings > API Keys in the
        Kardow dashboard.

````