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

# Create a wallet-funded campaign

> Creates a campaign funded from the organization's wallet balance.
Requires the `campaigns:write` scope, and the organization must be
enabled for wallet billing.

This route has a financial side effect (the campaign's budget is
deducted from the wallet balance), so the `Idempotency-Key` header
is **required** on every request. See the header description below
for retry semantics.




## OpenAPI

````yaml /openapi/soundlink-public-api-v1.yaml post /v1/campaigns
openapi: 3.0.3
info:
  title: Soundlink Public API
  version: 0.0.1-draft
  description: >
    Campaign listing, metrics, and write operations for Soundlink partner
    organizations.


    **Base URL:** `https://api.getsoundlink.com`


    **Authentication:** send a `sk_*` API key created in the Soundlink app
    (Settings → Developer → API keys) using one of:


    1. **`Authorization: Bearer` (recommended)**:
       ```
       Authorization: Bearer sk_abc123_<token>
       ```

    2. **`x-api-key` header (deprecated, retiring 2026-08-17)** — migrate to
    Bearer above before then:
       ```
       x-api-key: sk_abc123_<token>
       ```

    Sending both headers returns `401 mixed_credentials`.


    All responses are wrapped in a standard envelope:

    ```json

    { "data": <payload>, "meta": { "requestId": "<uuid>" } }

    ```


    Errors follow the same envelope shape with an `error` field instead of
    `data`.
servers:
  - url: https://api.getsoundlink.com
    description: Production
security:
  - apiKeyAuth: []
  - apiKeyBearerAuth: []
tags:
  - name: System
    description: Connectivity and auth verification
  - name: Campaigns
    description: >-
      Campaign listing, detail, creation, and wallet management (budget, stop,
      tiers)
  - name: Metrics
    description: Campaign performance metrics
  - name: Videos
    description: Partner video library import for Full Control campaigns
paths:
  /v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a wallet-funded campaign
      description: |
        Creates a campaign funded from the organization's wallet balance.
        Requires the `campaigns:write` scope, and the organization must be
        enabled for wallet billing.

        This route has a financial side effect (the campaign's budget is
        deducted from the wallet balance), so the `Idempotency-Key` header
        is **required** on every request. See the header description below
        for retry semantics.
      operationId: createCampaign
      parameters:
        - $ref: '#/components/parameters/idempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
            examples:
              trackCampaign:
                summary: Campaign promoting a single track
                value:
                  spotifyUrl: https://open.spotify.com/track/11dFghVXANMlKmJXsNCbNl
                  dailyBudget: 25
                  durationDays: 14
                  genre: Pop
                  campaignName: My Summer Single
                  strategyType: maximum_growth
                  creativeDirection:
                    type: do_it_for_me
                  trackOptions:
                    artistIdFollow: artist-uuid
                  clonedFromCampaignId: 3f2504e0-4f89-41d3-9a0c-0305e82c3301
              playlistCampaign:
                summary: Campaign promoting a playlist
                value:
                  spotifyUrl: https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M
                  dailyBudget: 25
                  durationDays: 14
                  genre: Pop
                  campaignName: Summer Vibes Playlist
                  strategyType: maximum_growth
                  creativeDirection:
                    type: do_it_for_me
              fullControlCampaign:
                summary: Campaign with partner-supplied creative (full control)
                value:
                  spotifyUrl: https://open.spotify.com/track/11dFghVXANMlKmJXsNCbNl
                  dailyBudget: 40
                  durationDays: 21
                  genre: Hip-Hop/R&B
                  campaignName: My Summer Single
                  strategyType: custom
                  creativeDirection:
                    type: full_control
                    selectedCreatives:
                      - videoId: 8f14e45f-ceea-467e-9de5-e7d0b4d4e6bb
                      - videoId: 3c9b1a2d-1a2f-4a1e-9c3b-0a1b2c3d4e5f
                  tierTargeting:
                    customTierIds:
                      - 123
                      - 456
                    customTiers:
                      - name: US/UK
                        countries:
                          - US
                          - GB
                        language: en
                        percentBudget: 60
                      - name: LatAm
                        countries:
                          - MX
                          - AR
                        language: es
                        percentBudget: 40
                  trackOptions:
                    artistIdFollow: artist-uuid
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCampaignResponse'
              example:
                data:
                  campaignId: campaign-uuid
                  status: creating
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
        '400':
          $ref: '#/components/responses/CreateCampaignBadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredit'
        '403':
          $ref: '#/components/responses/CreateCampaignForbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/IdempotencyKeyConflict'
        '422':
          $ref: '#/components/responses/CreateCampaignUnprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKeyAuth: []
        - apiKeyBearerAuth: []
