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

# Create campaign

> Create campaign with goal. Visibility omitted defaults public and free (#397). Setting visibility private costs 1 credit (402 out-of-credits when exhausted; no Payment challenge).



## OpenAPI

````yaml POST /api/campaigns
openapi: 3.1.0
info:
  description: >-
    Starcovery helps you find and hire real Instagram and TikTok creators from a
    plain-language brief, on the web or from your agents. REST and MCP API.
    Search accepts unsigned callers. Campaigns, billing state, and keys accept
    browser session, x-api-key, or Bearer. MCP accepts OAuth, x-api-key, Bearer,
    or last-resort ?api_key= (no session). Machine Payments Protocol
    (x-payment-info) on GET /api/search when provisioned. Signup and claim at
    auth.md.
  title: Starcovery
  version: 1.0.0
servers:
  - url: https://www.starcovery.com
security: []
paths:
  /api/campaigns:
    post:
      summary: Create campaign
      description: >-
        Create campaign with goal. Visibility omitted defaults public and free
        (#397). Setting visibility private costs 1 credit (402 out-of-credits
        when exhausted; no Payment challenge).
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  campaign:
                    $ref: '#/components/schemas/CampaignRow'
                required:
                  - campaign
                type: object
          description: Created campaign
        '400':
          description: invalid_body
        '401':
          description: >-
            unauthorized: missing identity; WWW-Authenticate points at
            protected-resource metadata
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutOfCredits'
          description: out_of_credits when creating as private
        '429':
          description: Rate limited
      security:
        - ApiKeyHeader: []
        - BearerAuth: []
        - SessionCookie: []
components:
  schemas:
    CampaignCreate:
      additionalProperties: false
      properties:
        goal:
          maxLength: 200
          minLength: 1
          type: string
        name:
          maxLength: 100
          minLength: 1
          type: string
        visibility:
          description: 'Omitted: defaults public (#397). Setting private costs 1 credit.'
          enum:
            - private
            - public
          type: string
      required:
        - goal
        - name
      type: object
    CampaignRow:
      additionalProperties: false
      properties:
        createdAt:
          format: date-time
          type: string
        createdBy:
          enum:
            - agent
            - human
          type: string
        goal:
          type: string
        id:
          type: string
        name:
          type: string
        status:
          enum:
            - active
            - archived
            - draft
          type: string
        updatedAt:
          format: date-time
          type: string
        userId:
          type: string
        visibility:
          enum:
            - private
            - public
          type: string
      required:
        - createdAt
        - createdBy
        - goal
        - id
        - name
        - status
        - updatedAt
        - userId
        - visibility
      type: object
    OutOfCredits:
      additionalProperties: false
      properties:
        authUrl:
          format: uri
          type: string
        error:
          const: out_of_credits
          type: string
        freeGrant:
          description: >-
            Which free grant ran out (omitted on force_payment dry-run
            challenges).
          enum:
            - identified_daily
            - none
          type: string
        machinePayment:
          description: MPP posture for this deployment. available=false on Vercel preview.
          oneOf:
            - additionalProperties: false
              properties:
                available:
                  const: true
                  type: boolean
                challengeHeader:
                  type:
                    - string
                    - 'null'
                dryRun:
                  type: string
                retry:
                  type: string
              required:
                - available
                - challengeHeader
                - dryRun
                - retry
              type: object
            - additionalProperties: false
              properties:
                available:
                  const: false
                  type: boolean
                hint:
                  type: string
              required:
                - available
                - hint
              type: object
        packsUrl:
          format: uri
          type: string
      required:
        - authUrl
        - error
        - machinePayment
        - packsUrl
      type: object
  securitySchemes:
    ApiKeyHeader:
      description: Product API key or agent access token
      in: header
      name: x-api-key
      type: apiKey
    BearerAuth:
      bearerFormat: access token
      description: >-
        Bearer access token (agent registration), product API key, or MCP OAuth
        access token
      scheme: bearer
      type: http
    SessionCookie:
      description: >-
        Browser better-auth session cookie (REST only; MCP rejects sessions).
        Name is better-auth.session_token, or __Secure-better-auth.session_token
        on HTTPS.
      in: cookie
      name: better-auth.session_token
      type: apiKey

````