> ## 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.

# Create Campaign Post

> Create a social post for a campaign, publishing it immediately if status is PUBLISHED.



## OpenAPI

````yaml post /opportunity/campaign/{campaign_id}/post
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}/post:
    post:
      tags:
        - Campaigns
      summary: Create Campaign Post
      description: >-
        Create a social post for a campaign, publishing it immediately if status
        is PUBLISHED.
      operationId: create_campaign_post_opportunity_campaign__campaign_id__post_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/CampaignPostCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignPostSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CampaignPostCreate:
      properties:
        platformId:
          anyOf:
            - type: string
            - type: 'null'
          title: Platformid
        postType:
          $ref: '#/components/schemas/CampaignPostType'
          default: SOCIAL_POST
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        caption:
          anyOf:
            - type: string
            - type: 'null'
          title: Caption
        ctaText:
          anyOf:
            - type: string
            - type: 'null'
          title: Ctatext
        ctaUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Ctaurl
        scheduledDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduleddate
        status:
          $ref: '#/components/schemas/CampaignPostStatus'
          default: DRAFT
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      type: object
      title: CampaignPostCreate
    CampaignPostSummary:
      properties:
        id:
          type: string
          title: Id
        campaignId:
          type: string
          title: Campaignid
        platformId:
          anyOf:
            - type: string
            - type: 'null'
          title: Platformid
        postType:
          $ref: '#/components/schemas/CampaignPostType'
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        caption:
          anyOf:
            - type: string
            - type: 'null'
          title: Caption
        ctaText:
          anyOf:
            - type: string
            - type: 'null'
          title: Ctatext
        ctaUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Ctaurl
        scheduledDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduleddate
        publishedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Publisheddate
        externalPostId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalpostid
        externalPostUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalposturl
        status:
          $ref: '#/components/schemas/CampaignPostStatus'
          default: DRAFT
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        creatorId:
          type: string
          title: Creatorid
        creatorName:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorname
        media:
          items:
            $ref: '#/components/schemas/CampaignMediaSummary'
          type: array
          title: Media
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
      type: object
      required:
        - id
        - campaignId
        - postType
        - creatorId
      title: CampaignPostSummary
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CampaignPostType:
      type: string
      enum:
        - SOCIAL_POST
        - AD
        - EMAIL
        - BLOG
        - LANDING_PAGE
      title: CampaignPostType
    CampaignPostStatus:
      type: string
      enum:
        - DRAFT
        - SCHEDULED
        - PUBLISHED
        - PAUSED
        - ARCHIVED
      title: CampaignPostStatus
    CampaignMediaSummary:
      properties:
        id:
          type: string
          title: Id
        postId:
          type: string
          title: Postid
        mediaType:
          $ref: '#/components/schemas/CampaignMediaType'
        gcsPath:
          type: string
          title: Gcspath
        fileName:
          type: string
          title: Filename
        fileSizeBytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Filesizebytes
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
        durationSeconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Durationseconds
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
        thumbnailGcsPath:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnailgcspath
        displayOrder:
          type: integer
          title: Displayorder
          default: 0
        altText:
          anyOf:
            - type: string
            - type: 'null'
          title: Alttext
        signedUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Signedurl
      type: object
      required:
        - id
        - postId
        - mediaType
        - gcsPath
        - fileName
      title: CampaignMediaSummary
    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
    CampaignMediaType:
      type: string
      enum:
        - IMAGE
        - VIDEO
        - DOCUMENT
      title: CampaignMediaType

````