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

# Create campaign

> Creates a campaign using a domain-oriented public contract. Campaigns attach to an existing rotator with `destination.mode=use_rotator`. Create or edit rotators through the rotator API.




## OpenAPI

````yaml openapi.public.yaml POST /api/v1/campaigns
openapi: 3.0.3
info:
  title: Metricanic API
  version: 1.0.0
  description: >
    # Metricanic API


    Use the Metricanic REST API to manage campaigns, traffic sources, affiliate
    networks, landings, offers and rotators, and to read performance reports and
    individual events.


    Base URL: `https://panel.metricanic.com/api/v1`. Requests require an
    account-scoped Bearer key created in **Profile → API keys**. Use `read` for
    GET requests or `write` for supported mutations. Keys are intended for
    server-side integrations. Cross-origin browser writes are rejected.


    Start with the [API
    quickstart](https://docs.metricanic.com/api-reference/introduction), then
    follow the guides for
    [authentication](https://docs.metricanic.com/api-reference/authentication),
    [reports and event
    pagination](https://docs.metricanic.com/api-reference/reports-and-events),
    and [errors and retries](https://docs.metricanic.com/api-reference/errors).


    Only the operations in this specification are supported under `/api/v1`.
    Individual endpoint schemas define the request and response shapes. List
    endpoints do not all share the same pagination model. The product's OAuth
    MCP connection has separate, read-only capabilities.
  license:
    name: Proprietary
    url: https://metricanic.com/legal/terms
servers:
  - url: https://panel.metricanic.com
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Authentication and session endpoints.
  - name: Campaigns
    description: Campaign and campaign-related management endpoints.
  - name: Landings
    description: Landing page management endpoints.
  - name: Offers
    description: Offer management endpoints.
  - name: Reports
    description: Aggregated reporting and chart endpoints.
  - name: Rotators
    description: Rotator setup and routing-rule endpoints.
  - name: TrafficSources
    description: Traffic source configuration endpoints.
  - name: AffiliateNetworks
    description: Affiliate network management endpoints.
  - name: Events
    description: Raw event and error inspection endpoints.
paths:
  /api/v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create campaign
      description: >
        Creates a campaign using a domain-oriented public contract. Campaigns
        attach to an existing rotator with `destination.mode=use_rotator`.
        Create or edit rotators through the rotator API.
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            example:
              name: us-search-mainstream
              trafficSourceId: 6f9d2b4e-8a1c-4d3e-9f5a-7b2c4d6e8f0a
              country: US
              cost:
                mode: cpv
                amount: 0.012
              tracking:
                method: redirect
              destination:
                mode: use_rotator
                rotatorId: 9b8c7d6e-5f4a-4b3c-8d1e-0f9a8b7c6d5e
            schema:
              $ref: '#/components/schemas/CampaignCreatePayload'
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              example:
                ok: true
                data:
                  campaign:
                    id: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                    name: us-search-mainstream
                    displayName: US Search Mainstream
                    status: active
                    trafficSourceId: 6f9d2b4e-8a1c-4d3e-9f5a-7b2c4d6e8f0a
                    country: US
                    cost:
                      mode: cpv
                      amount: 0.012
                    tracking:
                      method: redirect
                      domainId: null
                      includePrefetch: false
                    destination:
                      type: rotator
                      rotatorId: 9b8c7d6e-5f4a-4b3c-8d1e-0f9a8b7c6d5e
                    createdAt: '2026-05-15T09:30:00.000Z'
                  publish:
                    status: queued
              schema:
                $ref: '#/components/schemas/CampaignMutationResponse'
        '400':
          description: Invalid payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          description: >-
            Referenced traffic source, rotator, domain, offer, or landing not
            found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Referenced resource is not publishable or compatible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request body too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitedError'
        '503':
          $ref: '#/components/responses/ServiceUnavailableError'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    CampaignCreatePayload:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 160
        trafficSourceId:
          type: string
        country:
          type: string
          description: ISO 3166-1 alpha-2 country code. Use ZZ for Global.
        cost:
          $ref: '#/components/schemas/CampaignCost'
        tracking:
          $ref: '#/components/schemas/CampaignTracking'
        destination:
          $ref: '#/components/schemas/CampaignUseRotatorDestination'
      required:
        - name
        - trafficSourceId
        - destination
      additionalProperties: false
    CampaignMutationResponse:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            campaign:
              $ref: '#/components/schemas/Campaign'
            publish:
              $ref: '#/components/schemas/CampaignPublish'
          required:
            - campaign
            - publish
          additionalProperties: false
      required:
        - ok
        - data
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
          additionalProperties: false
        requestId:
          type: string
      required:
        - ok
        - error
      additionalProperties: false
    CampaignCost:
      type: object
      oneOf:
        - type: object
          properties:
            mode:
              type: string
              enum:
                - none
          required:
            - mode
          additionalProperties: false
        - type: object
          properties:
            mode:
              type: string
              enum:
                - auto
          required:
            - mode
          additionalProperties: false
        - type: object
          properties:
            mode:
              type: string
              enum:
                - cpv
            amount:
              type: number
              minimum: 0
          required:
            - mode
            - amount
          additionalProperties: false
    CampaignTracking:
      type: object
      properties:
        method:
          type: string
          enum:
            - redirect
            - direct
        domainId:
          type: string
          nullable: true
        includePrefetch:
          type: boolean
      required:
        - method
      additionalProperties: false
    CampaignUseRotatorDestination:
      type: object
      properties:
        mode:
          type: string
          enum:
            - use_rotator
        rotatorId:
          type: string
      required:
        - mode
        - rotatorId
      additionalProperties: false
    Campaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        displayName:
          type: string
        status:
          type: string
          enum:
            - active
            - archived
            - paused
        trafficSourceId:
          type: string
        country:
          type: string
        cost:
          $ref: '#/components/schemas/CampaignCost'
        tracking:
          $ref: '#/components/schemas/CampaignTrackingResponse'
        destination:
          $ref: '#/components/schemas/CampaignPersistedDestination'
        createdAt:
          type: string
          nullable: true
      required:
        - id
        - name
        - displayName
        - status
        - trafficSourceId
        - country
        - cost
        - tracking
        - destination
      additionalProperties: false
    CampaignPublish:
      type: object
      properties:
        status:
          type: string
          enum:
            - published
            - queued
            - not_required
      required:
        - status
      additionalProperties: false
    CampaignTrackingResponse:
      type: object
      properties:
        method:
          type: string
          enum:
            - redirect
            - direct
        domainId:
          type: string
          nullable: true
        includePrefetch:
          type: boolean
      required:
        - method
        - domainId
        - includePrefetch
      additionalProperties: false
    CampaignPersistedDestination:
      type: object
      properties:
        type:
          type: string
          enum:
            - rotator
        rotatorId:
          type: string
      required:
        - type
        - rotatorId
      additionalProperties: false
  responses:
    ForbiddenError:
      description: The authenticated caller is not allowed to perform this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimitedError:
      description: Rate limit exceeded.
      headers:
        Retry-After:
          description: Seconds to wait before retrying when available.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailableError:
      description: A required platform dependency is temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ErrorResponse:
      description: >-
        Standard API error envelope. Common platform errors include
        authentication failures, forbidden scope or origin, billing gate, rate
        limiting, and temporary service unavailability.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````