components:
  parameters:
    idempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: |
        A unique string identifying this request, used to safely retry write
        operations (create, stop, budget increase/decrease) without repeating
        side effects. Required on every request that references this parameter.
        Reusing this key with an unchanged request body replays the original
        response; reusing it with a different body returns
        `409 idempotency_key_conflict`. Keys are honored for 24 hours.
  schemas:
    CreateCampaignRequest:
      description: |
        Create a wallet-funded campaign. When `strategyType` is `custom`,
        `tierTargeting` is required. For `maximum_growth`, `market_discovery`,
        or `revenue_maximization`, do not send `tierTargeting` (platform default
        tiering applies).
      oneOf:
        - $ref: '#/components/schemas/CreateCampaignRequestWithoutTiers'
        - $ref: '#/components/schemas/CreateCampaignRequestCustom'
    CreateCampaignResponse:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: '#/components/schemas/CampaignCreateData'
        meta:
          $ref: '#/components/schemas/Meta'
    CreateCampaignRequestWithoutTiers:
      allOf:
        - $ref: '#/components/schemas/CreateCampaignRequestShared'
        - type: object
          required:
            - strategyType
          properties:
            strategyType:
              type: string
              enum:
                - maximum_growth
                - market_discovery
                - revenue_maximization
              description: >
                Non-custom growth strategy. Do not send `tierTargeting` with
                these

                values; the platform applies default tiering.
          not:
            required:
              - tierTargeting
    CreateCampaignRequestCustom:
      allOf:
        - $ref: '#/components/schemas/CreateCampaignRequestShared'
        - type: object
          required:
            - strategyType
            - tierTargeting
          properties:
            strategyType:
              type: string
              enum:
                - custom
              description: >
                Custom growth strategy. Requires `tierTargeting` with a
                non-empty

                `customTierIds` and/or `customTiers` array.
            tierTargeting:
              $ref: '#/components/schemas/TierTargeting'
    CampaignCreateData:
      type: object
      required:
        - campaignId
        - status
      properties:
        campaignId:
          type: string
        status:
          $ref: '#/components/schemas/CampaignStatus'
    Meta:
      type: object
      required:
        - requestId
      properties:
        requestId:
          type: string
          format: uuid
          description: Server-generated request ID. Include when contacting support.
    ErrorResponse:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    CreateCampaignRequestShared:
      type: object
      required:
        - spotifyUrl
        - dailyBudget
        - durationDays
        - genre
      properties:
        spotifyUrl:
          type: string
          format: uri
          description: |
            Spotify track or playlist URL to promote. Must be a valid track or
            playlist link to a resource that currently exists on Spotify.
        dailyBudget:
          type: number
          minimum: 10
          description: |
            USD, per day. Must be at least 10 (same floor as the Soundlink UI).
        durationDays:
          description: >
            Campaign duration in days. Must be an integer from 7 to 30 (UI
            custom

            range), or 60, or 90 (UI dropdown extras).
          oneOf:
            - type: integer
              minimum: 7
              maximum: 30
            - type: integer
              enum:
                - 60
                - 90
        genre:
          $ref: '#/components/schemas/Genre'
        campaignName:
          type: string
          description: >-
            Optional. Server generates a default (track title + short random
            suffix) when omitted.
        creativeDirection:
          $ref: '#/components/schemas/CreativeDirection'
        trackOptions:
          type: object
          description: >-
            Options that only apply when `spotifyUrl` is a track link. Ignored
            when `spotifyUrl` is a playlist link.
          properties:
            artistIdFollow:
              type: string
              description: Pass-through artist identifier.
        clonedFromCampaignId:
          type: string
          format: uuid
          description: >-
            Optional UUID of a campaign in your organization this create is
            cloned from. Records lineage only — it does not copy settings from
            the source; all other create fields must still be provided. Unknown
            or other-organization IDs return `400 invalid_request`.
    TierTargeting:
      type: object
      description: >
        Custom tier targeting. Required when `strategyType` is `custom`: provide
        a

        non-empty `customTierIds` and/or `customTiers` array. Omit entirely for

        non-custom strategies (platform default tiering applies).
      properties:
        customTierIds:
          type: array
          items:
            type: integer
        customTiers:
          type: array
          description: |
            Inline custom tiers to create with the campaign. At most 5 active
            tiers (percentBudget > 0) are allowed; inactive (0%) entries do not
            count toward that limit. Each active tier must receive at least
            $1.50 of dailyBudget (gross). percentBudget values must sum to 100.
          items:
            $ref: '#/components/schemas/CustomTier'
    CampaignStatus:
      type: string
      enum:
        - creating
        - active
        - paused
        - stopped
        - completed
        - failed
        - ended
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable snake_case error code.
          enum:
            - invalid_api_key
            - api_key_revoked
            - api_key_expired
            - mixed_credentials
            - insufficient_scope
            - not_found
            - campaign_not_found
            - invalid_query_parameter
            - invalid_date_range
            - page_size_exceeded
            - invalid_request
            - invalid_genre
            - invalid_duration_or_budget
            - invalid_daily_budget
            - invalid_duration_days
            - invalid_spotify_url
            - invalid_tier_budget_allocation
            - invalid_tier_status
            - tier_update_cooldown
            - wallet_not_enabled
            - insufficient_credit
            - idempotency_key_conflict
            - rate_limit_exceeded
            - invalid_video_url
            - video_import_limit_exceeded
            - video_import_session_not_found
            - internal_error
        message:
          type: string
          description: Human-readable error description. Do not parse programmatically.
        details:
          type: object
          nullable: true
          description: |
            Additive, error-code-specific context (e.g. `available`/`required`
            on `insufficient_credit`). Absent or `null` for error codes that
            carry no extra data.
          additionalProperties: true
    Genre:
      type: string
      description: Strictly validated against the platform's genre list.
      enum:
        - Alternative/Indie
        - Ambient/Sleep
        - Chill/Background
        - Classical
        - Country
        - Electronic/Dance
        - Hip-Hop/R&B
        - Latin/Reggaeton
        - Pop
        - Rock
        - Christmas
    CreativeDirection:
      description: |
        How the campaign's ad creative is produced. Omit entirely to use the
        platform's default (`do_it_for_me`).
      oneOf:
        - $ref: '#/components/schemas/DoItForMeCreativeDirection'
        - $ref: '#/components/schemas/FullControlCreativeDirection'
      discriminator:
        propertyName: type
        mapping:
          do_it_for_me:
            $ref: '#/components/schemas/DoItForMeCreativeDirection'
          full_control:
            $ref: '#/components/schemas/FullControlCreativeDirection'
    CustomTier:
      type: object
      required:
        - name
        - percentBudget
      properties:
        name:
          type: string
        countries:
          type: array
          items:
            type: string
          description: ISO 3166-1 alpha-2 country codes.
        language:
          type: string
          description: ISO 639-1 language code.
        percentBudget:
          type: number
          description: >-
            Share of the campaign budget allocated to this tier. All tiers in a
            request must sum to 100.
    DoItForMeCreativeDirection:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - do_it_for_me
          description: Soundlink selects and produces the ad creative.
    FullControlCreativeDirection:
      type: object
      required:
        - type
        - selectedCreatives
      properties:
        type:
          type: string
          enum:
            - full_control
        selectedCreatives:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/SelectedCreative'
          description: >-
            One or more previously imported video creatives to use for the ad.
            Required for full control.
    SelectedCreative:
      type: object
      required:
        - videoId
      properties:
        videoId:
          type: string
          format: uuid
          description: |
            ID of a video previously imported into your video library. Import
            videos via the video import endpoint before referencing them here.
  responses:
    CreateCampaignBadRequest:
      description: |
        Missing or malformed request body, or a missing/empty
        `Idempotency-Key` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing_field:
              value:
                error:
                  code: invalid_request
                  message: 'Missing required field: spotifyUrl.'
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            missing_idempotency_key:
              value:
                error:
                  code: invalid_request
                  message: Idempotency-Key header is required and must not be empty.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
    Unauthorized:
      description: Missing, malformed, revoked, or expired API key
      headers:
        Retry-After:
          schema:
            type: integer
          description: Present only on `rate_limit_exceeded`
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid_api_key:
              value:
                error:
                  code: invalid_api_key
                  message: >-
                    Missing or malformed API key. Expected: sk_<prefix>_<token>
                    (sent via x-api-key or Authorization: Bearer).
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            api_key_revoked:
              value:
                error:
                  code: api_key_revoked
                  message: >-
                    This API key has been revoked. Create a new key in Settings
                    → Developer → API keys.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
    InsufficientCredit:
      description: Wallet balance is too low to cover `dailyBudget * durationDays`
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: insufficient_credit
              message: Insufficient wallet balance for this campaign.
              details:
                available: 120
                required: 350
            meta:
              requestId: 550e8400-e29b-41d4-a716-446655440000
    CreateCampaignForbidden:
      description: |
        Valid key but missing the `campaigns:write` scope, or the calling
        organization is not enabled for wallet billing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficient_scope:
              value:
                error:
                  code: insufficient_scope
                  message: This key does not have the campaigns:write scope.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            wallet_not_enabled:
              value:
                error:
                  code: wallet_not_enabled
                  message: This organization does not have wallet billing enabled.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
    NotFound:
      description: Campaign not found or belongs to another organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: campaign_not_found
              message: Campaign not found.
            meta:
              requestId: 550e8400-e29b-41d4-a716-446655440000
    IdempotencyKeyConflict:
      description: |
        The `Idempotency-Key` was reused with a materially different request
        body, or a request with the same key is still in progress.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            conflicting_body:
              value:
                error:
                  code: idempotency_key_conflict
                  message: >-
                    This Idempotency-Key was already used with a different
                    request body.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            in_progress:
              value:
                error:
                  code: idempotency_key_conflict
                  message: >-
                    A request with this Idempotency-Key is still processing.
                    Retry after a short delay.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
    CreateCampaignUnprocessable:
      description: Request body is well-formed but semantically invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid_genre:
              value:
                error:
                  code: invalid_genre
                  message: genre must be one of the supported values.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            invalid_duration_or_budget:
              value:
                error:
                  code: invalid_duration_or_budget
                  message: dailyBudget and durationDays must be greater than 0.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            invalid_daily_budget:
              value:
                error:
                  code: invalid_daily_budget
                  message: dailyBudget must be at least 10 (USD per day).
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            invalid_duration_days:
              value:
                error:
                  code: invalid_duration_days
                  message: durationDays must be an integer from 7 to 30, or 60, or 90.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            invalid_spotify_url:
              summary: Malformed URL or Spotify track/playlist does not exist
              value:
                error:
                  code: invalid_spotify_url
                  message: Spotify track not found.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            invalid_tier_budget_allocation:
              value:
                error:
                  code: invalid_tier_budget_allocation
                  message: tierTargeting.customTiers[].percentBudget must sum to 100.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
            invalid_request_tier_targeting:
              value:
                error:
                  code: invalid_request
                  message: tierTargeting is only allowed when strategyType is custom.
                meta:
                  requestId: 550e8400-e29b-41d4-a716-446655440000
    RateLimited:
      description: Per-key rate limit exceeded (60/min, 600/hr)
      headers:
        Retry-After:
          required: true
          schema:
            type: integer
          description: Seconds until the rate limit resets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: >-
                Rate limit exceeded. Retry after the number of seconds indicated
                in the Retry-After header.
            meta:
              requestId: 550e8400-e29b-41d4-a716-446655440000
    InternalError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: internal_error
              message: >-
                An unexpected error occurred. Contact support with the
                requestId.
            meta:
              requestId: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >
        Pass your Soundlink `sk_*` API key in the `x-api-key` header.

        Keys can carry explicit scopes (for example `campaigns:read`,
        `metrics:read`, `videos:write`) enforced by the backend.


        **Deprecated, retiring 2026-08-17** — migrate to `Authorization: Bearer
        sk_...` (see `apiKeyBearerAuth`) before then.
    apiKeyBearerAuth:
      type: http
      scheme: bearer
      description: |
        Pass your Soundlink `sk_*` API key as a Bearer token:
        `Authorization: Bearer sk_<prefix>_<token>`. Verified with the exact
        same key as `apiKeyAuth` — just the recommended header for the same
        `sk_*` credential. Do not combine with `x-api-key`.

````