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

# Upload CTS Excel file

> Base model view set providing standardized CRUD operations and error handling.

This view set enforces consistent response formats, error handling patterns,
and logging across all API endpoints. Subclasses must override the class
variables below.



## OpenAPI

````yaml /openapi/commercial.yaml post /api/v1/cts/upload
openapi: 3.0.3
info:
  title: Commercial Service API
  version: 1.0.0
  description: |2-

        **Commercial Service API** - Lead management and campaign workflow system.

        ## Versioning
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
servers:
  - url: https://api.capedigital.co.ke/commercial
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/cts/upload:
    post:
      tags:
        - CTS
      summary: Upload CTS Excel file
      description: >-
        Base model view set providing standardized CRUD operations and error
        handling.


        This view set enforces consistent response formats, error handling
        patterns,

        and logging across all API endpoints. Subclasses must override the class

        variables below.
      operationId: cts_upload
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CTSListRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CTSListRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CTSList'
              examples:
                CTSSchedule:
                  value:
                    id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    medium: TV
                    channel: TV47
                    date: '2024-02-05'
                    day_of_week: Monday
                    title: TV47 CTS 05-02-2024
                    uploaded_by:
                      id: uuid
                      name: John Doe
                    slot_count: 24
                    metadata: {}
                    created_at: '2024-02-05T06:00:00Z'
                    updated_at: '2024-02-05T06:00:00Z'
                  summary: CTS schedule
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    CTSListRequest:
      type: object
      properties:
        medium:
          enum:
            - TV
            - RADIO
            - DIGITAL
          type: string
          description: |-
            * `TV` - TV
            * `RADIO` - Radio
            * `DIGITAL` - Digital
          x-spec-enum-id: aa21c11e9618ab2e
        channel:
          type: string
          minLength: 1
          maxLength: 100
        date:
          type: string
          format: date
        day_of_week:
          type: string
          minLength: 1
          maxLength: 20
        title:
          type: string
          minLength: 1
          maxLength: 255
        metadata: {}
      required:
        - channel
        - date
        - day_of_week
        - medium
        - title
    CTSList:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        medium:
          enum:
            - TV
            - RADIO
            - DIGITAL
          type: string
          description: |-
            * `TV` - TV
            * `RADIO` - Radio
            * `DIGITAL` - Digital
          x-spec-enum-id: aa21c11e9618ab2e
        channel:
          type: string
          maxLength: 100
        date:
          type: string
          format: date
        day_of_week:
          type: string
          maxLength: 20
        title:
          type: string
          maxLength: 255
        uploaded_by:
          type: string
          readOnly: true
        slot_count:
          type: integer
          readOnly: true
        metadata: {}
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - channel
        - created_at
        - date
        - day_of_week
        - id
        - medium
        - slot_count
        - title
        - updated_at
        - uploaded_by
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````