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

# PublicApiCreateCampaign

> POST /api/v1/organizations/{orgId}/workspaces/{wsId}/campaigns

Use this endpoint through the Developer API or the matching `firstsales` CLI command when available. Responses use the stable FirstSales public error envelope.


## OpenAPI

````yaml POST /api/v1/organizations/{orgId}/workspaces/{wsId}/campaigns
openapi: 3.1.0
info:
  title: FirstSales Developer API
  version: 1.0.0
  description: >-
    Public v1 developer API for FirstSales.io. Generated from live step
    definitions — do not hand-edit.
servers:
  - url: https://sandbox.api.app.firstsales.io
  - url: https://api.app.firstsales.io
security:
  - bearerAuth: []
tags:
  - name: Activities
  - name: Alerts
  - name: API Keys
  - name: Authentication
  - name: Billing
  - name: Blocked Domains
  - name: Campaigns
  - name: Companies
  - name: Connectors
  - name: Contacts
  - name: Copilot
  - name: Dashboard
  - name: Deals
  - name: Direct Email
  - name: Email Authentication
  - name: Inbox
  - name: Knowledge Bases
  - name: Learning
  - name: Offerings
  - name: Organizations
  - name: Product Updates
  - name: Sequence Library
  - name: Signals
    description: >-
      Beta. Find people who comment on or react to LinkedIn posts by a keyword,
      a person or a company page. Each scan costs 10x the scraper cost in
      credits (1 credit = $0.01), capped by the daily budget of the signal. A
      scan that adds no new person is free.
  - name: Suppression
  - name: Team
  - name: Tracking Domains
  - name: Warmup
paths:
  /api/v1/organizations/{orgId}/workspaces/{wsId}/campaigns:
    post:
      tags:
        - Campaigns
      summary: PublicApiCreateCampaign
      description: >-
        Creates one campaign synchronously. The canonical JSON request body is
        limited to 32768 UTF-8 bytes.
      operationId: createCampaign
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
        - name: wsId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorEnvelope'
      security:
        - developerKeyBearer: []
components:
  schemas:
    CreateCampaignRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        description:
          type: string
          maxLength: 1000
        campaignType:
          type: string
          enum:
            - outreach
            - marketing
        goal:
          type: string
          enum:
            - meeting
            - demo
            - download
            - order
            - reply
            - custom
        audience:
          type: object
          properties:
            targetAudience:
              type: string
              maxLength: 2000
            industry:
              type: string
              maxLength: 500
            geography:
              type: object
              properties:
                country:
                  type: string
                  maxLength: 200
                state:
                  type: string
                  maxLength: 200
                city:
                  type: string
                  maxLength: 200
              additionalProperties: false
          additionalProperties: false
        campaignMode:
          type: string
          enum:
            - template
            - autopilot
      required:
        - name
        - campaignType
        - goal
      additionalProperties: false
      allOf:
        - if:
            properties:
              campaignMode:
                const: template
            required:
              - campaignMode
          then:
            properties:
              goal:
                const: reply
    CampaignResponse:
      type: object
      properties:
        campaign:
          type: object
          properties:
            id:
              type: string
              minLength: 1
            workspaceId:
              type: string
              minLength: 1
            name:
              type: string
            description:
              type:
                - string
                - 'null'
            campaignType:
              type: string
              enum:
                - outreach
                - marketing
            campaignMode:
              type: string
              enum:
                - template
                - autopilot
            goal:
              type: string
              enum:
                - meeting
                - demo
                - download
                - order
                - reply
                - custom
            status:
              type: string
              enum:
                - draft
                - configuring
                - ready
                - active
                - paused
                - completed
            progress:
              type: integer
              minimum: 0
              maximum: 100
              default: 0
            audience:
              type:
                - object
                - 'null'
              properties:
                targetAudience:
                  type: string
                  maxLength: 2000
                industry:
                  type: string
                  maxLength: 500
                geography:
                  type: object
                  properties:
                    country:
                      type: string
                      maxLength: 200
                    state:
                      type: string
                      maxLength: 200
                    city:
                      type: string
                      maxLength: 200
                  additionalProperties: false
              additionalProperties: false
            stopOnReply:
              type: boolean
              default: true
            handleOOO:
              type: boolean
              default: true
            sendWindow:
              type: object
              properties:
                start:
                  type: string
                  default: '09:00'
                end:
                  type: string
                  default: '17:00'
                timezone:
                  type: string
                  default: auto
                activeDays:
                  type: array
                  minItems: 1
                  items:
                    type: string
                    enum:
                      - mon
                      - tue
                      - wed
                      - thu
                      - fri
                      - sat
                      - sun
                  default:
                    - mon
                    - tue
                    - wed
                    - thu
                    - fri
              required:
                - start
                - end
                - timezone
                - activeDays
              additionalProperties: false
            stalledReason:
              type:
                - string
                - 'null'
              enum:
                - no_pending_work_after_failures
                - null
            stalledAt:
              type:
                - string
                - 'null'
              format: date-time
            startedAt:
              type:
                - string
                - 'null'
              format: date-time
            lastSendAt:
              type:
                - string
                - 'null'
              format: date-time
            createdAt:
              type:
                - string
                - 'null'
              format: date-time
            updatedAt:
              type:
                - string
                - 'null'
              format: date-time
          required:
            - id
            - workspaceId
            - name
            - description
            - campaignType
            - campaignMode
            - goal
            - status
            - progress
            - audience
            - stopOnReply
            - handleOOO
            - sendWindow
            - stalledReason
            - stalledAt
            - startedAt
            - lastSendAt
            - createdAt
            - updatedAt
          additionalProperties: false
      required:
        - campaign
      additionalProperties: false
    PublicErrorEnvelope:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            requestId:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
            - requestId
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Legacy compatibility bearer scheme for generated consumers.
    developerKeyBearer:
      type: http
      scheme: bearer
      description: FirstSales developer API key bearer token (fs-key-*).

````

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