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

# Upload Contacts CSV

> Get a temporary upload URL to upload a contacts CSV for a campaign

Request an upload URL with `file_name`, the actual `file_size` in bytes, and `content_type: "text/csv"`. The CSV must be non-empty and at most 10 MB.

The response contains `upload_url`, `file_key`, and `expires_in`. PUT your file to `upload_url` with the same content type; do not send your workspace API key to the upload URL.

```bash theme={null}
curl --fail-with-body --request PUT "${UPLOAD_URL}" \
  -H 'Content-Type: text/csv' \
  --data-binary @contacts.csv
```

Set `UPLOAD_URL` to the returned URL and upload before it expires. After a successful upload, use `file_key` as `source_id` with `source_type: "csv"` when [creating the campaign](/api-reference/campaigns/create).

The file must include a `phone_number` column. Extra columns become initial context:

```csv theme={null}
phone_number,customer_name,plan
+14155550100,Jane Smith,premium
```


## OpenAPI

````yaml POST /api/v1/s3/presigned-upload-url
openapi: 3.1.0
info:
  title: Bandwidth Agent Builder API
  version: v1
  description: >-
    Manage agents, place calls, and retrieve conversation results in your
    workspace.
servers:
  - url: https://agents.labs.bandwidth.com
    description: Workspace API
security: []
paths:
  /api/v1/s3/presigned-upload-url:
    post:
      tags:
        - campaigns
      summary: Upload Contacts CSV
      description: Get a temporary upload URL to upload a contacts CSV for a campaign
      operationId: get_presigned_upload_url_api_v1_s3_presigned_upload_url_post
      parameters:
        - name: X-VOAI-ORGANIZATION-ID
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Voai-Organization-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresignedUploadUrlRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignedUploadUrlResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - LabsAuth: []
        - LabsApiKey: []
components:
  schemas:
    PresignedUploadUrlRequest:
      properties:
        file_name:
          type: string
          pattern: .*\.csv$
          title: File Name
        file_size:
          type: integer
          maximum: 10485760
          exclusiveMinimum: 0
          title: File Size
        content_type:
          type: string
          title: Content Type
          default: text/csv
      type: object
      required:
        - file_name
        - file_size
      title: PresignedUploadUrlRequest
    PresignedUploadUrlResponse:
      properties:
        upload_url:
          type: string
          title: Upload Url
        file_key:
          type: string
          title: File Key
        expires_in:
          type: integer
          title: Expires In
      type: object
      required:
        - upload_url
        - file_key
        - expires_in
      title: PresignedUploadUrlResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    LabsAuth:
      type: http
      scheme: bearer
    LabsApiKey:
      type: apiKey
      in: header
      name: X-BW-LABS-AGENTS-API-KEY

````