> ## 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.

# List partners

> Partner ViewSet

This viewset provides CRUD operations for the Partner model.

Actions:
- list: List all partners
- retrieve: Retrieve a partner by ID
- create: Create a new partner
- update: Update a partner
- destroy: Delete a partner



## OpenAPI

````yaml /openapi/commercial.yaml get /api/v1/partners
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/partners:
    get:
      tags:
        - Partners
      summary: List partners
      description: |-
        Partner ViewSet

        This viewset provides CRUD operations for the Partner model.

        Actions:
        - list: List all partners
        - retrieve: Retrieve a partner by ID
        - create: Create a new partner
        - update: Update a partner
        - destroy: Delete a partner
      operationId: partners_list
      parameters:
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPartnerList'
              examples:
                PartnerResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                      - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                        name: XYZ Agency
                        partner_type:
                          id: uuid
                          name: Agency
                        industry:
                          id: uuid
                          name: Advertising
                        status: active
                        services:
                          - id: uuid
                            name: TV Advertising
                        contacts:
                          - id: uuid
                            name: Alice Wambui
                            email: alice@xyz.co.ke
                            phone: '+254711000000'
                            preferred_contact_method: email
                        created_at: '2024-01-10T08:00:00Z'
                        updated_at: '2024-01-10T08:00:00Z'
                  summary: Partner response
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    PaginatedPartnerList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Partner'
    Partner:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Partner company name
          maxLength: 200
        partner_type:
          type: string
          readOnly: true
        industry:
          type: string
          readOnly: true
        status:
          type: string
          description: Current partner status
          maxLength: 20
        metadata:
          description: Additional flexible metadata
        services:
          type: string
          readOnly: true
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/PartnerContact'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - contacts
        - created_at
        - id
        - industry
        - name
        - partner_type
        - services
        - updated_at
    PartnerContact:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Contact name
          maxLength: 100
        email:
          type: string
          format: email
          description: Contact email address
          maxLength: 150
        phone:
          type: string
          description: Primary phone number
          maxLength: 30
        preferred_contact_method:
          enum:
            - email
            - phone
          type: string
          x-spec-enum-id: 17f11a3a6a4008ba
          description: |-
            Preferred method of contact

            * `email` - Email
            * `phone` - Phone
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - email
        - id
        - name
        - preferred_contact_method
        - updated_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````