openapi: 3.2.0 info: title: GPT Backend Campaign Images API version: 0.1.0 servers: - url: https://api.usepomo.ai description: Base URL declared by the provider in apis.yml (roadmap#122). tags: - name: Campaign Images paths: /api/campaigns/images/edit-image/job: post: tags: - Campaign Images summary: Start Campaign Image Edit Job description: Start an asynchronous job to generate edited image variations for a campaign asset. operationId: start_campaign_image_edit_job_api_campaigns_images_edit_image_job_post requestBody: content: application/json: schema: $ref: '#/components/schemas/EditImageJobRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/JobResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - HTTPBearer: [] /api/campaigns/images/select-image: post: tags: - Campaign Images summary: Select Campaign Image description: 'Select an image variation for a campaign This endpoint allows users to choose one of the generated image variations and update their campaign with the selected image.' operationId: select_campaign_image_api_campaigns_images_select_image_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ImageSelectionRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ImageSelectionResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - HTTPBearer: [] /api/campaigns/images/select-video: post: tags: - Campaign Images summary: Select Campaign Video description: 'Select a replacement video for a normalized ad campaign. User uploads are first saved to the gallery, then this endpoint links that company-owned video URL to the campaign creative.' operationId: select_campaign_video_api_campaigns_images_select_video_post requestBody: content: application/json: schema: $ref: '#/components/schemas/VideoSelectionRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VideoSelectionResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - HTTPBearer: [] /api/campaigns/images/batch-select-images: post: tags: - Campaign Images summary: Batch Select Campaign Images description: 'Select images for multiple campaigns in batch This is useful when updating multiple ad variations or campaigns with different selected images at once.' operationId: batch_select_campaign_images_api_campaigns_images_batch_select_images_post requestBody: content: application/json: schema: items: $ref: '#/components/schemas/ImageSelectionRequest' type: array title: Requests required: true responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/ImageSelectionResponse' type: array title: Response Batch Select Campaign Images Api Campaigns Images Batch Select Images Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - HTTPBearer: [] /api/campaigns/images/campaign/{campaign_type}/{campaign_id}/image-history: get: tags: - Campaign Images summary: Get Campaign Image History description: 'Get the image history for a campaign This can be extended to track all image changes over time' operationId: get_campaign_image_history_api_campaigns_images_campaign__campaign_type___campaign_id__image_history_get security: - HTTPBearer: [] parameters: - name: campaign_type in: path required: true schema: type: string title: Campaign Type - name: campaign_id in: path required: true schema: type: string title: Campaign Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: 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 type: object required: - loc - msg - type title: ValidationError VideoSelectionResponse: properties: success: type: boolean title: Success campaign_id: anyOf: - type: string format: uuid - type: string title: Campaign Id campaign_type: type: string title: Campaign Type selected_video_url: type: string title: Selected Video Url selected_thumbnail_url: type: string title: Selected Thumbnail Url selected_companion_image_url: anyOf: - type: string - type: 'null' title: Selected Companion Image Url message: type: string title: Message type: object required: - success - campaign_id - campaign_type - selected_video_url - selected_thumbnail_url - message title: VideoSelectionResponse description: Response schema for video selection. ImageSelectionResponse: properties: success: type: boolean title: Success campaign_id: anyOf: - type: string format: uuid - type: string title: Campaign Id campaign_type: type: string title: Campaign Type selected_image_url: type: string title: Selected Image Url message: type: string title: Message type: object required: - success - campaign_id - campaign_type - selected_image_url - message title: ImageSelectionResponse description: Response schema for image selection EditImageJobRequest: properties: image_url: type: string title: Image Url edit_prompt: type: string title: Edit Prompt num_variations: type: integer maximum: 3.0 minimum: 1.0 title: Num Variations default: 3 product_image_url: anyOf: - type: string - type: 'null' title: Product Image Url logo_image_url: anyOf: - type: string - type: 'null' title: Logo Image Url campaign_id: anyOf: - type: string - type: 'null' title: Campaign Id campaign_type: anyOf: - type: string - type: 'null' title: Campaign Type ad_id: anyOf: - type: string - type: 'null' title: Ad Id idea_number: anyOf: - type: integer - type: 'null' title: Idea Number use_company_style: type: boolean title: Use Company Style default: false type: object required: - image_url - edit_prompt title: EditImageJobRequest description: Request body for starting an async campaign image edit job ImageSelectionRequest: properties: campaign_id: anyOf: - type: string format: uuid - type: string title: Campaign Id description: Campaign ID (can be UUID database ID or string campaign_id) campaign_type: type: string title: Campaign Type description: Type of campaign (e.g., google_display, meta_feed, social_post) selected_image_url: type: string title: Selected Image Url description: URL of the selected image variation selection_mode: type: string enum: - replace - add - add_and_set_primary title: Selection Mode description: 'How to apply the selected image: replace current, add to list, or add and set as primary' default: replace variation_index: anyOf: - type: integer - type: 'null' title: Variation Index description: Index of the selected variation (0-based) total_variations: anyOf: - type: integer - type: 'null' title: Total Variations description: Total number of variations that were presented selection_metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Selection Metadata description: Additional metadata about the selection ad_id: anyOf: - type: string - type: 'null' title: Ad Id description: Specific ad ID for ad campaigns (when updating a specific ad variation) type: object required: - campaign_id - campaign_type - selected_image_url title: ImageSelectionRequest description: Request schema for selecting an image variation for a campaign VideoSelectionRequest: properties: campaign_id: anyOf: - type: string format: uuid - type: string title: Campaign Id description: Campaign ID (can be UUID database ID or string campaign_id) campaign_type: type: string title: Campaign Type description: Type of campaign (e.g., google_video, tiktok_video) selected_video_url: type: string title: Selected Video Url description: URL of the selected video asset variation_index: anyOf: - type: integer - type: 'null' title: Variation Index description: Index of the selected video (0-based) total_variations: anyOf: - type: integer - type: 'null' title: Total Variations description: Total number of videos that were presented selection_metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Selection Metadata description: Additional metadata about the selection ad_id: anyOf: - type: string - type: 'null' title: Ad Id description: Specific ad ID for ad campaigns type: object required: - campaign_id - campaign_type - selected_video_url title: VideoSelectionRequest description: Request schema for selecting or uploading a replacement video for a campaign. JobResponse: properties: job_id: type: string title: Job Id description: Unique job identifier status: type: string title: Status description: Initial job status (typically 'running') stream_url: type: string title: Stream Url description: SSE endpoint for real-time progress poll_url: type: string title: Poll Url description: HTTP endpoint for polling status type: object required: - job_id - status - stream_url - poll_url title: JobResponse description: Response after submitting a job example: job_id: 987fcdeb-51a2-43f7-9876-543210987654 poll_url: /api/chat/agentic/jobs/987fcdeb-51a2-43f7-9876-543210987654 status: running stream_url: /api/chat/agentic/jobs/987fcdeb-51a2-43f7-9876-543210987654/stream securitySchemes: HTTPBearer: type: http scheme: bearer