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

# Start a creative session (saves the brief and generates drafts with your key)



## OpenAPI

````yaml /openapi/buyer.yaml post /api/v2/buyer/campaigns/{id}/creative-sessions
openapi: 3.1.0
info:
  title: Semicola Exchange buyer API
  version: 2.0.0
  description: >-
    Buyer endpoints: advertisers, storefronts and connections, product
    discovery, campaigns, proposals, media buys, creatives and reporting. Every
    write accepts an Idempotency-Key header.
servers:
  - url: https://api.semicola.com
security:
  - bearerAuth: []
  - sessionCookie: []
tags:
  - name: Advertisers
  - name: Storefronts
  - name: Product Discovery
  - name: Campaigns
  - name: Media Buys
  - name: Update Proposals
  - name: Optimization Suggestions
  - name: Creatives
  - name: Catalogs
  - name: Property Lists
  - name: Audiences
  - name: Syndication
  - name: Reporting
  - name: Event Sources
  - name: Webhooks
  - name: Tasks
  - name: Audit Logs
  - name: Activity
paths:
  /api/v2/buyer/campaigns/{id}/creative-sessions:
    post:
      tags:
        - Creatives
      summary: >-
        Start a creative session (saves the brief and generates drafts with your
        key)
      operationId: postBuyerCampaignsByIdCreativeSessions
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 5000
                title:
                  type: string
                  maxLength: 200
                objective:
                  type: string
                  maxLength: 500
                persona:
                  type: string
                  maxLength: 500
                engine:
                  type: object
                  properties:
                    engineId:
                      type: string
                      pattern: ^[1-9]\d{0,18}$
                    connectionId:
                      type: string
                      minLength: 1
                  required:
                    - engineId
                    - connectionId
                  additionalProperties: false
                provider_type:
                  type: string
                  enum:
                    - openai
                    - gemini
                    - fal
                format_kind:
                  type: string
                  enum:
                    - image
                    - audio_hosted
                    - video_hosted
                params:
                  default: {}
                  type: object
                  properties:
                    width:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 4096
                    height:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 4096
                    duration_ms_exact:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 600000
                  additionalProperties: false
                reference_asset_ids:
                  maxItems: 10
                  type: array
                  items:
                    type: string
                    minLength: 1
                variant_count:
                  type: integer
                  minimum: 1
                  maximum: 4
                action_key:
                  type: string
                  minLength: 8
                  maxLength: 128
              required:
                - prompt
                - format_kind
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    anyOf:
                      - type: object
                        properties:
                          session:
                            type: object
                            properties:
                              creative_session_id:
                                type: string
                              campaign_id:
                                type: string
                              engine:
                                type: object
                                properties:
                                  engineId:
                                    type: string
                                  connectionId:
                                    type: string
                                required:
                                  - engineId
                                  - connectionId
                                additionalProperties: false
                              title:
                                type: string
                              persona:
                                type: string
                              objective:
                                type: string
                              prompt:
                                type: string
                              accumulated_feedback:
                                type: array
                                items:
                                  type: string
                              status:
                                type: string
                                enum:
                                  - drafting
                                  - refining
                                  - evaluating
                                  - finalized
                              revision:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              session_generation:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              creative_plan:
                                type: object
                                properties:
                                  provider_type:
                                    type: string
                                  modality:
                                    type: string
                                    enum:
                                      - image
                                      - video
                                      - audio
                                  format_kind:
                                    type: string
                                    enum:
                                      - image
                                      - audio_hosted
                                      - video_hosted
                                  params:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: number
                                required:
                                  - modality
                                  - format_kind
                                  - params
                                additionalProperties: false
                              flow:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    label:
                                      type: string
                                    state:
                                      type: string
                                      enum:
                                        - done
                                        - current
                                        - pending
                                    summary:
                                      type: string
                                  required:
                                    - label
                                    - state
                                    - summary
                                  additionalProperties: false
                              variants:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    build_variant_id:
                                      type: string
                                    parent_build_variant_id:
                                      type: string
                                    name:
                                      type: string
                                    direction:
                                      type: string
                                    rationale:
                                      type: string
                                    quality:
                                      type: string
                                      enum:
                                        - draft
                                        - production
                                    status:
                                      type: string
                                      enum:
                                        - draft
                                        - selected
                                        - refined
                                        - finalized
                                    recommended:
                                      type: boolean
                                    preview:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - image
                                            - video
                                            - audio
                                        url:
                                          type: string
                                      required:
                                        - type
                                        - url
                                      additionalProperties: false
                                    score:
                                      type: number
                                    evaluation:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          evaluator_id:
                                            type: string
                                          evaluator_version:
                                            type: string
                                          category:
                                            type: string
                                            enum:
                                              - readiness
                                              - asset
                                              - brand_brief
                                              - format_seller
                                              - policy_safety
                                              - performance
                                          code:
                                            type: string
                                          label:
                                            type: string
                                          stage:
                                            type: string
                                            enum:
                                              - draft
                                              - final
                                          status:
                                            type: string
                                            enum:
                                              - pass
                                              - warn
                                              - fail
                                          detail:
                                            type: string
                                          severity:
                                            type: string
                                            enum:
                                              - hard
                                              - soft
                                          blocking:
                                            type: boolean
                                        required:
                                          - evaluator_id
                                          - evaluator_version
                                          - category
                                          - code
                                          - label
                                          - stage
                                          - status
                                          - detail
                                          - severity
                                          - blocking
                                        additionalProperties: false
                                  required:
                                    - build_variant_id
                                    - name
                                    - direction
                                    - rationale
                                    - quality
                                    - status
                                    - preview
                                  additionalProperties: false
                              selected_variant_id:
                                type: string
                              refined_variant_id:
                                type: string
                              approval:
                                type: object
                                properties:
                                  variant_id:
                                    type: string
                                  session_revision:
                                    type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                  output_hash:
                                    type: string
                                required:
                                  - variant_id
                                  - session_revision
                                  - output_hash
                                additionalProperties: false
                              format_renders:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    format_id:
                                      type: string
                                  required:
                                    - format_id
                                  additionalProperties: false
                              notices:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    code:
                                      type: string
                                      const: variant_count_mismatch
                                    severity:
                                      type: string
                                      enum:
                                        - info
                                        - warn
                                    message:
                                      type: string
                                  required:
                                    - code
                                    - severity
                                    - message
                                  additionalProperties: false
                              finalization:
                                type: object
                                properties:
                                  creative_id:
                                    type: string
                                  manifest_id:
                                    type: string
                                  sync_status:
                                    type: string
                                  summary:
                                    type: string
                                required:
                                  - creative_id
                                  - manifest_id
                                  - sync_status
                                  - summary
                                additionalProperties: false
                              truncated:
                                type: boolean
                              omitted:
                                type: array
                                items:
                                  type: string
                            required:
                              - creative_session_id
                              - campaign_id
                              - title
                              - persona
                              - objective
                              - prompt
                              - accumulated_feedback
                              - status
                              - revision
                              - session_generation
                              - creative_plan
                              - flow
                              - variants
                              - format_renders
                              - notices
                            additionalProperties: false
                          revision:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          sessionGeneration:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          actionId:
                            type: string
                          status:
                            type: string
                            enum:
                              - submitted
                              - completed
                              - partial
                              - failed
                              - uncertain
                          leaves:
                            type: array
                            items:
                              type: object
                              properties:
                                leafId:
                                  type: string
                                status:
                                  type: string
                                  enum:
                                    - submitted
                                    - completed
                                    - failed
                                    - uncertain
                                taskId:
                                  type:
                                    - string
                                    - 'null'
                                variantIds:
                                  type: array
                                  items:
                                    type: string
                                error:
                                  type: string
                              required:
                                - leafId
                                - status
                                - taskId
                                - variantIds
                              additionalProperties: false
                          funding:
                            type: object
                            properties:
                              fundedBy:
                                type: string
                                const: buyer
                              provider:
                                type: string
                              keySource:
                                type: string
                                enum:
                                  - engine_connection
                                  - model_credential
                              connectionId:
                                type:
                                  - string
                                  - 'null'
                              credentialId:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - fundedBy
                              - provider
                              - keySource
                              - connectionId
                              - credentialId
                            additionalProperties: false
                          sessionTruncated:
                            type: boolean
                          sessionOmitted:
                            type: array
                            items:
                              type: string
                        required:
                          - session
                          - revision
                          - sessionGeneration
                          - actionId
                          - status
                          - leaves
                          - funding
                        additionalProperties: false
                      - type: 'null'
                  error:
                    anyOf:
                      - type: object
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                          field:
                            type: string
                          details: {}
                        required:
                          - code
                          - message
                        additionalProperties: false
                      - type: 'null'
                required:
                  - data
                  - error
                additionalProperties: false
        default:
          description: >-
            Error envelope `{data: null, error: {code, message, field?,
            details?}}`.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or OAuth access token.
    sessionCookie:
      type: apiKey
      in: cookie
      name: sc_session

````