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

# Import LinkedIn profiles into a draft

> Looks up 1 to 100 LinkedIn profile URLs in the background and adds them to a LinkedIn draft. Read the results with Get LinkedIn import results.

Permission: `campaigns:import`

[Read the recovery rules](https://docs.emailx.ai/en/api-reference/idempotency.md) before retrying a write. Keep the same key and body for the same logical operation.


## OpenAPI

````yaml openapi/emailx.en.json POST /workspaces/{workspace_id}/campaigns/linkedin/{campaign_id}/imports
openapi: 3.0.3
info:
  title: Emailx API
  version: 1.0.0-beta
  description: >-
    Customer and agency integrations for Emailx. Beta access is operator-issued.
    The v1 beta supports bounded People CSV/XLSX imports, saved email-template
    settings, selected email generation with explicit AI-credit confirmation,
    exact-message approval, reviewed email activation for native scheduled
    sending, and explicitly confirmed inbox replies bound to saved context when
    host capabilities permit. Inbox context is bounded and may be incomplete or
    stale; no provider refresh occurs. Manual LinkedIn imports, reviewed
    activation and reviewed resume of paused campaigns are separate gated
    workflows. Reply drafts, knowledge, team, infrastructure quotes with hosted
    checkout and agency administration are covered by separate scopes. Signed
    webhooks report durable operation outcomes. It does not support immediate
    batches or direct card charges.
servers:
  - url: https://app.emailx.ai/api/v1
    description: Emailx application · access must be enabled
security: []
tags:
  - name: Getting started
  - name: Workspaces
  - name: Contacts
  - name: Templates
  - name: Campaigns
  - name: Inbox
  - name: Senders
  - name: Team
  - name: Analytics
  - name: Imports
  - name: Operations
  - name: Knowledge
  - name: Infrastructure
  - name: Agency
paths:
  /workspaces/{workspace_id}/campaigns/linkedin/{campaign_id}/imports:
    post:
      tags:
        - Add prospects
      summary: Import LinkedIn profiles into a draft
      description: >-
        Looks up 1 to 100 LinkedIn profile URLs in the background and adds them
        to a LinkedIn draft. Read the results with Get LinkedIn import results.


        Permission: `campaigns:import`
      operationId: create_api_linkedin_import
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
          description: Emailx workspace (Clients) ID, not the agency workspace link ID.
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
          description: Resource identifier.
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9_.:/-]+$
          description: Unique per logical mutation. Same path and body replay for 24 hours.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLinkedinImport'
            example:
              expected_revision: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
              sender_id: 903
              leads:
                - linkedin_url: https://www.linkedin.com/in/example-person/
                  first_name: Alex
                  company: Example Studio
      responses:
        '202':
          description: Accepted
          headers:
            X-Request-Id:
              schema:
                type: string
            Emailx-Api-Version:
              schema:
                type: string
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Reset:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Operation'
                required:
                  - data
              example:
                data:
                  id: op_0123456789abcdef0123456789abcdef
                  workspace_id: 123
                  kind: linkedin.import
                  resource_type: linkedin_campaign
                  resource_id: 456
                  status: queued
                  created_at: '2026-11-01T09:00:00Z'
                  updated_at: '2026-11-01T09:00:00Z'
                  completed_at: null
                  error_code: null
                  cancellable: true
        '400':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid, expired or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope or write permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource missing or inaccessible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict, concurrent request or uncertain original result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait when present.
        '413':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited; respect Retry-After
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait when present.
        '500':
          description: Request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: API disabled, request storage unavailable or feature not enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait when present.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: cURL
          source: >-
            curl -X POST
            "https://app.emailx.ai/api/v1/workspaces/123/campaigns/linkedin/456/imports"
            \
              -H "Authorization: Bearer $EMAILX_API_KEY" \
              -H "Content-Type: application/json" \
              -H "Idempotency-Key: example-operation-001" \
              --data '{"expected_revision":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sender_id":903,"leads":[{"linkedin_url":"https://www.linkedin.com/in/example-person/","first_name":"Alex","company":"Example Studio"}]}'
        - lang: Python
          source: |-
            import os, requests

            response = requests.post(
                "https://app.emailx.ai/api/v1/workspaces/123/campaigns/linkedin/456/imports",
                headers={"Authorization": "Bearer " + os.environ["EMAILX_API_KEY"], "Idempotency-Key": "example-operation-001"},
                json={'expected_revision': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sender_id': 903, 'leads': [{'linkedin_url': 'https://www.linkedin.com/in/example-person/', 'first_name': 'Alex', 'company': 'Example Studio'}]},
                timeout=30,
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          source: >-
            const response = await
            fetch("https://app.emailx.ai/api/v1/workspaces/123/campaigns/linkedin/456/imports",
            {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.EMAILX_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "example-operation-001" },
              body: JSON.stringify({"expected_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sender_id": 903, "leads": [{"linkedin_url": "https://www.linkedin.com/in/example-person/", "first_name": "Alex", "company": "Example Studio"}]}),
              signal: AbortSignal.timeout(30000),
            });

            if (!response.ok) throw new Error(`Emailx: ${response.status}`);

            console.log(await response.json());
components:
  schemas:
    CreateLinkedinImport:
      type: object
      properties:
        expected_revision:
          type: string
          pattern: ^[a-f0-9]{64}$
        sender_id:
          type: integer
          minimum: 1
        leads:
          type: array
          items:
            type: object
            properties:
              linkedin_url:
                type: string
                maxLength: 500
              first_name:
                type: string
                nullable: true
                maxLength: 255
              last_name:
                type: string
                nullable: true
                maxLength: 255
              company:
                type: string
                nullable: true
                maxLength: 255
            required:
              - linkedin_url
            additionalProperties: false
          minItems: 1
          maxItems: 100
      required:
        - expected_revision
        - sender_id
        - leads
      additionalProperties: false
      description: >-
        Requires EMAILX_API_EXECUTION_ENABLED. Accepts normalized LinkedIn
        profile URLs only; combined command JSON is limited to 64 KiB. No
        provider calls occur in the request.
    Operation:
      type: object
      properties:
        id:
          type: string
          pattern: ^op_[a-f0-9]{32}$
        workspace_id:
          type: integer
          minimum: 1
        kind:
          type: string
          enum:
            - linkedin.import
            - linkedin.activate
            - linkedin.resume
            - email.prepare
            - email.generate
            - email.activate
            - people.import
            - email.reply
            - linkedin.reply
            - warmup.control
            - team.invite
            - domains.search
            - linkedin.search
        resource_type:
          type: string
          enum:
            - linkedin_campaign
            - email_campaign
            - workspace
            - email_conversation
            - linkedin_conversation
            - email_sender
            - workspace_member
        resource_id:
          type: integer
          minimum: 1
        status:
          type: string
          enum:
            - queued
            - running
            - awaiting_user_action
            - succeeded
            - partially_succeeded
            - failed
            - needs_reconciliation
            - cancelled
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        completed_at:
          type: string
          nullable: true
          format: date-time
        error_code:
          type: string
          nullable: true
          maxLength: 80
        cancellable:
          type: boolean
        result:
          oneOf:
            - $ref: '#/components/schemas/ImportResult'
            - $ref: '#/components/schemas/LinkedinActivationResult'
            - $ref: '#/components/schemas/LinkedinResumeResult'
            - $ref: '#/components/schemas/EmailPreparationResult'
            - $ref: '#/components/schemas/EmailGenerationResult'
            - $ref: '#/components/schemas/EmailActivationResult'
            - $ref: '#/components/schemas/PeopleImportResult'
            - $ref: '#/components/schemas/ReplySendResult'
            - $ref: '#/components/schemas/WarmupCommandResult'
            - $ref: '#/components/schemas/TeamInviteResult'
            - $ref: '#/components/schemas/DomainAvailabilityResult'
            - $ref: '#/components/schemas/LinkedinLeadSearchResult'
            - type: object
              nullable: true
              enum:
                - null
      required:
        - id
        - workspace_id
        - kind
        - resource_type
        - resource_id
        - status
        - created_at
        - updated_at
        - completed_at
        - error_code
        - cancellable
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
            - request_id
      required:
        - error
    ImportResult:
      type: object
      properties:
        import_job_id:
          type: integer
          minimum: 1
        campaign_id:
          type: integer
          minimum: 1
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - paused
            - failed
        total:
          type: integer
          minimum: 0
        counts:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
        rows_path:
          type: string
      required:
        - import_job_id
        - campaign_id
        - status
        - total
        - counts
        - rows_path
    LinkedinActivationResult:
      type: object
      properties:
        campaign_id:
          type: integer
          minimum: 1
        campaign_status:
          type: string
          enum:
            - active
        dispatch_mode:
          type: string
          enum:
            - native_scheduled_dispatch
        delivery_verified:
          type: boolean
          enum:
            - false
      required:
        - campaign_id
        - campaign_status
        - dispatch_mode
        - delivery_verified
      additionalProperties: false
    LinkedinResumeResult:
      type: object
      properties:
        campaign_id:
          type: integer
          minimum: 1
        campaign_status:
          type: string
          enum:
            - active
        dispatch_mode:
          type: string
          enum:
            - native_periodic_scheduler
        delivery_verified:
          type: boolean
          enum:
            - false
      required:
        - campaign_id
        - campaign_status
        - dispatch_mode
        - delivery_verified
      additionalProperties: false
    EmailPreparationResult:
      type: object
      properties:
        workspace_id:
          type: integer
          minimum: 1
        campaign_id:
          type: integer
          minimum: 1
        revision:
          type: string
          pattern: ^[a-f0-9]{64}$
        contact_count:
          type: integer
          minimum: 1
        step_count:
          type: integer
          minimum: 1
        mailbox_count:
          type: integer
          minimum: 1
        task_count:
          type: integer
          minimum: 1
        task_ids:
          type: array
          items:
            type: integer
            minimum: 1
        status:
          type: string
          enum:
            - prepared
        scheduled:
          type: boolean
          enum:
            - false
        generation_requested:
          type: boolean
          enum:
            - false
        send_requested:
          type: boolean
          enum:
            - false
      required:
        - workspace_id
        - campaign_id
        - revision
        - contact_count
        - step_count
        - mailbox_count
        - task_count
        - task_ids
        - status
        - scheduled
        - generation_requested
        - send_requested
    EmailGenerationResult:
      type: object
      properties:
        messages:
          type: array
          maxItems: 10
          items:
            type: object
            properties:
              task_id:
                type: integer
                minimum: 1
              preview_id:
                type: integer
                minimum: 1
            required:
              - task_id
              - preview_id
        generation_verified:
          type: boolean
        delivery_verified:
          type: boolean
          enum:
            - false
      required:
        - messages
        - generation_verified
        - delivery_verified
    EmailActivationResult:
      type: object
      properties:
        campaign_id:
          type: integer
          minimum: 1
        campaign_status:
          type: string
          enum:
            - active
        dispatch_mode:
          type: string
          enum:
            - native_scheduled_dispatch
        delivery_verified:
          type: boolean
          enum:
            - false
        scheduled_messages:
          type: integer
          minimum: 1
          maximum: 500
      required:
        - campaign_id
        - campaign_status
        - dispatch_mode
        - delivery_verified
        - scheduled_messages
      additionalProperties: false
    PeopleImportResult:
      type: object
      properties:
        total_rows:
          type: integer
          minimum: 0
          maximum: 1000
        created_count:
          type: integer
          minimum: 0
          maximum: 1000
        existing_count:
          type: integer
          minimum: 0
          maximum: 1000
        rows_path:
          type: string
      required:
        - total_rows
        - created_count
        - existing_count
        - rows_path
    ReplySendResult:
      type: object
      properties:
        reply_id:
          type: integer
          minimum: 1
        provider_accepted:
          type: boolean
        delivery_verified:
          type: boolean
          enum:
            - false
      required:
        - reply_id
        - provider_accepted
        - delivery_verified
      additionalProperties: false
      description: Provider acceptance is not proof of recipient delivery.
    WarmupCommandResult:
      type: object
      properties:
        sender_id:
          type: integer
          minimum: 1
        warmup_active:
          type: boolean
        applied:
          type: array
          items:
            type: string
        failed:
          type: array
          items:
            type: string
        provider_confirmed:
          type: boolean
      required:
        - sender_id
        - warmup_active
        - applied
        - failed
        - provider_confirmed
      additionalProperties: false
    TeamInviteResult:
      type: object
      properties:
        member_id:
          type: integer
          minimum: 1
        email:
          type: string
        invitation_sent:
          type: boolean
        reason:
          type: string
          nullable: true
      required:
        - member_id
        - email
        - invitation_sent
        - reason
      additionalProperties: false
    DomainAvailabilityResult:
      type: object
      properties:
        query:
          type: string
        success:
          type: boolean
        domains:
          type: array
          maxItems: 20
          items:
            type: object
            properties:
              domain:
                type: string
              available:
                type: boolean
                enum:
                  - true
              price:
                type: number
                nullable: true
              renew_price:
                type: number
                nullable: true
            required:
              - domain
              - available
              - price
              - renew_price
        checked_at:
          type: string
          format: date-time
        reservation:
          type: boolean
          enum:
            - false
      required:
        - query
        - success
        - domains
        - checked_at
        - reservation
      additionalProperties: false
    LinkedinLeadSearchResult:
      type: object
      properties:
        campaign_id:
          type: integer
          minimum: 1
        success:
          type: boolean
        search_limited:
          type: boolean
        candidates:
          type: array
          maxItems: 25
          items:
            type: object
            properties:
              provider_id:
                type: string
              linkedin_url:
                type: string
                nullable: true
              name:
                type: string
                nullable: true
              headline:
                type: string
                nullable: true
              company:
                type: string
                nullable: true
              location:
                type: string
                nullable: true
              fit_score:
                type: number
                nullable: true
              fit_label:
                type: string
                nullable: true
            required:
              - provider_id
              - linkedin_url
              - name
              - headline
              - company
              - location
              - fit_score
              - fit_label
        filtered_count:
          type: integer
          minimum: 0
        enrolled:
          type: boolean
          enum:
            - false
        add_with:
          type: string
          enum:
            - create_api_prospect
      required:
        - campaign_id
        - success
        - search_limited
        - candidates
        - filtered_count
        - enrolled
        - add_with
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        ex_test_ or ex_live_ key issued by an Emailx operator. Never use
        provider keys or session cookies.

````

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