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

# Link External Campaign

> Link a Decoda campaign to an external ad-platform campaign.



## OpenAPI

````yaml post /opportunity/campaign/{campaign_id}/external-campaign
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/campaign/{campaign_id}/external-campaign:
    post:
      tags:
        - Campaigns
      summary: Link External Campaign
      description: Link a Decoda campaign to an external ad-platform campaign.
      operationId: >-
        link_external_campaign_opportunity_campaign__campaign_id__external_campaign_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            title: Campaign Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkExternalCampaignRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignExternalIdentitySummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LinkExternalCampaignRequest:
      properties:
        platformAssetId:
          type: string
          minLength: 1
          title: Platformassetid
        externalCampaignId:
          type: string
          minLength: 1
          title: Externalcampaignid
      type: object
      required:
        - platformAssetId
        - externalCampaignId
      title: LinkExternalCampaignRequest
      description: Assign one account-scoped provider Campaign to a Decoda Campaign.
    CampaignExternalIdentitySummary:
      properties:
        campaignId:
          type: string
          title: Campaignid
        platformAssetId:
          type: string
          title: Platformassetid
        externalCampaignId:
          type: string
          title: Externalcampaignid
        externalResourceName:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalresourcename
        externalName:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalname
        externalStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalstatus
        externalCurrency:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalcurrency
        externalDailyBudgetCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Externaldailybudgetcents
        externalLifetimeBudgetCents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Externallifetimebudgetcents
        externalLastSeenAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externallastseenat
        externalLastSyncedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externallastsyncedat
        externalStaleAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Externalstaleat
        externalSyncError:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalsyncerror
      type: object
      required:
        - campaignId
        - platformAssetId
        - externalCampaignId
      title: CampaignExternalIdentitySummary
      description: Provider-owned identity and latest synchronized state on Campaign.
    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

````