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

# Create a draft marketing social post



## OpenAPI

````yaml /openapi.json post /programs/{id}/marketing-resources/social-posts
openapi: 3.1.0
info:
  title: AgentRef REST API
  version: 1.0.0
  description: >-
    REST API v1 for merchants and affiliates. Authentication via API keys
    (Authorization: Bearer ak_...).
servers:
  - url: /api/v1
    description: Current API version
security:
  - ApiKeyAuth: []
tags:
  - name: Auth
  - name: Onboarding
  - name: Programs
  - name: Merchant
  - name: Applications
  - name: Affiliates
  - name: Me
  - name: Coupons
  - name: Invites
  - name: Conversions
  - name: Payouts
  - name: Flags
  - name: Billing
  - name: Marketplace
  - name: Marketing Resources
  - name: Notifications
  - name: Webhooks
  - name: Docs
  - name: Meta
paths:
  /programs/{id}/marketing-resources/social-posts:
    post:
      tags:
        - Marketing Resources
      summary: Create a draft marketing social post
      operationId: createMarketingSocialPost
      parameters:
        - $ref: '#/components/parameters/UuidPathId'
        - $ref: '#/components/parameters/IdempotencyKeyHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMarketingSocialPostInput'
      responses:
        '201':
          $ref: '#/components/responses/SuccessObjectResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    UuidPathId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    IdempotencyKeyHeader:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
      description: >-
        Client generated idempotency key (recommended for create/financial
        operations).
  schemas:
    CreateMarketingSocialPostInput:
      type: object
      properties:
        title:
          type: string
          maxLength: 160
        description:
          type:
            - string
            - 'null'
          maxLength: 1000
        body:
          type: string
          maxLength: 10000
        platforms:
          type: array
          minItems: 1
          maxItems: 7
          items:
            type: string
            enum:
              - x
              - linkedin
              - instagram
              - tiktok
              - facebook
              - threads
              - generic
        instructions:
          type:
            - string
            - 'null'
          maxLength: 2000
        collection_id:
          type:
            - string
            - 'null'
          format: uuid
        folder_id:
          type:
            - string
            - 'null'
          format: uuid
      required:
        - title
        - body
        - platforms
    RequestMeta:
      type: object
      properties:
        requestId:
          type: string
      required:
        - requestId
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
        meta:
          $ref: '#/components/schemas/RequestMeta'
      required:
        - error
        - meta
  responses:
    SuccessObjectResponse:
      description: Success response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                additionalProperties: true
              meta:
                $ref: '#/components/schemas/RequestMeta'
            required:
              - data
              - meta
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use API key as Bearer token, for example: Bearer ak_live_xxx'

````