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

# List Provider Import Sources

> List audiences, lists, segments, and tags available to import from a connected Klaviyo, Mailchimp, or HubSpot account. Requires API key with audience:read and brand access. Pass `connectionId` when more than one account is connected for the provider.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/contacts/imports/providers/{provider}/sources
openapi: 3.1.0
info:
  title: Migma.ai API (v1)
  description: >-
    API for managing brands, contacts, email generation, sending, and
    integrations. API request budgets are plan-based and shared across an
    account's API keys per route group. Sending request allowances support the
    account's recipients/second rate; recipient throughput and daily/monthly
    email quotas remain separate. See
    https://docs.migma.ai/api-reference/introduction#rate-limiting for limits,
    response headers, and retry behavior.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.migma.ai
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Projects/Brands
    description: Manage projects (brands) and import from websites
  - name: Contacts
    description: Manage your contacts, segments, tags, and topics
  - name: Segments
    description: Create and manage dynamic contact segments
  - name: Tags
    description: Organize contacts with tags
  - name: Topics
    description: Manage subscription topics and preferences
  - name: Emails
    description: Generate, send, and export emails
  - name: Email Validation
    description: Validate email content for compatibility and deliverability
  - name: Email Previews
    description: Preview emails across devices and email clients
  - name: Domains
    description: Manage sending domains and verification
  - name: Webhooks
    description: Manage webhook endpoints for real-time event notifications
  - name: Events
    description: Record customer events and conversions
  - name: Integrations
    description: Third-party platform integrations
  - name: Campaigns
    description: Create, schedule, send, and manage email campaigns
  - name: Billing
    description: View your plan and credits and create billing links
  - name: Project Editing
    description: Edit project assets, logos, images, and knowledge base entries
paths:
  /v1/contacts/imports/providers/{provider}/sources:
    get:
      tags:
        - Contacts
      summary: List Provider Import Sources
      description: >-
        List audiences, lists, segments, and tags available to import from a
        connected Klaviyo, Mailchimp, or HubSpot account. Requires API key with
        audience:read and brand access. Pass `connectionId` when more than one
        account is connected for the provider.
      operationId: ListProviderImportSources
      parameters:
        - name: provider
          in: path
          required: true
          description: Integration provider
          schema:
            type: string
            enum:
              - klaviyo
              - mailchimp
              - hubspot
        - name: projectId
          in: query
          required: true
          description: Brand (project) ID
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
        - name: connectionId
          in: query
          required: false
          description: Connected integration account ID when multiple accounts are linked
          schema:
            type: string
      responses:
        '200':
          description: Importable sources for the provider
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseProviderImportSources'
        '400':
          description: >-
            Bad request (code: INTEGRATION_ACCOUNT_REQUIRED when multiple
            accounts are connected and connectionId is omitted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: >-
            Provider not connected or reconnect required (codes:
            PROVIDER_NOT_CONNECTED, PROVIDER_RECONNECT_REQUIRED). The error
            message includes a connect link; `data.connectUrl` has the same URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl
            'https://api.migma.ai/v1/contacts/imports/providers/klaviyo/sources?projectId=PROJECT_ID'
            \
              -H "Authorization: Bearer $MIGMA_API_KEY"
components:
  schemas:
    ApiResponseProviderImportSources:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              type: object
              required:
                - sources
              properties:
                sources:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProviderImportSource'
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: string
        code:
          type: string
          description: >-
            Machine-readable error code (e.g., IDEMPOTENCY_CONFLICT,
            DOMAIN_CLAIMABLE).
        data:
          type: object
          description: >-
            Additional structured context for the error, such as the affected
            domain.
          additionalProperties: true
      required:
        - success
        - error
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    ProviderImportSource:
      type: object
      required:
        - id
        - type
        - name
      properties:
        id:
          type: string
          description: Provider-specific source identifier
        type:
          type: string
          enum:
            - audience
            - segment
            - tag
            - list
        name:
          type: string
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden - Missing required permissions or access denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where
        YOUR_API_KEY is obtained from the Migma dashboard under Settings →
        Developers → API Keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.