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

# Crear una campaña de señal

> Una campaña de señal se compara con lo que se dice en tus fuentes. Si hay una coincidencia antes de un corte, el marcador de ese corte incluye el ID de la campaña, las palabras clave y los identificadores externos.



## OpenAPI

````yaml reference/openapi.json POST /v1/campaigns
openapi: 3.1.0
info:
  title: Interactive Layers Context API
  description: >

    Interactive Layers reads what is said on your channel and turns it into ad
    signals.


    * **Signal mode** (`mode=signal`): your program is untouched; every break of
    the output manifest carries an
      `EXT-X-DATERANGE CLASS="com.interactivelayers.signal"` with the matching campaign ids, keywords, your external ids
      (e.g. SpringServe) and a brand-safety status, so your ad server can target the break.
    * **Live SSAI** (`mode=ssai`): supported live pipelines can stitch ads and
    in-band supers.

    * **Legacy URL scan**: enriched VOD manifest with signals; `ssai` adds
    supers. No ad segment replacement.

    * **Asset analysis and operations**: saved moments, campaign previews and
    airing/playback notifications.
      GAM profiles use client-side VAST/IMA. SpringServe profiles produce revision-bound SSAI signals;
      the OTTera transport remains pending external validation. Campaign synchronization is read-only.

    Authenticate with the `X-API-Key` header (keys are issued by Interactive
    Layers). Errors are `{"detail": "..."}`.

    Events can be polled (`GET /v1/events`) or pushed to a signed webhook (`PUT
    /v1/keys/me/webhook`).

    Content catalog and batch operations use their own scoped server key in
    `Authorization: Bearer …`.
  version: '1.2'
servers:
  - url: https://console.interactivelayers.com
security: []
tags:
  - name: AdRouter
    description: Advertising routing, simulation, delivery and reports per project.
  - name: Advertising providers
    description: >-
      GAM and SpringServe connections, profiles and read-only campaign
      synchronization.
  - name: Keys
    description: The calling API key and its signed webhook.
  - name: Campaigns
    description: >-
      Signal campaigns: categories, keywords and the external ids written into
      break markers when the context matches.
  - name: Sources
    description: >-
      Realtime sources (HLS or YouTube) in `signal` or `ssai` mode and their
      enriched output manifest.
  - name: Events
    description: 'Events of your sources: opportunities, break signals, brand-safety holds.'
  - name: Assets
    description: >-
      Create, list, retrieve, rename and delete private video assets. Use
      asset_id as the input to a VOD analysis.
  - name: VOD operations
    description: >-
      Evaluate campaigns from saved asset analyses, schedule airings and send
      playback notifications.
  - name: VOD
    description: >-
      Ahead-of-time VOD scans, faster than real time: transcript, opportunities,
      brand-safety holds, a targeting signal per break and the enriched VOD
      manifest.
