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

# Create campaign

> Create a campaign and turn it on. It starts looking for leads immediately and messages go out as written; set review_prospects true to approve each lead first. Each step in `steps` is written by you (mode "template", with {{variables}} and {{ai: …}} spans) or by the AI from your brief (mode "prompt"). Call list-linkedin-accounts first for a valid linkedin_account_id.



## OpenAPI

````yaml /api-reference/openapi.json post /campaigns
openapi: 3.1.0
info:
  title: LeadBeast API
  version: v1
  description: >-
    One workspace per API key. Send the key as `Authorization: Bearer lb_...`;
    each key carries `resource:read` / `resource:write` scopes. Every response
    is either `{"data": ..., "meta": ...}` or `{"error": ..., "meta": ...}`, and
    `X-Request-Id` on the response identifies the call in support. Write calls
    accept an `Idempotency-Key` header: repeating a call with the same key
    replays the original result instead of acting again. The same tools are
    available to AI clients over MCP at https://app.leadbeast.io/mcp.
servers:
  - url: https://app.leadbeast.io/api/v1
security:
  - bearer: []
tags:
  - name: business
  - name: leads
  - name: campaigns
  - name: inbox
paths:
  /campaigns:
    post:
      tags:
        - campaigns
      summary: Create campaign
      description: >-
        Create a campaign and turn it on. It starts looking for leads
        immediately and messages go out as written; set review_prospects true to
        approve each lead first. Each step in `steps` is written by you (mode
        "template", with {{variables}} and {{ai: …}} spans) or by the AI from
        your brief (mode "prompt"). Call list-linkedin-accounts first for a
        valid linkedin_account_id.
      operationId: create-campaign
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Repeating a call with the same key replays the original result
            instead of acting again.
          schema:
            type: string
            minLength: 8
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  description: >-
                    What this campaign is called, for example "SaaS founders
                    talking about churn".
                  maxLength: 255
                  type: string
                signals:
                  description: >-
                    What the campaign watches for on LinkedIn. Up to 15 signals;
                    entries for the same keyword or profile with different
                    audiences count as one signal.
                  minItems: 1
                  maxItems: 45
                  items:
                    description: >-
                      One thing to watch. Keyword form: type, keyword, audience
                      and, for ai_signal, qualification_prompt. Profile form:
                      template_key and source_url.
                    properties:
                      type:
                        description: >-
                          Keyword form. ai_signal reads each post and keeps only
                          the people who match qualification_prompt.
                          basic_engagement_posts keeps everyone in the audience.
                        enum:
                          - ai_signal
                          - basic_engagement_posts
                        type: string
                      keyword:
                        description: >-
                          Keyword form. The phrase to watch for in LinkedIn
                          posts, for example "churn dashboard".
                        type: string
                      audience:
                        description: >-
                          Keyword form. Who becomes a lead: the people who write
                          the posts, who like them, or who comment. Default
                          post_creators. Repeat the entry with another audience
                          to watch more than one.
                        enum:
                          - post_creators
                          - engagers
                          - commenters
                        type: string
                      signal_name:
                        description: Keyword form. A short label for this entry.
                        type: string
                      qualification_prompt:
                        description: >-
                          Required for ai_signal: the plain-English test a
                          person must pass, for example "Qualify if the author
                          runs a SaaS company and describes churn pain".
                        type: string
                      template_key:
                        description: >-
                          Profile form. Watch one LinkedIn profile or company
                          page and keep the people who like (*_engagers) or
                          comment on (*_commenters) its posts. competitor_*,
                          brand_* and basic_* only label whose page it is.
                        enum:
                          - competitor_engagers
                          - competitor_commenters
                          - brand_engagers
                          - brand_commenters
                          - basic_engagers
                          - basic_commenters
                        type: string
                      source_url:
                        description: >-
                          Profile form. The page to watch:
                          https://www.linkedin.com/in/... or
                          https://www.linkedin.com/company/...
                        type: string
                      signal_type:
                        description: Profile form. Filled in from source_url when left out.
                        enum:
                          - profile_tracking
                          - company_tracking
                        type: string
                      source_name:
                        description: >-
                          Profile form, read only. The name of the watched
                          person or page once LeadBeast knows it.
                        type:
                          - string
                          - 'null'
                      id:
                        description: >-
                          The saved signal this entry edits, as returned by
                          get-campaign. Leave out for a new signal.
                        type: string
                      group_id:
                        description: >-
                          The signal group to file this entry under, as returned
                          by get-campaign. Optional.
                        type: string
                    type: object
                  type: array
                icp:
                  description: >-
                    Who counts as a lead. Everything found is filtered against
                    this.
                  properties:
                    target_job_titles:
                      description: >-
                        Job titles to keep, for example ["Founder", "Head of
                        Growth"].
                      items:
                        type: string
                      type: array
                    target_industries:
                      description: >-
                        Industries to keep, by name as LinkedIn shows them, for
                        example ["Software Development"]. list-campaign-options
                        has the list; other names are matched by text.
                      items:
                        type: string
                      type: array
                    target_company_sizes:
                      description: Employee-count buckets to keep.
                      items:
                        enum:
                          - 1-10
                          - 11-50
                          - 51-200
                          - 201-500
                          - 501-1000
                          - 1001-5000
                          - 5001-10000
                          - 10000+
                        type: string
                      type: array
                    target_locations:
                      description: >-
                        Places to keep: country names in English or a region
                        from list-campaign-options, for example ["United
                        States", "Europe"]. Other text is matched against the
                        lead's location.
                      items:
                        type: string
                      type: array
                    exclude_locations:
                      description: Places to skip, same values as target_locations.
                      items:
                        type: string
                      type: array
                    exclude_companies:
                      items:
                        type: string
                      type: array
                    exclude_keywords:
                      description: >-
                        Skip anyone whose profile carries one of these words,
                        for example ["recruiter"].
                      items:
                        type: string
                      type: array
                    ai_refinement_prompt:
                      description: >-
                        An extra plain-English rule the AI reads when it scores
                        a person, for example "Only people who run their own
                        company."
                      maxLength: 1000
                      type: string
                    lead_score_threshold:
                      description: >-
                        People with a lead score (1.0-10.0) at or above this
                        become leads. Default 7.
                      type: number
                  type: object
                steps:
                  description: >-
                    The message sequence, in order, 1-12 entries:
                    connection_request, message and wait steps. Every step that
                    carries text has a mode. "template" (Write it): you write
                    the message, with {{variables}} and optional {{ai: …}} spans
                    the AI fills per lead. "prompt" (Let AI write): you write a
                    brief and the AI writes the whole message per lead. Sending
                    an updated list replaces the whole sequence.
                  minItems: 1
                  maxItems: 12
                  items:
                    properties:
                      type:
                        description: >-
                          connection_request sends an invite, message sends a
                          LinkedIn message, wait pauses.
                        enum:
                          - connection_request
                          - message
                          - wait
                        type: string
                      mode:
                        description: >-
                          How `message` is used. "template" (Write it): sent as
                          written, with {{variables}} filled and {{ai: …}} spans
                          written by the AI for each lead. "prompt" (Let AI
                          write): `message` is a brief, for example "Ask what
                          they tried for churn and offer a 15-minute call", and
                          the AI writes the whole message for each lead. Default
                          template. Not used on a wait step.
                        enum:
                          - template
                          - prompt
                        type: string
                      message:
                        description: >-
                          In template mode, the message itself. Variables:
                          {{first_name}}, {{last_name}}, {{company}},
                          {{job_title}}, {{sender_first_name}},
                          {{sender_full_name}}, {{sender_company}}. An {{ai:
                          instruction}} span is one sentence the AI writes in
                          place, for example {{ai: mention their latest post}}.
                          In prompt mode, the brief the AI writes from. Leave
                          empty on a wait step, or on an invite without a note.
                        maxLength: 5000
                        type: string
                      with_note:
                        description: >-
                          Connection requests only. Send the invite with the
                          note in `message`. Notes need LinkedIn Premium.
                        type: boolean
                      wait_days:
                        description: Days to wait. Only used on a wait step.
                        minimum: 0
                        maximum: 60
                        type: integer
                    type: object
                    required:
                      - type
                  type: array
                review_prospects:
                  description: >-
                    Review mode: every new lead waits in
                    list-messages-for-review until you approve or reject them.
                    An approved lead gets the whole sequence. Off, messages go
                    out as written. Default false.
                  type: boolean
                exclude_first_degree:
                  description: >-
                    Skip people already connected to the sending account.
                    Default true.
                  type: boolean
                ai_instructions:
                  description: >-
                    How the AI writes every message in this campaign: role,
                    goal, tone, rules. Start from a preset with
                    ai_instructions_preset, or write your own; {{variables}}
                    work here too.
                  maxLength: 5000
                  type: string
                ai_instructions_preset:
                  description: >-
                    Fill ai_instructions with one of the ready-made texts from
                    list-campaign-options. Ignored when ai_instructions is sent
                    too.
                  enum:
                    - all_purpose
                    - warm_conversation
                    - book_a_demo
                    - agency
                    - founder_to_founder
                  type: string
                linkedin_account_id:
                  description: >-
                    The LinkedIn account that sends, from
                    list-linkedin-accounts. Required once the workspace has a
                    connected account. Locked after the first message goes out.
                  type: string
              required:
                - name
                - signals
                - icp
                - steps
      responses:
        '200':
          description: The call ran. Read `data.status` for what happened.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    properties:
                      status:
                        type: string
                        enum:
                          - completed
                          - queued
                          - processing
                          - partially_completed
                          - failed_temporary
                          - failed_permanent
                          - provider_unavailable
                          - rate_limited
                          - action_required
                        description: >-
                          What happened, machine-readable. Trust it over the
                          prose.
                      message:
                        type: string
                      campaign_id:
                        type: string
                      name:
                        type: string
                      replayed:
                        type: boolean
                        description: >-
                          Present and true when this is the stored result of an
                          earlier call with the same idempotency_key.
                    type: object
                    required:
                      - status
                      - message
                      - campaign_id
                      - name
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/SubscriptionRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/ActionRequired'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    Meta:
      type: object
      properties:
        request_id:
          type: string
        replayed:
          type: boolean
      required:
        - request_id
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: string
              enum:
                - completed
                - queued
                - processing
                - partially_completed
                - failed_temporary
                - failed_permanent
                - provider_unavailable
                - rate_limited
                - action_required
            reason_code:
              type:
                - string
                - 'null'
            message:
              type: string
          required:
            - status
            - message
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - error
        - meta
  responses:
    Unauthenticated:
      description: The API key is missing, expired or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    SubscriptionRequired:
      description: The workspace has no active subscription.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key lacks the scope, or the plan lacks API access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such record in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ActionRequired:
      description: The request was understood but cannot run in the current state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationFailed:
      description: One or more arguments are invalid; see `error.errors`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests. Wait for `Retry-After` seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: A dependency failed. The call is safe to retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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