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

# Bulk upload rows from CSV or Excel

> Upload a `.csv`, `.xlsx`, or `.xls` file to bulk create contact rows.
Auto-maps headers to columns, creates missing columns, and skips rows without a phone number.




## OpenAPI

````yaml /api-reference/campaigns-contacts.openapi.yaml post /api/v1/people-groups/{group_id}/upload
openapi: 3.1.0
info:
  title: Campaigns & Contacts API
  description: >
    REST endpoints for managing calling campaigns (batches) and contact
    directories (People Groups, columns, and rows).


    **Production base URL:** `https://api.kupe.in` — prepend this to each path
    below.


    ## Recommended workflow: Excel → People → Campaign → Launch


    1. `POST /api/v1/people-groups` — create a people list

    2. `POST /api/v1/people-groups/{id}/upload/preview` — (optional) validate
    Excel/CSV mapping

    3. `POST /api/v1/people-groups/{id}/upload` — import contacts from `.csv`,
    `.xlsx`, or `.xls`

    4. `POST /api/v1/campaigns` — create a campaign (agent/workflow + caller
    phone)

    5. `POST /api/v1/campaigns/{id}/groups` — attach the people list to the
    campaign

    6. `GET /api/v1/campaigns/{id}/readiness` — verify the campaign can be
    launched

    7. `POST /api/v1/campaigns/{id}/start` — start dialing
  version: 1.0.0
servers:
  - url: https://api.kupe.in
    description: Production
security:
  - KupeApiKey: []
  - BearerAuth: []
tags:
  - name: Campaigns
    description: Create, update, control, list, and monitor outbound campaigns (batches).
  - name: People Groups
    description: >-
      Define schemas (columns), list records (rows), and upload contact files
      (CSV, Excel).
paths:
  /api/v1/people-groups/{group_id}/upload:
    post:
      tags:
        - People Groups
      summary: Bulk upload rows from CSV or Excel
      description: >
        Upload a `.csv`, `.xlsx`, or `.xls` file to bulk create contact rows.

        Auto-maps headers to columns, creates missing columns, and skips rows
        without a phone number.
      operationId: uploadPeopleFile
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV, XLSX, or XLS file (max 10 MB).
      responses:
        '200':
          description: Bulk upload result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeopleUploadResultResponse'
components:
  schemas:
    PeopleUploadResultResponse:
      type: object
      properties:
        message:
          type: string
        inserted_count:
          type: integer
        skipped_count:
          type: integer
        columns_created:
          type: integer
        column_mapping:
          type: object
          additionalProperties:
            type: string
        warnings:
          type: array
          items:
            type: string
  securitySchemes:
    KupeApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Kupe dashboard API key.
      x-default: YOUR_KUPE_API_KEY
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Supabase session JWT.

````