paths:
  /v1/campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a signal campaign
      description: >-
        A signal campaign is matched against what is said on your sources; when
        it matches before a break, its id, keywords and external ids go into
        that break's marker.
      operationId: create_v1_campaigns_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignV1In'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignV1Out'
        '401':
          description: Missing, invalid or revoked API key
        '403':
          description: The API key lacks the required scope
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CampaignV1In:
      properties:
        campaign_id:
          anyOf:
            - type: string
              pattern: ^[a-z0-9][a-z0-9-]{2,39}$
            - type: 'null'
          title: Campaign Id
          description: Optional id (lowercase slug). Generated when omitted.
        name:
          type: string
          maxLength: 80
          minLength: 2
          title: Name
        brand_name:
          type: string
          maxLength: 60
          minLength: 1
          title: Brand Name
        categories:
          items:
            type: string
          type: array
          maxItems: 20
          minItems: 1
          title: Categories
          description: Context categories (natural language) that trigger the campaign.
        keywords:
          items:
            type: string
          type: array
          maxItems: 30
          title: Keywords
          description: Targeting keywords written into the break marker.
        external_ids:
          additionalProperties:
            type: string
          type: object
          title: External Ids
          description: 'Ids in your ad stack, e.g. `{"springserve": "123"}`.'
        brief:
          type: string
          maxLength: 2000
          title: Brief
          default: ''
        positive_examples:
          items:
            type: string
          type: array
          maxItems: 20
          title: Positive Examples
        negative_examples:
          items:
            type: string
          type: array
          maxItems: 20
          title: Negative Examples
        safety_rules:
          items:
            type: string
          type: array
          maxItems: 20
          title: Safety Rules
        trigger_mode:
          type: string
          enum:
            - need
            - topic
          title: Trigger Mode
          description: >-
            `need`: someone expresses an own need; `topic`: the conversation is
            about it.
          default: need
        active:
          type: boolean
          title: Active
          default: true
        start_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Start At
          description: Unix seconds
        end_at:
          anyOf:
            - type: number
            - type: 'null'
          title: End At
          description: Unix seconds
        sources:
          items:
            type: string
          type: array
          maxItems: 50
          title: Sources
          description: Restrict to these source ids (empty = all your sources).
      type: object
      required:
        - name
        - brand_name
        - categories
      title: CampaignV1In
      examples:
        - active: true
          brand_name: Acme Water
          brief: >-
            Bottled water for people who are thirsty or talk about staying
            hydrated.
          campaign_id: acme-hydration
          categories:
            - bebidas
            - hidratación
          external_ids:
            gam_line_item: '987654'
            springserve: '123456'
          keywords:
            - water
            - hydration
            - sports
          name: Acme hydration Q4
          negative_examples:
            - El agua del río estaba helada
          positive_examples:
            - Tengo mucha sed
          safety_rules:
            - tragedias o accidentes
          sources: []
          trigger_mode: need
    CampaignV1Out:
      properties:
        campaign_id:
          type: string
          title: Campaign Id
        name:
          type: string
          title: Name
        brand_name:
          type: string
          title: Brand Name
        categories:
          items:
            type: string
          type: array
          title: Categories
        keywords:
          items:
            type: string
          type: array
          title: Keywords
        external_ids:
          additionalProperties:
            type: string
          type: object
          title: External Ids
        brief:
          type: string
          title: Brief
        positive_examples:
          items:
            type: string
          type: array
          title: Positive Examples
        negative_examples:
          items:
            type: string
          type: array
          title: Negative Examples
        safety_rules:
          items:
            type: string
          type: array
          title: Safety Rules
        trigger_mode:
          type: string
          title: Trigger Mode
        active:
          type: boolean
          title: Active
        start_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Start At
        end_at:
          anyOf:
            - type: number
            - type: 'null'
          title: End At
        sources:
          items:
            type: string
          type: array
          title: Sources
        created_at:
          type: number
          title: Created At
        updated_at:
          type: number
          title: Updated At
      type: object
      required:
        - campaign_id
        - name
        - brand_name
        - categories
        - keywords
        - external_ids
        - brief
        - positive_examples
        - negative_examples
        - safety_rules
        - trigger_mode
        - active
        - sources
        - created_at
        - updated_at
      title: CampaignV1Out
      examples:
        - active: true
          brand_name: Acme Water
          brief: >-
            Bottled water for people who are thirsty or talk about staying
            hydrated.
          campaign_id: acme-hydration
          categories:
            - bebidas
            - hidratación
          created_at: 1793635200
          external_ids:
            gam_line_item: '987654'
            springserve: '123456'
          keywords:
            - water
            - hydration
            - sports
          name: Acme hydration Q4
          negative_examples:
            - El agua del río estaba helada
          positive_examples:
            - Tengo mucha sed
          safety_rules:
            - tragedias o accidentes
          sources: []
          trigger_mode: need
          updated_at: 1793635200
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: >-
        Partner API key (`ck_…`). Created by Interactive Layers; shown only
        once.
      in: header
      name: X-API-Key

````

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